Claude Code guide: permission modes

Claude Code permissions: modes, rules and the skip flag

Claude Code permissions are two layers: a permission mode that sets what runs without asking, and allow, ask and deny rules in settings.json that pre-approve or block specific tools. Recent versions start interactive sessions in auto mode, where a classifier reviews risky actions; this page covers all six modes, the rule syntax, the skip flag and which settings file wins, checked against Claude Code 2.1.309.

Anthropic

On Claude Code

Plan only

Claude explores, proposes a plan, and waits for your approval before it acts. Nothing is written while the mode is active.

Supervised

Every command and every file change stops for a decision. This is the mode to use on a repository you do not want touched by accident.

Accept edits

File changes go through without asking. Anything that executes still stops. Codex does not offer an equivalent, which is worth knowing before you switch engines mid-project.

Auto

A separate classifier model reviews each risky action rather than asking you every time. This is Anthropic behaviour built into Claude Code, not an approximation layered on top by a client. New chats start here.

Full access

Nothing is asked and nothing is blocked. Reserve it for a sandbox or a throwaway checkout, because there is no second gate behind it.

The modes

The six permission modes in Claude Code 2.1.309

The cards above use Termdeck's names. Claude Code itself has six modes, and these are the values you type after --permission-mode or put in defaultMode:

ModeWhat runs without askingStatus bar
default (Manual)Reads only. Edits, most shell commands and web fetches ask.manual mode on
acceptEditsReads, file edits, and mkdir, touch, rm, rmdir, mv, cp, sed inside your working directoriesaccept edits on
planReads and read-only exploration. No source edits until you approve a plan.plan mode on
autoEverything, with a classifier model reviewing risky actions firstauto mode on
dontAskOnly reads and what your allow rules pre-approve. Anything else is denied, never asked.don't ask on
bypassPermissionsEverything, with no promptsbypass permissions on

Manual is the mode that reviews every action. Its config value is default, and Claude Code accepts manual as an alias, so claude --permission-mode manual and "defaultMode": "manual" both work. dontAsk is meant for CI and scripts: the session never waits for input.

In Termdeck's picker, Supervised is default, Accept edits is acceptEdits, Plan only is plan, Auto is auto and Full access is bypassPermissions. dontAsk is not offered, because a browser chat always has someone to ask.

Switching

How to change the permission mode

At startup Claude Code takes the first of: the command line flag, permissions.defaultMode in a settings file, the built-in default.

During a session, press Shift+Tab. From auto, the first press goes to Manual, and the cycle then runs Manual, accept edits, plan. Bypass and auto slot in after plan when they are enabled. dontAsk is never in the cycle.

At launch, pass the flag. It works with -p too:

bash
claude --permission-mode acceptEdits
claude -p "run the tests and fix failures" --permission-mode auto

As a default, set defaultMode in a settings file:

json
{
  "permissions": {
    "defaultMode": "acceptEdits"
  }
}

One catch: auto and bypassPermissions are ignored when they come from a project's .claude/settings.json or .claude/settings.local.json, so a cloned repository cannot put you in bypass mode. Put those two in ~/.claude/settings.json if you want them as your default. If a session starts in Manual when you expected auto, that is usually why.

Yolo mode

What --dangerously-skip-permissions does

claude --dangerously-skip-permissions starts the session in bypassPermissions mode. It is the same as --permission-mode bypassPermissions, and it is what people mean by Claude Code yolo mode. Tool calls run immediately, including writes to protected paths such as .git and .claude, and allow rules stop mattering because everything is allowed.

A few things still stop it. Deny rules block in every mode, including this one. Explicit ask rules still prompt. An rm or rmdir that targets your filesystem root, a top-level directory, your home directory or your working directory still asks, with a two-minute countdown in the terminal that denies it if nobody answers.

The first interactive run shows a warning you have to accept (it records skipDangerousModePermissionPrompt in ~/.claude/settings.json). --allow-dangerously-skip-permissions is the softer variant: it adds bypass to the Shift+Tab cycle without starting in it. You cannot switch into bypass from a session that was started without one of these.

"cannot be used with root/sudo privileges"

On Linux and macOS, Claude Code refuses bypass mode when it runs as root or under sudo:

text
--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons

