Claude Code permissions: six modes, one rule order, one short file

Claude Code permissions are a mode that sets the default plus rules that deny, ask or allow specific tools. There are six modes, rules run in the order deny, ask, allow, and the first match wins. This guide follows Anthropic's documentation as it stood on 28 October 2026.

Claude Code permissions

Checked
28 October 2026
Modes
Six, Manual up to bypass
Rule order
Deny, then ask, then allow
Starting mode
Auto, from v2.1.283
Files with no deny rule
An estimated 81%

The short answer

Claude Code has six permission modes: default, shown as Manual, plus acceptEdits, plan, auto, dontAsk and bypassPermissions. Rules sit on top and are checked in the order deny, then ask, then allow. The first match wins, so an allow rule can't reopen what a deny rule closed. From v2.1.283 auto is the built-in starting mode.

The six permission modes

A permission mode sets what Claude can do without asking first. Switch modes mid-session with Shift+Tab, or start in one with claude --permission-mode plan. The table follows Anthropic's permission modes page.

What runs without a prompt in each Claude Code permission mode
ModeRuns without askingBest for
default (shown as Manual)Reads onlyReviewing every action, sensitive work
acceptEditsReads, file edits and common filesystem commands such as mkdir, touch, mv and cpIterating on code you're reviewing
planReads, plus classifier-approved commands when auto mode is available. Edits wait for an approved planExploring a codebase before changing it
autoEverything, with background safety checks by a classifierLong tasks and fewer prompts
dontAskReads in your working directories and pre-approved tools. Anything that would prompt is deniedLocked-down CI and scripts
bypassPermissionsEverythingIsolated containers and VMs only

A new terminal session takes its mode from the first of these that applies: the --permission-mode flag or --dangerously-skip-permissions, then permissions.defaultMode in a settings file, then the built-in default. From Claude Code v2.1.283 the built-in default is auto in terminal and VS Code sessions, and claude -p starts in Manual. An auto or bypassPermissions value in a project's .claude/settings.json doesn't take effect.

Rules decide first: deny, then ask, then allow

Modes set the baseline and rules sit on top. Claude Code checks rules in the order deny, ask, allow, and the first match decides. Specificity doesn't change the order.

That has one consequence people miss. A broad deny such as Bash(aws *) blocks every matching call, even one that also matches a narrower allow such as Bash(aws s3 ls). An allow rule can't carve an exception out of a deny rule, and a matching ask rule prompts even when a more specific allow also matches. Deny rules apply in every mode, bypassPermissions included, and allow rules have no effect in bypassPermissions.

Two more details. A bare tool name in a deny rule, Bash for instance, removes the tool from Claude's context entirely, while a scoped rule like Bash(rm *) leaves the tool and blocks matching calls. And Claude Code enforces rules itself. A line in CLAUDE.md or your prompt changes what Claude tries, and it doesn't change what Claude Code allows. Run /permissions to list every rule and the settings file it came from, per the permissions page.

What a Bash rule doesn't match

A Bash rule matches the command text Claude writes. It doesn't match the same program written another way, so Anthropic describes a deny rule as covering the form Claude usually produces and not as a boundary around the program.

Deny rules and the forms they miss, from Anthropic's permissions page
RuleStopsDoesn't stop
Bash(curl *)curl https://example.com/usr/bin/curl https://example.com and sh -c 'curl https://example.com'
Bash(rm *)rm -rf build//bin/rm -rf build/ and bash -c 'rm -rf build/'
Bash(git push *)git push origin maingit -C . push origin main

Read and Edit deny rules have the same shape. They cover Claude's file tools, file commands Claude Code recognizes such as cat and sed, and redirections. They don't cover a Python or Node script that opens files itself. For a block that has to hold against every process, use the sandbox, which the operating system enforces.

A short settings file that closes the common gaps

Save this as .claude/settings.json at the root of a repository and commit it. It denies the reads and the delete that Anthropic's documentation uses as examples, and it switches bypass mode off.

% cat .claude/settings.json
{
  "permissions": {
    "deny": ["Read(./.env)", "Read(./secrets/**)", "Bash(rm *)"],
    "disableBypassPermissionsMode": "disable"
  }
}

Deny rules are checked first, so a broad allow rule in a user or project file can't reopen those paths. A .claudeignore file is not a substitute. Anthropic says plainly that it has no effect, so move its entries into Read deny rules. The disable key works from any settings file, and the same key in managed settings is the version developers can't undo.

