Guide

Claude Code auto mode and the permission modes

Harrowtech.ai · last checked 13 October 2026

Claude Code auto mode lets Claude keep working without stopping for routine permission prompts. Instead of you approving each shell command or network request, a second model, which Anthropic calls the classifier, looks at the action first and blocks anything that goes beyond your request, aims at infrastructure it does not recognise, or appears to be driven by hostile content Claude has read.

Is it safe to use? Anthropic does not claim it is safe on its own. Its documentation says: “Auto mode reduces permission prompts but does not guarantee safety. Use it for tasks where you trust the general direction, not as a replacement for review on sensitive operations.” Your own deny and ask rules still apply in auto mode, a short list of actions is never auto-approved in any mode, and an organisation can switch auto mode off. From Claude Code 2.1.283 it is the mode a new terminal or VS Code session starts in when nothing else picks one, so it is worth understanding even if you never chose it.

Harrowtech.ai is independent of Anthropic. Flags and mode names below were checked against claude --help on Claude Code 2.1.296.

The six permission modes

A permission mode decides what Claude may do in a session without asking you first. Anthropic's permission modes page sets them out like this; the right-hand column is Anthropic's own wording for what each suits.

Mode (config value)Runs without askingAnthropic: “best for”
Manual (default)Reads only“Reviewing every action yourself, sensitive work”
Accept edits (acceptEdits)Reads, file edits and common filesystem commands such as mkdir, touch, mv and cp“Iterating on code you're reviewing”
Plan (plan)Reads, plus commands the classifier approves when auto mode is available. No edits until you approve a plan“Exploring a codebase before changing it”
Auto (auto)Everything, with background safety checks“Long tasks, reducing prompt fatigue”
dontAskFile reads inside your working directories and tools you have pre-approved. Anything that would prompt is refused“Locked-down CI and scripts”
Bypass permissions (bypassPermissions)Everything“Isolated containers and VMs only”

The CLI, the VS Code and JetBrains extensions and the desktop app all call the first mode Manual. Its value in settings files and hooks is default, and the CLI accepts manual as another spelling. The VS Code mode indicator labels Accept edits as “Edit automatically”.

Modes are only the baseline. Permission rules sit on top: a deny rule blocks in every mode, bypass included, while allow rules have no effect in bypass mode because everything is already allowed.

What no mode approves on its own

Anthropic lists a few actions that still need a person in every mode, bypass included:

How auto mode decides

Every action goes through the same order of checks, and the first one that matches settles it:

  1. Your allow, ask and deny rules. A matching rule decides at once, with exceptions: a write to a protected path still goes to the classifier even if an allow rule covers it, and no allow rule can approve a critical-path rm.
  2. Reads, and file edits inside your working directory, are approved without a check. Writes to protected paths are not, and the first read outside your working directories asks you.
  3. Everything else goes to the classifier. In practice that is mostly shell commands and network operations.
  4. If the classifier blocks, Claude is given the reason, usually as the name of the rule it matched, such as [Data Exfiltration].

Switching into auto mode also parks any allow rule broad enough to run arbitrary code: Bash(*) or PowerShell(*), wildcarded interpreters such as Bash(python*), package-manager run commands, and allow rules for the Agent and Monitor tools. Narrow rules such as Bash(npm test) keep working. The parked rules come back when you leave auto mode.

When Claude Code sends the classifier request itself, the classifier sees your messages, Claude's tool calls other than read-only lookups, and your CLAUDE.md. Tool results are removed first. Anthropic's reasoning is that hostile text inside a file or web page then cannot work on the classifier directly. Because the classifier reads CLAUDE.md, Anthropic notes that a line such as “never force push” there steers Claude and the classifier together. See CLAUDE.md and projects for how that file is loaded.

Subagents get the same treatment. The classifier reviews the task before a subagent starts, each action while it runs, and its report before the main conversation reads it. A permissionMode line in the subagent's own file is ignored while auto mode is on.

What auto mode blocks and allows by default

Out of the box, the classifier trusts your working directory and the git remotes that were set up when the session started. A remote added or changed during the session is not trusted, and everything else counts as external. On 13 October 2026 Anthropic's page listed 45 kinds of action blocked by default, some added in recent versions. A selection:

Allowed by default, among others: local file work in the working directory, installing dependencies already declared in your lock files or manifests, reading .env and sending those credentials to the API they belong to, read-only HTTP requests, and pushing to any branch of the repository you are in, including the default branch. A non-default branch whose name marks it as a deploy target, such as production or gh-pages, is judged on its own terms, and what is being pushed is still checked.

To read the full rule text on your own machine, run claude auto-mode defaults, which prints it as JSON.

When auto mode still asks you, or stops

Each blocked action shows a notification and appears in /permissions under the Recently denied tab, where pressing r marks it for a retry.

Limits and permission you give in the conversation

