Claude Code security guard - an alternative Claude Code permission framework
Project description
claudeguard
claudeguard enhances Claude Code with automated security decisions using pattern matching and team-shareable profiles.
Why claudeguard?
Claude Code's permission prompts are great for security but repetitive for routine tasks. claudeguard automates common decisions while keeping you in control of sensitive operations.
How it works
claudeguard uses the PreToolUse Claude Code hook to intercept tool calls and override Claude Code's builtin permission logic
Features
- Pattern matching:
Edit(src/**),Bash(/git status/),Bash(rm -rf*) - Team sharing: Profiles stored in
.claudeguard/profiles/ - Zero config: Works immediately with sensible rules
Quick Start
# Install
uv tool install claudeguard
# Setup in your project
cd your-claude-code-project
claudeguard install
# Use Claude Code normally
claude
How It Works
claudeguard matches tool calls against rules in .claudeguard/profiles/default.yaml:
rules:
- pattern: "Read(*)"
action: allow
- pattern: "Edit(*.md)"
action: allow
- pattern: "Bash(/git (status|diff)/)"
action: allow
- pattern: "Edit(src/**)"
action: ask
- pattern: "Bash(rm -rf*)"
action: deny
- pattern: "*"
action: ask
First matching rule wins. Actions: allow, ask, deny.
Commands
claudeguard install- Setup in current projectclaudeguard status- Show configurationclaudeguard create-profile- Create new profileclaudeguard list-profiles- List profilesclaudeguard switch-profile- Switch profileclaudeguard delete-profile- Delete profileclaudeguard uninstall- Remove from project
Pattern Examples
| Pattern | Matches | Action |
|---|---|---|
Read(*) |
All file reads | allow |
Edit(*.md) |
Markdown files | allow |
Bash(/git (status|diff)/) |
Safe git commands | allow |
Edit(src/**) |
Code files | ask |
Bash(rm -rf*) |
Destructive commands | deny |
Custom Profiles
Create profiles for different security levels:
# .claudeguard/profiles/strict.yaml
name: "strict-policy"
description: "Strict security for production"
rules:
- pattern: "Read(*)"
action: allow
- pattern: "Edit(docs/**)"
action: allow
- pattern: "Edit(*)"
action: ask
- pattern: "Bash(/git (status|diff|log)/)"
action: allow
- pattern: "Bash(*)"
action: deny
- pattern: "*"
action: deny
Development
git clone https://github.com/tarovard/claudeguard
cd claudeguard
uv sync # Install dependencies
uv run pre-commit install # Setup git hooks
# Test and lint
uv run pytest # Run tests
uv run mypy src tests # Type checking
uv run ruff check --fix . # Format and lint
License
MIT - see LICENSE file.
Contributing
Bug reports and feature requests welcome at GitHub Issues.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claudeguard-0.1.3.tar.gz.
File metadata
- Download URL: claudeguard-0.1.3.tar.gz
- Upload date:
- Size: 138.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
452df09a98479741f857e2dd3c910e1b49b4e55ce98d62acbf1d0aff70172958
|
|
| MD5 |
b5a725e5228e22dd2eb1df419a198a2b
|
|
| BLAKE2b-256 |
194aead1275bb80dd40bce615f8ee15c38ddba49678d5ade7c4f16cd57f29b91
|
File details
Details for the file claudeguard-0.1.3-py3-none-any.whl.
File metadata
- Download URL: claudeguard-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78cddc5a60322d375d9a294c4c5680c04df1a9c32a1d7792712338ee4a4fcf06
|
|
| MD5 |
f6d99503ba8e437765c1199dd429ea3e
|
|
| BLAKE2b-256 |
39daf69bd8cbff2b1cb182a553c32e76ae7c362a067ef0131325601f660a3d9a
|