Guides

Claude Code permissions: stop clicking "Allow" 100 times

Permission prompts protect you, but approving git status for the fortieth time trains you to click "Allow" without reading. The fix is to auto-approve what's genuinely safe, hard-deny what must never happen, and keep prompts for the risky middle.

Permission modes

ModeWhat it doesUse it for
defaultPrompts the first time each tool or command is usedEveryday work
acceptEditsAuto-accepts file edits, still prompts for other actionsIterating quickly in a clean git tree
planRead-only: Claude researches and proposes a plan without changing anythingBig or unfamiliar changes
bypassPermissionsSkips all permission promptsOnly isolated containers or VMs

Press Shift+Tab to cycle modes during a session, or start with claude --permission-mode plan. Set a default with "defaultMode" inside permissions in settings.json.

About bypass mode (--dangerously-skip-permissions): with no prompts, one bad command can delete files, push code or leak credentials. Use it only somewhere disposable, with no production credentials and nothing you can't recreate.

Rule syntax

Rules go in permissions.allow, permissions.ask or permissions.deny in a settings file:

Deny beats ask, and ask beats allow. A deny rule can't be overridden by a broader allow rule.

A starter allowlist (read-only and project checks)

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(git diff:*)",
      "Bash(git log:*)",
      "Bash(git branch:*)",
      "Bash(ls:*)",
      "Bash(npm run lint)",
      "Bash(npm run typecheck)",
      "Bash(npm test:*)"
    ],
    "ask": [
      "Bash(git push:*)",
      "Bash(npm install:*)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./**/*.pem)",
      "Read(./secrets/**)"
    ]
  }
}

Swap in your stack's commands, such as pytest, go test or cargo test. Keep allow rules narrow:

Deny rules for secrets

A deny rule on Read(./.env) stops Claude opening the file with its Read tool. It doesn't stop cat .env through Bash unless Bash is also restricted. Treat deny rules as one layer, and keep real production secrets out of your development machine entirely.

Where hooks fit

Prefix rules can't express "allow rm -rf ./build but never rm -rf ~/". Hooks can, because they inspect the full command with real code and block it with exit code 2. A good setup uses both:

Tips

Skip the setup: get the tested versions

Keelwork bundles 10 workflow skills, 5 tested safety hooks (including a full guard-bash and a secret scanner), 3 subagents and 5 CLAUDE.md templates, with a one-command installer that safely merges into your settings.

Get Keelwork — $24 →