Bypass mode and --dangerously-skip-permissions

Starting with --dangerously-skip-permissions is the same as starting in bypassPermissions mode. The name is accurate.

What it skips. Permission prompts, including the ones for writes to protected paths such as .git and .claude.

What still blocks. Deny rules, explicit ask rules, tools that need your input, recognised rm commands on critical paths and a few cross-session safeguards. Allow rules do nothing in this mode.

Where it belongs. Inside a container, a VM or the sandbox runtime. Claude Code refuses to start with the flag as root on Linux and macOS, so run that container as a non-root user.

Where it is not honoured. A bypassPermissions default in a project's settings file doesn't take effect, and before v2.1.257 it did. Set permissions.disableBypassPermissionsMode to "disable" to remove the option for good.

What 12,796 public settings files show

Few repositories write deny rules at all.

In our study of 12,796 public Claude Code settings files, an estimated 81% define no deny rule, and only 8.0% deny reading a .env file. About 42% allow Bash with a wildcard such as Bash(git *), and 2.7% allow every Bash command, which lets the model run any shell command without asking.

Bypass lines are rare. Around 1.9% carry one, and Claude Code ignores bypassPermissions in project files, so most are leftovers. Only 0.2% set the key that switches bypass mode off. GitHub also lists 3,928 files named .claudeignore, a file Claude Code doesn't read. The full tables sit in the settings files study, and we don't repeat them here.

Plan mode

  • Claude reads files and runs read-only shell commands, and Claude Code blocks edits until you approve a plan.
  • Start in it with claude --permission-mode plan, or set it as the default for a project.
  • Use it to explore a codebase, and to agree the approach before a long change.

Auto mode

  • A second model, a classifier, reviews each action and blocks the ones it judges unsafe, so you aren't asked.
  • Your own ask and deny rules still apply, and an organization can turn the mode off with permissions.disableAutoMode.
  • It needs a supported model. Read the classifier's rules with claude auto-mode defaults, shown under What we tested.

Roll it out to a team in five steps

  1. Commit the short settings file to every repository, so each teammate starts with the same deny rules.
  2. Put the same deny rules, plus permissions.disableBypassPermissionsMode and, if you want it, permissions.disableAutoMode, in managed settings, where developers can't override them.
  3. Check what is live with /permissions, which shows each rule and the file it comes from.
  4. Run CI in dontAsk mode with an exact allowlist, for example claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read".
  5. Keep any unattended --dangerously-skip-permissions run inside a container, a VM or the sandbox runtime.

What we tested

We ran these commands on 28 October 2026 with Claude Code 2.1.274 on a Mac, in a throwaway folder with an empty home directory. /permissions is an interactive screen, and anything that sends a prompt spends plan usage, so we skipped both. The commands below read Claude Code's own validation and defaults, which need no account.

% claude --version
2.1.274 (Claude Code)

% claude --permission-mode nope -p hello
error: option '--permission-mode <mode>' argument 'nope' is invalid. Allowed choices are acceptEdits, auto, bypassPermissions, manual, dontAsk, plan.
exit 1

The flag rejects an unknown mode before anything else happens and lists the six values from the table above, with manual as an alias for default.

% claude auto-mode defaults | jq -c 'map_values(length)'
{"allow":17,"soft_deny":70,"hard_deny":1,"environment":21}

% claude auto-mode defaults | jq -r '.hard_deny[0] | split(":")[0]'
Data Exfiltration

The classifier's default rule set holds 17 allow rules, 70 soft-deny rules and 1 hard-deny rule, with 21 environment lines. The one hard-deny rule is named Data Exfiltration. Next, a settings file with a bad mode value in a second folder. claude doctor, trimmed to its Invalid settings section with the working folder replaced by a dot, caught it, and it found nothing wrong with the short file above.

% claude doctor
Invalid settings
- ./.claude/settings.json › permissions.defaultMode: Invalid value. Expected one of: "acceptEdits", "auto", "bypassPermissions", "default", "dontAsk", "plan"
  Suggested fix: Valid modes: "acceptEdits" (ask before file changes), "plan" (analysis only), "bypassPermissions" (auto-accept all), or "default" (standard behavior)

% claude doctor | grep -c "Invalid settings"
0

Documentation versions run ahead of this machine. Anthropic's pages describe up to 2.1.302, and 2.1.274 is installed, so a mode default described above may differ locally.

