In short
- Every action gets one of three answers: allow, ask or deny.
- In Claude Code, rules live in a settings file. Example: allow Bash(npm test), ask Bash(git push *), deny Read(./.env).
- Rules are checked in order: deny, then ask, then allow. The first match decides, so an allow rule can't override a deny.
- Permission modes set the baseline: Manual, Accept edits, Plan, Auto, and Bypass permissions (only in isolated containers or virtual machines).
- Least privilege: allow only what the task needs, and use ask for steps you can't undo, like a push.
Who decides?
A coding agent can read files, edit code and run commands. Some of those steps are harmless, like running the tests. Others are hard to undo, like pushing code or deleting files. So before each action, something has to decide: go ahead, ask the human first, or never.
Three answers: allow, ask, deny
In Claude Code, permission rules live in a settings file. Each rule names a tool and, optionally, what it may touch. Three examples from the video:
- allow: Bash(npm test). Run the tests without asking.
- ask: Bash(git push *). Ask before a git push.
- deny: Read(./.env). Block Claude's file tools from reading the secrets file.
Which rule wins?
If two rules match the same action, Claude Code checks them in a fixed order: deny, then ask, then allow. The first match decides, and a more specific rule doesn't change that order.
So if you deny Bash(aws *), even a narrower allow rule like Bash(aws s3 ls) can't make an exception. Deny always wins.
Permission modes
Rules cover specific actions. A permission mode sets what happens with everything else. Claude Code's main modes:
- Manual: asks before most edits, commands and network access. Good for sensitive work and unfamiliar code.
- Accept edits: changes files (and runs simple file commands) without asking.
- Plan: makes no edits. It explores and proposes a plan until you approve it.
- Auto: a second model, a classifier, reviews actions instead of you and blocks risky ones, like a force push.
- Bypass permissions: skips the permission prompts (deny rules still apply). Use it only in isolated containers or virtual machines.
Pro tip: least privilege
Give the agent only the permissions the task needs. Allow the boring, safe steps so you are not asked a hundred times, and keep ask for anything you can't undo, like a push. Deny what it should never touch, like secret files. Deny rules apply in every mode, even in Bypass permissions.
Test yourself
5 quick questions. Pick an answer to check it.
Sources
- Claude Code docs: Configure permissions (allow, ask, deny; rule order)
- Claude Code docs: Choose a permission mode
Checked November 22, 2026.