Blog · · Dimitris Kyriakakis
Claude Code permission rules explained: allow, ask, deny, and what Always should cover
Claude Code asks before it runs a command or edits a file. Rules decide which requests it stops asking about.
Three kinds of rule
In settings.json, under permissions:
- allow: runs without asking.
- ask: always asks.
- deny: never runs.
{
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git commit *)"],
"deny": ["Bash(git push *)"]
}
}
Which rule wins
Deny, then ask, then allow. The first match in that order decides, and how specific a rule is doesn't change the order.
So a deny rule Bash(aws *) blocks aws s3 ls even if you also allowed Bash(aws s3 ls). An allow rule can't carve an exception out of a deny rule. The same goes for ask over allow.
How a pattern matches
Bash(npm run build)matches exactlynpm run build, and notnpm run build --watch.Bash(npm run *)matchesnpm run buildandnpm run test --watch. It doesn't matchnpm install.- A
*matches any text, spaces included. Put it after the subcommand:Bash(git log *)allows onlygit log. - Rules match the command as written.
git -C . pushdoesn't matchBash(git push *).
Other tools take their own specifiers: Read(./.env), WebFetch(domain:example.com).
Where "Yes, and don't ask again" saves it
Claude Code writes the rule to .claude/settings.local.json at the root of the git repository, resolved through worktrees to the main checkout. It applies to later sessions anywhere in that repository, worktrees included.
A file-edit approval isn't saved. It lasts until the session ends.
For a rule everywhere, use ~/.claude/settings.json.
What Always should cover
Good candidates:
- Tests, linters, builds:
npm test *,npm run lint. - Read-only git:
git status,git diff *,git log *.
Keep these asking:
- Anything destructive:
rm *,git push --force,git reset --hard. - Anything that touches secrets:
.env, credentials, keys. - Commands with shell expansion, where the pattern can't see what will really run.
- Broad wildcards like
Bash(*)orBash(git *).git *includesgit push.
Deny what must never happen. Ask for what's risky. Allow only what you'd approve every time.
Rules in AgentNod
In AgentNod, Always on a card allows the request and saves a rule for that project. It suggests the pattern: the first two words of the command, or the folder of the file being edited. For Claude Code it also writes the rule to permissions.allow, in Claude's own form, to the same .claude/settings.local.json that "don't ask again" uses. ⌘R opens the same rule in an editor first, so you can change the pattern, the scope, and whether it goes to Claude Code too. Always isn't offered for destructive commands, commands that touch secrets, or commands with shell expansion.
The AgentNod iPhone app is on the App Store. With AgentNod Pro it gets a push when an agent needs you, with Allow and Deny from the lock screen.
Agents ask. You nod once.
Source: Claude Code permissions docs (read 2 Nov 2026); agentnod.app/rules; AgentNod on the App Store.