If you tell Claude “don't push” or “wait until I review before deploying”, the classifier blocks matching actions even where its defaults would allow them, until you lift the limit in a later message. Anthropic warns that these limits are not saved as rules. The classifier re-reads them from the conversation each time, so a limit can disappear if context compaction removes the message that set it. For a guarantee, Anthropic's advice is a deny rule.

Permission works the other way, but it has to be specific. The message must name the action and the detail that makes it risky, such as the branch for a force push. Anthropic's own example: “you can force-push” on its own clears nothing. An approval normally covers that one action, not later ones.

The other modes in a little more detail

Manual

Claude Code asks before most actions that edit files, run shell commands or reach the network. A built-in set of read-only commands such as ls, cat and git status runs without a prompt. When you answer “Yes, and don't ask again” to a Bash command, the approval is saved as an allow rule in .claude/settings.local.json at the root of the git repository. A file-edit approval lasts only until the session ends.

Accept edits

Claude creates and edits files in your working directory without asking, and the filesystem commands mkdir, touch, rm, rmdir, mv, cp and sed run without a prompt for paths inside it (or inside folders added with additionalDirectories). Other Bash commands, apart from the built-in read-only set, still prompt. Anthropic suggests this mode when you would rather review the changes afterwards in your editor or with git diff.

Plan

Claude reads files, runs commands to explore and writes a plan, but does not edit your source. When the plan is ready you choose between “Yes, and use auto mode”, “Yes, manually approve edits” and “No, keep planning”. Ctrl+G opens the plan in your text editor first. With auto mode available and the useAutoModeDuringPlan setting on, which is the default, the classifier reviews exploration commands instead of prompting you. The explore-plan-code routine itself is covered in Claude Code best practices.

dontAsk

Anything that would prompt is refused, so the session never waits for input. Reads and pre-approved tools still run. It is never part of the Shift+Tab cycle; you set it with --permission-mode dontAsk or in settings. Cloud sessions ignore it when it comes from a settings file. Anthropic's CI example:

claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"

Bypass permissions

Prompts and safety checks are switched off, and tool calls run immediately, including writes to protected paths such as .git and .claude. Only the short list of actions no mode approves still stops for you. You cannot switch into it from a session that started without it: start with --permission-mode bypassPermissions (or the equivalent --dangerously-skip-permissions), set it as defaultMode in your user settings, or use --allow-dangerously-skip-permissions to add it to the Shift+Tab cycle without starting in it. On Linux and macOS it refuses to run as root or under sudo. The first interactive time, a dialog asks you to accept responsibility, and declining exits Claude Code. Administrators can block the mode with permissions.disableBypassPermissionsMode set to "disable".

Protected paths

Writes to a fixed set of paths are never auto-approved, except in bypass mode and in plan mode in a terminal session where bypass is available. The set includes .git, .vscode, .idea, .husky, most of .claude, shell start-up files such as .bashrc and .zshrc, .npmrc, and .mcp.json. Manual and Accept edits prompt for them, auto mode sends them to the classifier, and dontAsk refuses them. An allow rule in a settings file does not change this.

Which mode a new session starts in

For a session started in a terminal, Claude Code takes the first of these that applies:

  1. The --permission-mode flag, or --dangerously-skip-permissions.
  2. permissions.defaultMode in a settings file.
  3. The built-in default.

The built-in default for an interactive terminal or VS Code session is auto with version 2.1.283 or later. A claude -p run or Agent SDK session starts in Manual when it fetches feature flags; one that does not, for example on a third-party provider or with telemetry off, starts in auto on 2.1.285 or later. If any settings file sets disableAutoMode to "disable", the default is Manual. If auto is chosen but not available to the session, it starts in Manual instead.

One trap: auto and bypassPermissions do not take effect as defaultMode in a project's .claude/settings.json or .claude/settings.local.json. Put them in ~/.claude/settings.json, or pass the flag. Running scripted sessions is covered in Claude Code CLI and headless mode.

How to switch modes

{
  "permissions": {
    "defaultMode": "default"
  }
}

Other surfaces have their own controls. In VS Code, click the mode indicator at the bottom of the prompt box; its claudeCode.initialPermissionMode setting does not accept auto. In the desktop app's Code tab, use the mode selector next to the send button. Cloud sessions on claude.ai offer Accept edits, Plan and Auto, and no bypass.

Setting allow, ask and deny rules

Type /permissions in a session to see every rule and the settings file it comes from, and to add or remove rules. Three kinds exist: allow (run without asking), ask (always prompt) and deny (never run). Claude Code checks deny first, then ask, then allow, and the first match wins. How specific a rule is makes no difference, so a broad deny such as Bash(aws *) beats a narrow allow such as Bash(aws s3 ls).

A rule is a tool name, optionally followed by a specifier in brackets:

Bash(npm run build)That exact command only.
Bash(npm run *)Any npm run command, including bare npm run. Put the * after the subcommand: Bash(git *) allows every git command.
Bash(ls *) vs Bash(ls*)The first does not match lsof; the second does.
Read(./.env)Reading .env in the current folder. A Read deny rule also stops Edit and Write on that path.
WebFetch(domain:example.com)Fetches from that domain.
mcp__puppeteer__*Every tool from the MCP server named puppeteer.

