CP — 03
Step 2. Add permissions
Builds on step 1. The commands you listed there become your allow list. The "do not run" commands become your deny list.
01 — 2 · permissions
What to do
Why: without this, Claude asks before every command, or the team clicks "always allow" until the list is meaningless.
Do this:
- Create
.claude/settings.json and commit it. This is the shared team policy. - Put routine, safe commands in
allow. - Put anything outward-facing or hard to undo in
ask: push, merge, deploy, schema changes. - Put commands that have a safer project alternative in
deny. - Personal approvals go in
.claude/settings.local.json. Add that file to the repo's .gitignore.
02 — 2 · permissions
Example
Example:
json
{
"permissions": {
"allow": [
"Bash(npm run format)",
"Bash(npm run lint)",
"Bash(npm run typecheck)",
"Bash(npm test*)",
"Bash(git status*)",
"Bash(git diff*)",
"Bash(git log*)"
],
"ask": [
"Bash(git push*)",
"Bash(git merge*)",
"Bash(git reset*)"
],
"deny": [
"Bash(npm run build*)",
"Read(./.env)",
"Read(./.env.*)"
]
}
}
03 — 2 · permissions
Check it works
Check:
- Ask Claude to run a denied command. It should refuse.
- Run your daily commands. No prompt should appear.
- After a normal session,
git status should not list settings.local.json.
Watch out:
Bash(git *) looks convenient but also allows force-push and hard reset. Allow specific read-only verbs instead.- Deny rules match command text. Wrapping a command in
bash -c or a script file can slip past. Treat deny rules as a seatbelt, not a sandbox. settings.local.json fills up over time. Prune it now and then.