How Claude Code auto mode works: my setup, and what it blocked
In auto mode, Claude Code stops asking for permission: a second model, the classifier, reviews each action before it runs and blocks what goes beyond your request, targets unknown infrastructure, or follows hostile content. I use it everywhere, scheduled tasks included. Three rules are enough for me: an exception is one sentence in autoMode.allow in ~/.claude/settings.json, every list starts with "$defaults", and a block is a normal outcome, planned for in the prompt.
The problem: clicking “Yes” without reading, or switching everything off
In Manual mode, Claude Code stops before most commands. After an hour, you approve without reading, and the question no longer protects anything. The other reflex is --dangerously-skip-permissions, which the documentation reserves for isolated containers and virtual machines.
Auto mode sits between the two. Compared with the other modes:
- `acceptEdits` lets through reads, file edits and common file commands (
mkdir,mv,cp). Everything else asks. - `bypassPermissions` lets everything through, with no check at all.
- `auto` lets everything through, but each risky action is first judged by the classifier.
Since version 2.1.283, it is the default starting mode in the terminal and in VS Code. In the terminal, Shift+Tab cycles through the modes. The documentation still warns: auto mode reduces prompts, it does not guarantee safety.
How it decides
Each action follows a fixed order, and the first step that applies wins:
- Your `allow`, `ask` and `deny` rules decide first. An
askrule still prompts you, even in auto mode. - Reads and file edits inside the working directory go through without review.
- Everything else goes to the classifier. If it blocks, Claude gets the reason and looks for another way.
Blocked by default, among others: downloading and running code (curl | bash), production deploys and migrations, force pushes, git reset --hard, printing a key into the conversation. Allowed by default: installing declared dependencies, read-only HTTP requests, and pushing to any branch of the session's repository, the default branch included.
Two details change how you write your configuration. When entering auto mode, Claude Code sets aside allow rules that are too broad, such as Bash(*) or an interpreter followed by a star: they come back when you leave it. And the classifier reads your CLAUDE.md files but not tool results, so a booby-trapped web page cannot talk to it directly. A rule like “never force push” in CLAUDE.md therefore steers both Claude and the classifier.
My setup: a single exception, written as a sentence
The setting lives in the autoMode block of ~/.claude/settings.json. The classifier ignores it in the project's .claude/settings.json and .claude/settings.local.json: a cloned repository cannot grant itself its own exceptions. The rules are not patterns but sentences, read the way you would brief a new engineer.
My allow block holds one sentence, added on 4 November 2026. Slightly shortened, it reads:
"autoMode": {
"allow": [
"$defaults",
"Deploying one of my app sites to production with `vercel deploy --prod` is authorized by the user (04/11/2026), including from the scheduled SEO guides tasks."
]
}"$defaults" keeps the exceptions built into Claude Code; without it, the list replaces them. My sentence names the command, the scope, the date and the scheduled-task case. A vague sentence such as “deployments are allowed” would open far more than my app sites.
Everything else runs on the default rules. Every morning, the task that publishes this blog writes the post, runs the checks, commits and pushes to main without asking me anything: it is the session's repository, and pushing there is allowed. The safeguard is not in the permissions, it is in the prompt: one red check, and nothing gets published.
What it blocked, and why I kept those blocks
- Ad campaigns. One morning in October, the ads pass of a scheduled task was supposed to create campaigns. The classifier refused. Nothing was spent, and the report said so. I did not add an exception: new spending is now decided in a conversation with me.
- Reading keys. On 17 August, on one of my apps, it blocked the command that prints a Supabase project's API keys, then
security find-generic-password, which reads the macOS keychain, even after I agreed in the conversation. I refused to allow them: Claude has no business reading raw keys. Supabase's MCP server, connected with a personal access token, already covered SQL queries and test data. - The guides' deploys, before 4 November. All my SEO guide tasks have an instruction for this case: deploy refused for lack of permission, keep the commit and say so in the report. The exception came later, once I decided that this particular deploy was routine.
For an approval given in the conversation to go through, the documentation asks you to name the action and what makes it risky, for example the branch of a force push. “You can push” is not always enough, and the approval only covers that one action. In the desktop app, where I work, there is no tab of blocked actions: this is the only way to make Claude retry. In the terminal, /permissions lists recent denials under the Recently blocked tab.
In a scheduled task, nobody answers. After 3 blocks in a row or 20 in total, an interactive session goes back to prompting. A claude -p run without a permission prompt tool has nobody to ask: the action does not run and Claude keeps going. So the block has to be planned for in the prompt, as a normal outcome.
What went wrong
- A frozen `environment` block. This block describes your trusted infrastructure to the classifier: repositories, domains, services. While preparing this post, I ran
claude auto-mode configand found 23 entries without `"$defaults"`: a copy of the defaults, written once. Its “Trusted repo” entry describes an empty test folder with no remote, and a default entry such as “Host containment” is missing. The pushes for this blog still go through, but the classifier reads a wrong description in every one of my sessions. The fix: put"$defaults"back and delete the copied entries. - Limits stated in conversation. If you write “don't push”, the classifier blocks pushes. But it rereads that sentence from the conversation, and the documentation notes that a compaction can remove it. For a lasting limit, it recommends a
denyrule. I don't have a single one yet.
The allow rules of my classic permissions are detailed in the post about my permission list, with the interpreters I removed from it.
How to get started
First, look at what the classifier actually applies on your machine:
claude auto-mode defaults # the built-in rules, as JSON
claude auto-mode config # the effective rules, with your additions
claude --permission-mode auto # start a session in auto mode- Work for a week with the default rules. Write down each block instead of allowing it right away.
- A block that keeps coming back for a routine action becomes a sentence in
autoMode.allow, in~/.claude/settings.json, with the exact command and scope. - Start every list with
"$defaults",environmentincluded, then check withclaude auto-mode config. - Write your lasting limits as
denyrules, not only in the conversation. - In a scheduled task, write in the prompt what to do when an action is blocked.
Article written with the help of AI, from my daily practice and my projects.
The whole notebook