Anthropic's settings reference gives this example. It approves npm run commands, prompts before git push, blocks reads of .env and starts sessions in Accept edits:

{
  "permissions": {
    "allow": ["Bash(npm run *)"],
    "ask": ["Bash(git push *)"],
    "deny": ["Read(./.env)"],
    "defaultMode": "acceptEdits"
  }
}

Put rules in ~/.claude/settings.json for all your projects, in a project's .claude/settings.json to share them with the team through git, or in .claude/settings.local.json for yourself in one project. Lists from different files are combined, not replaced, and a deny at any level cannot be overruled by an allow somewhere else. Allow rules in a project's shared file only take effect once you accept the workspace trust dialog for that folder; deny and ask rules apply at once.

Because auto mode lets pushes and pull requests through by default, Anthropic suggests ask rules if you want a person to sign off on them while auto mode handles everything else:

{
  "permissions": {
    "ask": [
      "Bash(git push *)",
      "Bash(gh pr create *)"
    ]
  }
}

Two limits to know. First, a Bash rule matches the command as Claude writes it. Bash(git push *) does not catch git -C . push origin main, and Anthropic says such a rule “isn't a security boundary around the program”. For a check on the full command text it points to a PreToolUse hook (see Claude Code hooks), and for enforcement that does not depend on wording, to sandboxing. Second, Read and Edit deny rules cover Claude's file tools and the file commands Claude Code recognises in Bash, but not a Python or Node script that opens the file itself.

Telling auto mode about your own set-up

If auto mode keeps blocking routine work, such as pushing to your company's GitHub organisation or writing to a team storage bucket, the usual fix is the autoMode.environment setting. Entries are plain sentences that the classifier reads, not patterns. Anthropic's example, shortened:

{
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: github.example.com/acme-corp and all repos under it",
      "Trusted internal domains: *.corp.example.com, api.internal.example.com"
    ]
  }
}

For actions that must never happen whatever anyone types, Anthropic recommends a permissions.deny rule in managed settings, which is checked before the classifier and cannot be overridden.

Plans, models and versions

If Claude Code says auto mode is unavailable, Anthropic suggests checking those requirements and whether any settings file sets disableAutoMode. Anthropic can also switch it off on its side; a session that gets that answer keeps auto mode off until it ends, so start a new session later.

Safety cautions, in Anthropic's words

“bypassPermissions offers no protection against prompt injection or unintended actions. For background safety checks with far fewer permission prompts, use auto mode instead.”Anthropic, Choose a permission mode
“Only use this mode in isolated environments like containers, VMs, or dev containers without internet access, where Claude Code cannot damage your host system.”Anthropic, on bypass permissions mode
“Permission rules are enforced by Claude Code, not by the model. Instructions in your prompt or CLAUDE.md shape what Claude tries to do, but they don't change what Claude Code allows.”Anthropic, Configure permissions
“You're responsible for reviewing proposed code and commands for safety before approval.”Anthropic, Security
“While these protections significantly reduce risk, no system is completely immune to all attacks. Always maintain good security practices when working with any AI tool.”Anthropic, Security

Which mode for which job

Built only from what Anthropic's permission modes page says each mode is for, including its “Common setups” table.

The jobModeAnthropic's conditions
Sensitive work or unfamiliar code where you review every actionManualNo isolation needed
Iterating on code you are reviewingAccept editsChanges reviewed afterwards, for example with git diff
Exploring a codebase before changing itPlanEdits blocked until you approve a plan
Long tasks, hands-off work, fewer promptsAutoNeeds a supported model; “a sandbox or container adds defense in depth”
Fewer prompts without a classifierManual plus the Bash sandbox in auto-allow mode (/sandbox)macOS, Linux and WSL2
CI with an exact allowlistdontAsk with --allowedToolsNothing beyond the CI runner
Fully unattended runsBypass permissionsRequired: a container, VM or the sandbox runtime, as a non-root user on Linux and macOS

Harrowtech.ai's AI Setup service sets up coding tools with rules and guardrails, from £720 (1 day); coding tools training is a half-day from £360. See pricing.

What this guide does not cover

It leaves out the Bash sandbox and its settings, the PowerShell tool's own deletion checks, deploying managed settings, the HIPAA configuration, server-side classifier review, the Agent SDK's permission callbacks, cross-session messaging and the separate permission modes in the desktop app's Cowork tab. It also lists only part of the 45 default blocks. Anthropic's pages linked below cover each of these. Features and version numbers change often, so check claude --version against the docs before relying on a detail.

Sources

Related: All Harrowtech.ai guides · Claude Code CLI and headless mode · Claude Code hooks · CLAUDE.md and projects · Claude Code commands and shortcuts · Claude Code best practices