Frequently asked questions

What are the Claude Code permission modes?

There are six: default, shown as Manual, acceptEdits, plan, auto, dontAsk and bypassPermissions. Default asks before most actions, acceptEdits auto-approves file edits, plan explores without editing, auto has a classifier review actions, dontAsk denies anything not pre-approved, and bypassPermissions skips prompts.

What does --dangerously-skip-permissions do?

It starts Claude Code in bypassPermissions mode, so permission prompts are skipped, including for protected paths such as .git and .claude. Deny rules and a few safeguards still apply. Anthropic says to use it only inside a container, a VM or the sandbox runtime, and Claude Code won't start with it as root on Linux or macOS.

How do I stop Claude Code reading my .env file?

Add a Read deny rule, for example Read(./.env), to the permissions block of your settings. A .claudeignore file has no effect. Deny rules cover Claude's file tools and recognised file commands, not a script that opens files itself, so turn on the sandbox for a block every process must respect.

What's the difference between plan mode and auto mode?

Plan mode lets Claude explore with reads and read-only commands, and blocks edits until you approve a plan. Auto mode lets Claude work with few prompts while a classifier model reviews each action and blocks the ones it judges unsafe. They answer different questions: look first, or run hands-off.

Where does Claude Code save my permission choices?

Choosing Yes, and don't ask again for a Bash command or a WebFetch domain saves a rule to .claude/settings.local.json at the root of the git repository. A file-edit approval isn't saved to the file and lasts until the session ends.

Can I pre-approve tools with allowedTools?

Yes. Pass --allowedTools to claude, for example --allowedTools "Bash(npm test)" "Read", or list the same patterns under permissions.allow in a settings file. Deny rules are still checked first, so an allow rule can't override one.

Sources, checked 2026-10-28

9 sources
  1. Claude Code has the permission modes default (shown as Manual), acceptEdits, plan, auto, dontAsk and bypassPermissions, and Shift+Tab or --permission-mode switches between them.Source: code.claude.com, checked 2026-10-28.
  2. With Claude Code v2.1.283 or later auto mode is the built-in starting mode in terminal and VS Code sessions, claude -p starts in Manual, and an auto or bypassPermissions defaultMode in project settings does not take effect.Source: code.claude.com, checked 2026-10-28.
  3. Claude Code evaluates permission rules in the order deny, ask, allow, the first match decides, an allow rule cannot carve an exception out of a deny rule, and deny rules apply in every mode including bypassPermissions.Source: code.claude.com, checked 2026-10-28.
  4. A bare tool name in a deny rule removes the tool from Claude's context, rules are enforced by Claude Code and not by the model, and /permissions lists each rule with its settings file.Source: code.claude.com, checked 2026-10-28.
  5. Bash(curl *), Bash(rm *) and Bash(git push *) deny rules do not stop /usr/bin/curl, /bin/rm or git -C . push, and Read and Edit deny rules do not cover a script that opens files itself, so the sandbox is the documented way to block every process.Source: code.claude.com, checked 2026-10-28.
  6. A .claudeignore file has no effect, and Read deny rules such as Read(./.env) and Read(./secrets/**) are the documented replacement.Source: code.claude.com, checked 2026-10-28.
  7. permissions.disableBypassPermissionsMode and permissions.disableAutoMode set to "disable" work from any settings file and are most useful in managed settings.Source: code.claude.com, checked 2026-10-28.
  8. Bypass mode skips prompts including writes to protected paths, deny rules and explicit ask rules still apply, Claude Code refuses --dangerously-skip-permissions as root on Linux and macOS, and unattended use belongs in a container, a VM or the sandbox runtime.Source: code.claude.com, checked 2026-10-28.
  9. Auto mode uses a classifier model to review actions, and claude -p can run CI in dontAsk mode with an exact allowlist passed through --allowedTools.Source: code.claude.com, checked 2026-10-28.

Digiton Dynamics OÜ is registered in Tallinn, Estonia, and delivers from Lisbon.

Update log

  • Published. Modes, rule order and limits read from Anthropic's permissions and permission modes pages, commands run on Claude Code 2.1.274.

Each source above was opened on the date beside it. How facts get chosen and checked is written down in the editorial policy.

Talk to an engineer about your system

Book a free 25-minute scoping call. We tell you what we would build, what it takes to keep it running, and whether we are the right fit.