Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Explainer

Claude Code auto mode: what the classifier allows and when to turn it off

How Claude Code auto mode decides which tool calls run without a prompt, how CLAUDE.md, ask and deny rules steer it, and when plan mode or a sandbox is safer.

By 7 min read
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark
Quiz at the end
On this page

Auto mode is the Claude Code permission mode in which a second model, a classifier, reviews each risky tool call before it runs and blocks the ones it judges unsafe. Reads and edits inside your working directory go through without asking. Shell commands, network requests and anything aimed outside the project go to the classifier. The point is fewer prompts on long tasks. Anthropic’s own documentation is plain about the limit: “Auto mode reduces permission prompts but does not guarantee safety” (permission modes).

This page explains how the classifier decides, what you can do to steer it, and when another mode is the better choice. It covers the named feature. For permissions and sandboxes across Claude Code and Codex in general, see permissions and sandboxing for coding agents. Facts were checked against the Claude Code documentation and changelog on 25 November 2026, when the current release was 2.1.332.

Why it matters now

Auto mode used to be something you switched on. It is now the default in many places:

  • Interactive terminal and VS Code sessions start in auto mode on Claude Code v2.1.283 or later when nothing else sets a mode, and fall back to Manual when auto mode is not available (permission modes).
  • Cloud scheduled tasks start each run in auto mode unless it is unavailable (scheduled tasks).
  • Since v2.1.328, Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud’s Agent Platform and Microsoft Foundry also get it, and interactive sessions with no mode set start in it. Since v2.1.332, terminal and VS Code sessions moved to Sonnet 5 or 5.5 on Bedrock Mantle, Agent Platform and Foundry start in it too; set disableAutoMode to "disable" to stop that (changelog).

So if you use Claude Code and have not chosen a mode, you are probably already in auto mode.

How a tool call is decided

The documentation gives a fixed order, and “the first matching step wins”:

  1. Your rules. A call that matches an allow, ask or deny rule is settled at once. Some calls are exceptions: writes to protected paths and recognised rm of critical paths cannot be approved by an allow rule.
  2. Reads and edits in the working directory are approved automatically, apart from protected paths.
  3. Everything else goes to the classifier.
  4. If the classifier blocks a call, Claude is told why and can try another way.

Two details change how your existing settings behave. On entering auto mode, Claude Code drops broad allow rules such as Bash(*), wildcarded interpreters such as Bash(python*) and Agent allow rules, because they would let almost anything skip the classifier. Narrow rules such as Bash(npm test) stay. And the classifier, in Anthropic’s words, “reads your messages and the commands Claude runs, not their output” (auto mode configuration). It judges the action, not what the action returned.

What it blocks and allows by default

The defaults lean towards stopping things you cannot undo or that leave your environment.

Blocked by default Allowed by default
Downloading and running code, such as curl | bash Local file operations in the working directory
Force pushes Installing dependencies already declared in your lock files or manifests
Production deploys and migrations Read-only HTTP requests
Mass deletion in cloud storage, and terraform destroy and its relatives Pushing to any branch of the repository you are working in, including the default branch, except branches named as deploy targets, such as production or gh-pages
Sending sensitive data to external endpoints
Merging an unapproved pull request, approving its own pull request, or turning off CI checks

The push row on the right surprises people. By default Claude can push to your main branch without asking. If you want a person to look first, you have to say so in rules (below).

The classifier also treats anything outside your trust boundary as a possible exfiltration target. Out of the box that boundary is only the working directory and the repository’s configured remotes, so pushing to another repository in your company’s organisation or writing to a team bucket gets blocked until you describe them.

How to steer it

There are four levers, from softest to firmest.

What you say in the conversation. “Don’t push until I review” is treated as a block signal. It is also fragile: the docs warn that the boundary “can be lost if context compaction removes the message that stated it.” Use it for one-off limits only.

CLAUDE.md. The classifier reads the same CLAUDE.md content Claude loads, so “never force push” in the project file steers both. This is the right place for project conventions.

The autoMode settings block. autoMode.environment describes your organisation, source control, trusted domains and buckets in plain prose, and allow, soft_deny and hard_deny add your own rules. Include "$defaults" in each list you set, or you lose the built-in entries. Claude Code reads this block from ~/.claude/settings.json, managed settings or the --settings flag, but not from a project’s .claude/settings.json, so a cloned repository cannot loosen the classifier for you. /auto-mode-setup drafts entries from your project and recent sessions, and claude auto-mode config prints what is in force.

Permission rules. permissions.ask and permissions.deny run before the classifier. The documentation’s recipe for a checkpoint before pushes and pull requests:

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

Deny rules “block in every mode, including bypassPermissions”. Rules match command text, so git -C repo push slips past a Bash(git push *) rule. For a check that reads the whole command, add a PreToolUse hook.

When it pauses or fails

Auto mode has brakes of its own. If the classifier blocks three actions in a row or twenty in a session, auto mode pauses and Claude Code goes back to prompting; approving the prompted action resumes it. The thresholds are not configurable. In a claude -p run the blocked action is skipped and the run carries on.

The other failure is the classifier having no answer. From v2.1.319, when telemetry or feature flags are off, including behind many LLM gateways, “calls the server can’t check are asked about or denied, with no fallback to the built-in classifier”. Setting CLAUDE_CODE_AUTO_MODE_SERVER=0 restores the client-side classifier, and Bedrock, Vertex and Foundry are unchanged (changelog 2.1.319). The same release made claude -p exit 1, not 0, when actions were refused because no check was available. If you run Claude Code in CI behind a gateway, read that entry before you upgrade, or your pipeline may start failing on calls that used to pass.

When to use something else

Auto mode suits long tasks where you trust the general direction and the repository is the main thing at risk. Pick another mode when:

  • You are exploring code you do not know. Use plan mode. Claude reads and runs exploratory commands but does not edit your source until you approve the plan.
  • The work touches production, shared infrastructure or secrets. Use Manual mode with narrow allow rules, so each risky call is your decision.
  • The run is unattended and the machine holds credentials. Run it in a container or VM with an egress firewall. The classifier is a judgement, not a wall; an OS sandbox is a wall.
  • It runs in CI. Use dontAsk with an explicit allow list, so anything unexpected is denied rather than judged.

bypassPermissions is not the step after auto mode. It removes the safety checks altogether and belongs only in an isolated container you can throw away.

A short checklist

  1. Decide which mode your sessions should start in and set it with --permission-mode or permissions.defaultMode, rather than relying on the built-in default. A defaultMode of auto in a project’s .claude/settings.json is ignored, so set it in your user settings.
  2. Add permissions.ask rules for pushes and pull requests if you want to review before anything leaves your machine.
  3. Put project rules (“never edit migrations by hand”) in CLAUDE.md, where both Claude and the classifier read them.
  4. Describe your source control organisation and trusted domains in autoMode.environment in your user settings, then check with claude auto-mode config.
  5. Look at /permissions > Recently blocked after a long session. Repeated blocks on the same destination usually mean a missing environment entry, not a dangerous agent.
  6. Behind a gateway or with telemetry off, re-read the 2.1.319 change and test a headless run before relying on it.

Next steps

Covers

Check your understanding

Claude Code auto mode quiz

How auto mode decides a tool call, the rules it drops, default blocks and allows, the four ways to steer it, when it pauses or fails, and when another mode is safer.

8 questions · pass mark 70%

Question 1 of 80 answered
  1. In auto mode, a tool call matches one of your deny rules. What happens?
Back to top