The fix is to run Claude Code as a normal user, which is what Anthropic's dev container configuration does. Anthropic's docs say the check is skipped inside a recognised sandbox; do not try to defeat it on a machine you care about.

When it is reasonable

Inside a container, a VM or a dev container with no access to credentials you care about, on a checkout you could delete. Anthropic's own help text adds "with no internet access". It is the wrong choice on your laptop's real home directory, on a machine with production credentials, or in any repository you have not read, because it offers no protection against a prompt injection in a file Claude reads. Administrators can switch it off with "disableBypassPermissionsMode": "disable" under permissions, usually in managed settings.

Auto mode

Auto mode: fewer prompts without skipping checks

If what you want is a hands-off session, auto mode is the option Anthropic built for it. A separate classifier model reviews each action that is not a read or an in-project edit, before it runs. It is the built-in starting mode for interactive sessions from version 2.1.283.

By default it blocks things like curl | bash, production deploys, force pushes, git reset --hard and launching another agent with --dangerously-skip-permissions, and allows local file work and pushes to the repository you are in. claude auto-mode defaults prints the full lists.

If it blocks 3 actions in a row or 20 in a session, auto mode pauses and Claude Code goes back to asking. Auto mode needs a supported model (Opus 4.6, Sonnet 4.6 or later on the Anthropic API) and can be switched off with "disableAutoMode": "disable". Anthropic's own warning applies: it reduces prompts, it does not guarantee safety.

Rules

Allow, ask and deny rules in settings.json

Rules sit on top of the mode. Each is Tool or Tool(specifier), and they live under permissions in a settings file:

json
{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git commit *)",
      "WebFetch(domain:github.com)"
    ],
    "ask": [
      "Bash(git push *)"
    ],
    "deny": [
      "Read(./.env)",
      "Read(./secrets/**)",
      "Bash(curl *)"
    ]
  }
}

Claude Code checks deny, then ask, then allow, and the first match wins. A narrow allow cannot carve an exception out of a broad deny: with Bash(aws *) denied, Bash(aws s3 ls) in allow does nothing.

  • Bash. * matches any text. Bash(npm run build) is exact; Bash(npm run *) covers every npm script. The space matters: Bash(ls *) does not match lsof, Bash(ls*) does. The older Bash(npm run test:*) form still works and means the same as a trailing *. Put the * after the subcommand: Bash(git *) allows every git command.
  • Compound commands. A rule must match each part of a && b or a | b on its own, so an allow for npm test does not approve npm test && rm -rf build.
  • Read and Edit. Paths use gitignore patterns. //path is absolute, ~/path is from your home directory, /path is relative to the settings file's project, and ./path to the current directory. Use Edit(...) rules for writes; Write(path) rules never match.
  • WebFetch and MCP. WebFetch(domain:example.com) for one host, mcp__github__* for one MCP server.

A Bash deny is not a security boundary: Bash(curl *) stops curl but not /usr/bin/curl or sh -c 'curl ...'. For an enforced limit, turn on the sandbox with /sandbox (macOS, Linux and WSL2), which restricts what shell commands can reach at the operating system level.

Flags

claude --allowedTools and --disallowedTools

The same rules work as flags for one session. Each takes a comma or space separated list:

bash
claude --allowedTools "Bash(git *)" "Edit"
claude --disallowedTools "Bash(rm *)" "WebFetch"
claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"

The last line is the pattern for CI: dontAsk denies anything you did not list, so the run never hangs on a prompt. Without a mode, claude -p starts in Manual since 2.1.302, and any call that needs approval is denied unless a rule allows it. --disallowedTools adds restrictions even on top of managed settings; --allowedTools cannot override a deny from any file.

Precedence

Which settings file wins, and the /permissions command

When the same key is set in several places, the highest level wins:

  1. Managed settings from your organisation (managed-settings.json, MDM or server-managed). Nothing below overrides them.
  2. The command line: JSON passed with --settings for that one session.
  3. Local project settings, .claude/settings.local.json. Yours, not committed.
  4. Shared project settings, .claude/settings.json. Checked in for the team.
  5. User settings, ~/.claude/settings.json. Every project on your machine.

Permission rules are the exception to "highest wins": a deny at any level blocks, so a user-level deny beats a project-level allow and the other way round. Allow rules in a project's .claude/settings.json only apply after you accept the workspace trust dialog for that folder.

