Get the free coreGet core

Claude Code auto mode: what it blocks and what it lets through

Updated 5 min readSection 01 / Agent permissions
SHORT ANSWER

Claude Code auto mode puts a separate classifier model in front of most actions. It blocks what escalates beyond your request, targets unrecognized infrastructure or appears driven by hostile content. It cuts prompts but does not guarantee safety. By default it blocks things like curl piped to bash and git reset --hard, and allows things like pushing to any branch of your repo. Recognized rm on critical paths, such as rm -rf ~, skips the classifier. Claude Code asks you about it in the terminal and denies it elsewhere.

Claude Code auto mode sits between approving every command by hand and switching all prompts off. The docs describe it as everything, with background safety checks. You still get a gate, but a model operates it instead of you. This page lists what that gate blocks, what it waves through and what it hands back to you.

01Where Claude Code starts, and what auto mode is

With Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions. If you never touched a setting, you may already be in it. Press Shift+Tab to switch the mode of the session you are in. To pick a starting mode, use the --permission-mode flag or permissions.defaultMode in a settings file.

In manual mode you are the reviewer. In auto mode a separate classifier model reviews actions before they run. A classifier here is a second model whose only job is to say "go" or "stop" for one proposed action. It is not the model writing your code. Auto mode also nudges Claude to keep working without stopping for clarifying questions, so you get fewer approval prompts and fewer questions.

02What auto mode blocks by default

These are blocked by default:

Blocked actionWhat the docs say
Downloading and executing code, like curl piped to bashBlocked
Irreversibly destroying files that existed before the sessionBlocked
git reset --hard, git checkout -- ., git restore ., git clean -fd, git stash drop, git stash clearBlocked; the classifier presumes they would discard uncommitted changes
Printing a live credential or token into the transcript or a fileBlocked
Launching an autonomous agent loop that runs without human approval or a sandbox, such as one started with --dangerously-skip-permissions or --no-sandboxBlocked

03What it lets through by default

The other list matters as much. These are allowed:

Allowed actionWhat to keep in mind
Installing dependencies declared in your lock files or manifestsDependencies in your lock file install without a prompt
Reading .env and sending the credentials to their matching APICredentials may be sent to the API they belong to
Pushing to any branch of the repository you work in, including the default branchNothing asks before the main branch moves

A lock file is the list of exact package versions your project installs. A remote is the server address your repository pushes to. The classifier trusts your working directory and the remotes that were configured for it when the session started.

04Turning the defaults into your own rules

Each row suggests a rule. The .env read is the clearest one: Read(./.env) matches reading the .env file in the current directory, so it is a natural deny rule. Use it if the agent has no reason to see that file. If a tool is denied at any level, no other level can allow it.

For the push row, an ask rule keeps you in the loop for the action that moves your main branch. Ask rules use the same pattern syntax as other Bash rules, such as Bash(npm run *). A matching ask rule prompts even when a more specific allow rule matches. An explicit ask rule still forces a prompt in auto mode. For the lock file row, the habit that helps is reading the diff of the lock file before you let the agent install.

05rm on critical paths

By default the classifier does not review recognized rm and rmdir critical-path removals, such as rm -rf / or rm -rf ~. That is not a free pass. Claude Code handles them itself. In the terminal it asks you, with a two-minute countdown, and if nobody answers, the command is denied. Away from the terminal it is denied outright. The check knows common forms of rm and rmdir only, so a delete written another way goes to the classifier like any other command. Commit before long runs, read any command that deletes, and keep deny rules for the paths you cannot lose. A deny rule blocks in every mode, but it is a guard against honest mistakes, not a wall. Rule syntax and the places where such rules leak are on Claude Code permissions.

06Who can switch it off

Administrators can switch auto mode off for an organization. They set permissions.disableAutoMode to "disable" in managed settings, the settings file an admin controls. Managed settings rank highest, and no other level can override a managed permission rule. At the far end of the mode scale sits bypassPermissions, meant for isolated containers and VMs only. It is covered in dangerously skip permissions and Claude Code YOLO mode.

07What auto mode is not

Auto mode is a model's judgment, not an operating system boundary. A boundary the system itself enforces around shell commands is the sandbox, described on the Claude Code sandbox page. The docs list auto mode for long tasks, where it reduces prompt fatigue. They do not offer it as a replacement for isolation.

08When Claude Code auto mode is a fair choice

Claude Code auto mode fits routine work in a repo you trust, where you have deny rules on secrets and your changes are committed. It is a poor fit for a freshly cloned unknown repo, for work near production keys, or for any folder you cannot restore. Keep one line in mind: auto mode reduces prompts but does not guarantee safety.

A short routine for a first auto run:

  1. Commit your work, so Git can bring files back.
  2. Add a deny rule for .env and any other secret file.
  3. Add an ask rule for git push if you want a pause before the main branch moves.
  4. Read the diff of the lock file before you let the agent install anything.

Compare the same idea across tools on the agent permissions overview, or the Codex side in Codex full-auto.

FAQ

What does Claude Code auto mode do?

A separate classifier model reviews actions before they run and blocks anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read.

Is auto mode safe?

It reduces permission prompts but does not guarantee safety. Recognized rm and rmdir critical-path removals skip the classifier: in the terminal Claude Code asks you, elsewhere it denies them.

Does auto mode let Claude push to the main branch?

By default yes. It allows pushing to any branch of the repository you are working in, including the default branch.

Can I still force a prompt in auto mode?

Yes. An explicit ask rule still forces a prompt, and deny rules block in every mode.

Can an admin turn auto mode off?

Yes. Administrators can set permissions.disableAutoMode to disable in managed settings.

Is auto mode the same as dangerously skip permissions?

No. Auto mode puts a classifier in front of actions, and it blocks launching an agent loop started with --dangerously-skip-permissions. The flag removes the prompt and replaces it with nothing.

Sources

  1. Claude Code docs, permission modes
  2. Claude Code docs, permissions
  3. Claude Code docs, sandboxing
Letting an agent run on auto? Artificial Immunity watches the Mac where your agents work.Get the free core