In Claude Code, which permission mode fits a supervised refactor, an unattended overnight task and a read-only audit, and why?
answer
- six modes, one autonomy dial
- edits free, other commands still ask
- a second model reviews instead of you
- bypass only inside a container or VM
- deny rules hold in every mode
basics
~20 sUse acceptEdits for a supervised refactor you review by diff, plan for a read-only audit since edits stay blocked, and auto for an overnight task; bypassPermissions belongs only in an isolated container or VM, and deny rules hold in every mode.
solid answer
~40 sA permission mode is the baseline for what runs without asking. For a **supervised refactor**, `acceptEdits` lets Claude edit files and run common filesystem commands like `mkdir` and `mv` inside the working directory while every other shell command still prompts, and you review with `git diff`. For a **read-only audit**, `plan` keeps source edits blocked until you approve a plan; Manual (`default`) also fits, since reads run and everything else asks. For an **unattended overnight task**, `auto` replaces your prompts with a classifier that blocks escalation, unrecognised infrastructure and hostile-content-driven actions. `bypassPermissions` runs everything and is for isolated containers or VMs only, and `dontAsk` denies anything that would prompt, for locked-down pipelines with an exact allowlist. In every mode deny rules still block, and allow rules have no effect in `bypassPermissions`.
go deeper
Name the six modes and what each runs without asking, and know Manual is the label for the default config value.
Match modes to jobs and explain the layering: deny rules hold everywhere, ask rules still prompt in auto, allow rules mean nothing in bypass.
Explain why bypass needs isolation, what auto's fallback does to an unattended run, and why dontAsk suits an exact allowlist.
Frame the choice as a risk budget: which jobs earn classifier autonomy, which need containers, and which modes the organisation should disable outright.
## The six modes as one dial Claude Code's **permission mode** sets which actions run without a prompt; **permission rules** (allow, ask, deny) layer on top of it. The six modes, by their config values: | Mode | Runs without asking | Fits | | :- | :- | :- | | `default` (shown as **Manual**) | Reads only | Reviewing every action, sensitive work | | `acceptEdits` | Reads, file edits, common filesystem commands | Iterating on code you review afterwards | | `plan` | Reads, plus classifier-approved commands when auto is available | Exploring before changing anything | | `auto` | Everything, with background classifier checks | Long tasks, prompt fatigue | | `dontAsk` | Reads and pre-approved tools; anything that would prompt is denied | Locked-down pipelines and scripts | | `bypassPermissions` | Everything | Isolated containers and VMs only | The CLI accepts `manual` as an alias for `default`, and hooks and the SDK see `default`. ## Matching the three jobs **A supervised refactor.** `acceptEdits` auto-approves file creation and edits in the working directory and in `additionalDirectories`, plus `mkdir`, `touch`, `rm`, `rmdir`, `mv`, `cp` and `sed` on in-scope paths. Every other shell command outside the read-only set, such as `npm install` or `git push`, still prompts, as do writes to protected paths and paths outside scope. You read the result in your editor or with `git diff` instead of approving each hunk. If the code is sensitive, stay in Manual. **A read-only audit.** `plan` is the mode that blocks source edits until you approve a plan, so an audit that should produce findings and no changes stays honest. Manual also works because reads run without asking and anything that changes state prompts. `acceptEdits` and `auto` are wrong here because both let edits through. **An unattended overnight task.** `auto` is the mode designed to run long without routine prompts: a separate classifier model reviews actions that are not reads or working-directory edits and blocks anything that escalates beyond the request, targets unrecognised infrastructure or appears driven by hostile content. Two things still need planning for an unattended run: 1. If the classifier blocks 3 actions in a row or 20 in total, auto mode pauses and Claude Code resumes prompting, so an interactive session will wait for a human. 2. Explicit ask rules still force a prompt, and auto mode requires a supported model and can be turned off by an administrator. Choosing a mode for a scripted `claude -p` run is a separate subject; this question is about the modes themselves. ## bypassPermissions and why it needs isolation `bypassPermissions` (also started by `--dangerously-skip-permissions`) disables prompts and safety checks, including for protected paths. It offers no protection against prompt injection or unintended actions, which is why the docs restrict it to containers, VMs or dev containers without internet access, where nothing on the host can be damaged. Guard rails that remain: - Deny rules still block; allow rules simply have no effect, because everything is already allowed. - Explicit ask rules, `AskUserQuestion`, and `rm` or `rmdir` aimed at a critical path such as `/` or `~` still prompt. - On Linux and macOS it refuses to start as root or under `sudo`, outside a recognised sandbox. - You cannot switch into it mid-session unless it was enabled at launch, and administrators can remove it with `permissions.disableBypassPermissionsMode` set to `"disable"`. The container and Bash-sandbox mechanics that make it safe belong to the sandboxing material. ## dontAsk: the allowlist-only mode `dontAsk` auto-denies every call that would otherwise prompt. Reads, read-only commands, `permissions.allow` matches and calls a `PreToolUse` hook approves still run; ask rules are turned into denials. It never appears in the `Shift+Tab` cycle; you set it with `--permission-mode dontAsk` or `defaultMode`. It fits a pipeline where you can enumerate exactly what is allowed and want the session never to wait. ## How modes layer over rules - **Deny rules block in every mode**, `bypassPermissions` included. - **Ask rules** still prompt in `auto` and even in `bypassPermissions`; in `dontAsk` they deny. - **Allow rules** pre-approve in the prompting modes and have no effect in `bypassPermissions`; on entering `auto`, broad ones that grant arbitrary code execution are dropped until you leave. The interview signal is matching autonomy to the job and knowing where each mode stops protecting you, not reciting the list.
- Why is bypassPermissions not just auto mode without notifications?Auto mode routes risky actions to a classifier that blocks escalation, exfiltration and destructive operations. `bypassPermissions` has no classifier and skips safety checks, including protected-path writes, so it offers no defence against prompt injection. Only deny rules, explicit ask rules, critical-path removals and a few interaction tools still stop it, which is why it belongs in an isolated container or VM.
- Your overnight auto-mode session stalled. What is the likely cause?The classifier blocked actions 3 times in a row or 20 times in total, so auto mode paused and Claude Code fell back to prompting, which waits for a human. Repeated blocks usually mean the classifier lacks context about your infrastructure; teaching it trusted repos and services through `autoMode.environment` is the fix, not switching to bypass.
- In acceptEdits, which file-related actions still prompt?Writes outside the working directory and `additionalDirectories`, writes that a symlink check resolves outside that scope, writes to protected paths such as `.git` or `.bashrc`, `rm` and `rmdir` aimed at a critical path, and any shell command beyond the filesystem set and the read-only set.
- acceptEdits lets Claude run any shell command without asking.
- Deny rules stop applying once a session is in bypassPermissions.
- Allow rules widen what bypassPermissions is allowed to do.
- dontAsk approves everything so the session never has to wait.
- bypassPermissions is fine on a laptop if you watch the output.
- Manual mode prompts even for reading files in the working directory.