Type /permissions in a session to see every rule and the file it came from, and to add or remove one. When you pick "Yes, and don't ask again" on a Bash or WebFetch prompt, Claude Code saves the rule to .claude/settings.local.json at the repository root. File edit approvals last only until the session ends.

Plan mode

Where plan mode fits

Plan mode is the one mode that is about workflow rather than trust: Claude reads, explores and writes a plan, and edits stay blocked until you approve it. Enter it with Shift+Tab, a /plan prefix or --permission-mode plan. Approving switches the session to auto or Manual depending on the option you pick. The full walkthrough, including editing the plan and opusplan, is in Claude Code plan mode: how to use it and when.

Termdeck

Answering permission prompts away from the terminal

A prompt in a terminal only gets answered when you are looking at that terminal. Termdeck runs Claude Code on your own machine and puts the prompt in a browser tab or on your phone as a card: the exact command, a risk level, and Deny, Allow once, a grant for this chat, or a rule saved into Claude Code's own settings. Plan approvals arrive the same way. Unanswered permission cards are denied after five minutes so a run does not sit blocked; plans and questions wait.

The mode is picked per chat in the composer, so one chat can run in Auto while another stays in Supervised. To make sure nothing on a given machine ever runs in bypass mode, set TERMDECK_FULL_ACCESS=off in that machine's agent config. The setup is in approve Claude Code permissions remotely, and every button is described in the permissions docs. If a prompt never shows up in the browser, see permission prompt never appears.

Other engines differ: see Codex CLI approval modes and Grok CLI permission modes.

Compare

One vocabulary, three engines

FeatureClaude CodeCodex CLIGrok CLI
Plan onlyPlans, then waits for approvalNative plan mode, read-only sandboxNot supported, behaves as read-only
SupervisedAsks before every actionAsks, and sandboxes to read-onlyRefuses outright instead of asking
Accept editsFile edits pass, commands askNot offeredFile edits pass, commands ask
AutoA classifier reviews risky actionsWorkspace-write sandbox, asks on requestNot offered
Full accessNo prompts at allNo prompts, sandbox disabledNo prompts at all
Starts new chats inAutoAutoAccept edits

Termdeck drives all three from one console, so the differences above stop being three separate habits to remember.

FAQ

Claude Code permission modes, answered

How do I bypass permissions in Claude Code?

Start it with claude --dangerously-skip-permissions or claude --permission-mode bypassPermissions. Both turn off permission prompts for the session. You cannot switch into bypass mode from a session that was started without it, and on Linux and macOS it refuses to run as root or under sudo.

How to enable skip permissions in Claude Code?

Pass --dangerously-skip-permissions at launch, or pass --allow-dangerously-skip-permissions to add bypass mode to the Shift+Tab cycle without turning it on yet. The first interactive run shows a warning you must accept. Use it only inside a container, VM or dev container you can throw away.

How to make Claude Code autonomous?

Use auto mode rather than skipping permissions. Run claude --permission-mode auto, or set defaultMode to auto in ~/.claude/settings.json. A classifier reviews risky actions instead of asking you, and it blocks things like force pushes, curl piped to bash and production deploys unless you approve them.

Can Claude Code ruin your computer?

It runs real commands with your user account, so in bypass mode it can delete files or change config like any program you run. In the other modes it asks or a classifier checks first, deny rules block in every mode, and an rm that Claude Code recognises as targeting your home directory or filesystem root is never auto-approved. Sandboxing and containers add an operating system boundary on top.

Is installing Claude Code dangerous?

Installing it is not the risky part. The risk is in what you let it run. Out of the box it reads files in your project freely and asks or checks before edits, shell commands and network access. Keep it out of bypass mode on a machine you care about and add deny rules for secrets such as Read(./.env).

Why does Claude Code still ask after I added an allow rule?

An ask or deny rule that also matches wins, because rules are checked deny first, then ask, then allow. A Bash rule also has to match every part of a compound command, so Bash(npm test *) does not cover npm test followed by another command. Writes to protected paths such as .git and .claude are never pre-approved by an allow rule.

Which permission mode does Claude Code start in?

Interactive terminal and VS Code sessions start in auto mode from version 2.1.283, unless auto mode is unavailable for your account or model, in which case they start in Manual. claude -p and Agent SDK runs start in Manual, and calls that would need approval are denied.