Auto-Approve Hooks for Claude Code

Stop clicking "Allow" for every cat, ls, and git status. Use hooks to auto-approve safe commands while keeping dangerous operations gated.

667 hooks 9,200+ tests

The Problem

Claude Code prompts for every tool call by default. For read-only commands like cat, ls, grep, and git status, this is unnecessary friction. But you don't want to use --dangerously-skip-permissions and lose ALL safety checks.

Hooks let you auto-approve the safe commands while keeping prompts for dangerous ones.

Quick Start: Auto-Approve Read-Only Commands

npx cc-safe-setup --install-example auto-approve-readonly

This installs a PreToolUse hook on Bash that auto-approves: cat, ls, grep, find, git status, git log, git diff, npm list, pip list, and 40+ more read-only commands.

Available Auto-Approve Hooks

HookWhat it auto-approvesInstall
auto-approve-readonlycat, ls, grep, find, git read commands--install-example auto-approve-readonly
auto-approve-readonly-toolsRead, Glob, Grep tools (PermissionRequest)--install-example auto-approve-readonly-tools
auto-approve-buildnpm run, make, cargo build--install-example auto-approve-build
auto-approve-testnpm test, pytest, cargo test, go test--install-example auto-approve-test
auto-approve-pythonpython, pip list, pip show--install-example auto-approve-python
auto-approve-dockerdocker ps, docker logs, docker inspect--install-example auto-approve-docker
auto-approve-gogo build, go test, go vet--install-example auto-approve-go
auto-approve-cargocargo build, cargo test, cargo clippy--install-example auto-approve-cargo
auto-approve-git-readgit log, git blame, git show--install-example auto-approve-git-read
auto-approve-compound-gitcd && git log, cd && git status (PermissionRequest)--install-example auto-approve-compound-git
auto-approve-sshssh-keygen -l, ssh-add -l--install-example auto-approve-ssh

PermissionRequest: Bypass Protected Directory Prompts

Claude Code has built-in checks for protected directories (.claude/, .git/hooks/). PreToolUse hooks can't bypass these — they run before the built-in checks. Use PermissionRequest hooks instead:

Auto-approve all tool calls (replaces broken bypassPermissions)

{
  "hooks": {
    "PermissionRequest": [
      {
        "matcher": "",
        "hooks": [{
          "type": "command",
          "command": "echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"permissionDecision\":\"allow\",\"permissionDecisionReason\":\"auto-approved\"}}'"
        }]
      }
    ]
  }
}
⚠ This approves EVERYTHING. Use only in disposable environments (Docker, CI). For targeted bypass, use the hooks above.

Auto-approve .git/hooks/ directory only

npx cc-safe-setup --install-example allow-git-hooks-dir

Auto-approve .claude/settings.json edits

npx cc-safe-setup --install-example allow-claude-settings

Hook Execution Order

Understanding why PermissionRequest exists:

StepHook TypePurpose
1PreToolUseBlock dangerous actions (exit 2 = block)
2Built-in checksProtected directory prompts (not hookable)
3PermissionRequestAuto-approve prompts from step 2

Rule of thumb: PreToolUse = block dangerous. PermissionRequest = allow trusted.

Install Everything

Installs 8 safety hooks + project-specific recommendations. 655 example hooks available. 9,200+ tests.

GitHub · npm · All Tools