Permission Modes as Delegation Dials
Match autonomy to risk. Learn Claude Code's permission modes, allow/ask/deny rules, and sandboxing, and how to choose a setting for each task instead of leaving one on all the time.
Delegation Has a Volume Knob
In the last lesson you decided what to delegate. Claude Code also asks how much: may the agent edit files without asking? Run any command? Only the ones you’ve listed?
Your answer is set by permission modes and permission rules. Fluent users treat them as a dial they turn for each task, not a setting they choose once and forget.
The Modes
As of late 2026, Claude Code offers these main modes. In the terminal, Shift+Tab cycles through the everyday ones. The desktop app and IDE extensions have a mode picker.
- 1 Plan
Research and propose; no edits
- 2 Default
Ask before edits and new commands
- 3 Accept edits
File edits auto-approved
- 4 Auto
A safety check approves or blocks
- 5 Bypass
No prompts at all
| Mode | What the agent can do without asking | Good fit |
|---|---|---|
| Plan mode | Read, search, and think. It proposes a plan and makes no changes until you approve. | Unfamiliar code, big changes, anything where you want to agree on the approach first. |
| Default | Read files. It asks before editing files and before running commands that aren’t already allowed. | Learning the tool, sensitive repos, work you want to watch step by step. |
| Accept edits | Edit files in the project without asking. It still asks before commands that aren’t allowed. | You’ve agreed on a plan and will review the diff at the end. |
| Auto | Most actions. A separate safety check reviews each action and blocks ones that look risky or off-task. | Longer runs where constant prompts would wear you down, on a repo where mistakes are recoverable. |
| Bypass permissions | Everything, with no prompts. Started with a flag whose name says it all: --dangerously-skip-permissions. | Only inside an isolated container or VM with nothing valuable in reach. |
The exact list and names change between versions, so check the docs for yours. The reasoning carries over: each step to the right trades a human checkpoint for speed. Make that trade on purpose.
Rules: Fine-Grained Delegation
Modes are broad. Permission rules let you be specific. In a settings file (for example, the project’s .claude/settings.json), you list tools and commands as allow, ask, or deny:
{
"permissions": {
"allow": [
"Bash(npm run test:*)",
"Bash(npm run lint)",
"Bash(git diff:*)"
],
"ask": [
"Bash(git push:*)"
],
"deny": [
"Read(./.env)",
"Read(./secrets/**)",
"Bash(curl:*)"
]
}
}
When the agent wants to use a tool, Claude Code checks the rules first and only then the mode:
A few principles:
- Deny wins. If a rule denies something, no other setting can allow it.
- Allow the boring, safe, frequent things. Running tests and linters thousands of times shouldn’t require thousands of clicks. Allowing them lets you keep default mode on without prompt fatigue.
- Deny reads of secrets. Keeping
.envfiles and credential folders out of the agent’s reach is simpler than trusting yourself to notice. - Share project rules with your team. A committed
.claude/settings.jsongives everyone the same guardrails. Personal tweaks go in a local settings file that stays out of git.
Run /permissions in a session to see and edit the active rules.
Sandboxing: A Boundary That Doesn’t Depend on Judgment
Permission prompts depend on someone making the right call. A sandbox limits what commands can reach at the operating-system level: which folders they can write, which network hosts they can contact. Claude Code includes sandboxing for its shell commands (/sandbox), and you can also run the whole agent inside a container or VM.
A sandbox is what makes higher-autonomy modes reasonable. Inside one, a mistaken command can damage the sandbox, but not your home folder, SSH keys, or cloud credentials.
Common mistake: getting annoyed by approval prompts on day two and switching to bypass mode on your laptop, permanently.
That swaps a small, constant cost (clicking “allow”) for a rare, large one (an agent deleting files, pushing to the wrong branch, or running a command a malicious README suggested). The fix for fatigue is better rules: allow the safe, repetitive commands, so that the prompts you still see are the ones worth reading.
Choosing a Setting per Task
| Task | Sensible setting | Why |
|---|---|---|
| Exploring an unfamiliar repo | Plan or default | Nothing should change yet. |
| Implementing an approved plan in a feature branch | Accept edits, with test and lint commands allowed | You’ll review the diff; edits are reversible. |
| Overnight refactor in a disposable container | Auto or bypass, inside the sandbox | Isolation contains the blast radius. |
| Touching deploy scripts or infrastructure config | Default, with ask rules on deploy commands | Irreversible actions need a human every time. |
| A repo you just cloned from a stranger | Plan or default, sandbox on | You don’t yet know what its files will tell the agent to do (more in module 5). |
For a project you work on:
- List the five commands you run most (tests, lint, build, type check, dev server).
- List anything the agent should never read or run (secrets files, deploy commands,
rm -rf, network tools). - Draft a
.claude/settings.jsonwithallowanddenyrules for them. Check the docs for the exact rule syntax your version supports. - Start a session, run
/permissions, and confirm your rules loaded. - Ask the agent to do a small task and notice how many prompts disappear and which ones remain.
1. You've agreed on a plan and will review the full diff at the end. Which mode fits best?
Auto-accepting reversible edits keeps momentum, and command prompts and your final review stay in place.
2. What's the best fix for prompt fatigue?
Good rules cut the noise and keep the human checkpoint where it counts.
3. Why does sandboxing make higher-autonomy modes more reasonable?
A sandbox is a boundary that doesn't depend on anyone making the right call in the moment.
4. A deny rule blocks reading .env, and a broader allow rule permits reading all files. What happens?
Deny rules take precedence. That's what makes them reliable guardrails.
Up Next
Module 3 turns to Description: how to brief an agent so it builds the right thing, and how to make that context last across sessions.