Skip to main content

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 project
  • claudeguard status - Show configuration
  • claudeguard create-profile - Create new profile
  • claudeguard list-profiles - List profiles
  • claudeguard switch-profile - Switch profile
  • claudeguard delete-profile - Delete profile
  • claudeguard 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.

Metadata

Release files for claudeguard 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claudeguard 0.1.3
File Size Uploaded
claudeguard-0.1.3.tar.gz 138.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claudeguard 0.1.3
File Interpreter ABI Platform
claudeguard-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 157.9 kB

Release files / claudeguard-0.1.3.tar.gz

Download URL claudeguard-0.1.3.tar.gz
Size 138.5 kB
Tags Source
SHA-256 checksum
How to use checksums
452df09a98479741f857e2dd3c910e1b49b4e55ce98d62acbf1d0aff70172958
BLAKE2b-256 checksum
How to use checksums
194aead1275bb80dd40bce615f8ee15c38ddba49678d5ade7c4f16cd57f29b91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.9

Release files / claudeguard-0.1.3-py3-none-any.whl

Download URL claudeguard-0.1.3-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78cddc5a60322d375d9a294c4c5680c04df1a9c32a1d7792712338ee4a4fcf06
BLAKE2b-256 checksum
How to use checksums
39daf69bd8cbff2b1cb182a553c32e76ae7c362a067ef0131325601f660a3d9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.9

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page