Teach Claude Code's Auto Mode About Your Setup in One Command
Claude Code 2.1.304 made /auto-mode-setup available in more places. It drafts the trusted-infrastructure list auto mode needs so it stops blocking your own repos. What it reads, what it writes, and the one mistake that wipes your safety rules.
If you run Claude Code in auto mode, you've probably hit this: it's flying along, then it stops on something completely ordinary. Pushing to your own company's GitHub org. Writing to a bucket your team owns. Installing from your private package registry. The block message names a rule like [Data Exfiltration] and you think: that's my own bucket.
It's not a bug. It's the classifier doing what it was told. By default it trusts exactly two things: your working directory and the remotes configured on the current repo. Everything else looks like "outside," and outside is where exfiltration lives.
Claude Code 2.1.304 (October 19) lists a guided fix for this: /auto-mode-setup. Per the docs, the command itself has existed on Pro, Max, Team and Enterprise for a while. What 2.1.304 changed is where it works: sessions with feature-flag fetching off (telemetry disabled, third-party providers like Bedrock and Vertex, the Claude apps gateway) used to get "Unknown command." If that was you, update and try again.
What it actually does
You type /auto-mode-setup. Claude Code asks how you use the project, then offers two optional scans. Then it builds a draft of an autoMode.environment list, which is a set of plain-English sentences describing what's yours. You accept or discard the draft as a whole.
What it always reads:
- This project's
CLAUDE.md,README.md, config files and git remotes - Your existing
autoModeandpermissions.allowsettings - The hosts, buckets and command names from commands Claude ran in your recent sessions in this project (never your messages)
The two opt-in scans add the first word of each command in your shell history, and the remote hosts and repo names under your home directory.
Why a list of sentences works
The entries are prose, not regex. The docs say to write them "the way you would describe your infrastructure to a new engineer." A typical entry looks like this:
{
"autoMode": {
"environment": [
"$defaults",
"Source control: github.example.com/acme-corp and all repos under it",
"Trusted cloud buckets: s3://acme-build-artifacts",
"Internal package registry: artifacts.example.com"
]
}
}The classifier reads those as context for deciding what "external" means. Anything not listed is still a potential exfiltration target, which is the point. You're not turning safety off. You're shrinking the set of things it has to be suspicious of.
If you're a solo operator, most of this is a few lines: your GitHub org, maybe one bucket, maybe one internal domain. If you're on a team, this is the file that cuts the false-positive noise for everyone, and the docs let an admin push it through managed settings.
The one mistake that matters
This is the part I'd tattoo on the wall. Setting environment, allow, soft_deny or hard_deny without the literal string "$defaults" replaces the whole built-in list for that section.
For soft_deny, that means losing force push, curl | bash, production deploys and auto-mode bypass. For hard_deny, it means losing the built-in data exfiltration rule. Per the docs, that's the full replacement, not a merge.
/auto-mode-setup handles this for you. Per the docs, when it adds entries to the rule lists, it includes "$defaults" so the built-ins stay. It writes the environment list without it, but only because the draft spells out the built-in entries it left unchanged. If you hand-edit the file afterward, keep that string in every list you touch.
After you accept the draft
Three habits I'd build in:
- Run
claude auto-mode config. It prints what the classifier is actually using, with your settings applied. Confirm your entries are there. - Run
claude auto-mode critiqueif you wrote custom rules. It flags entries that are ambiguous, redundant or likely to cause false positives. - Put hard stops in
permissions, not inautoMode. The docs are explicit: for actions that must never run,permissions.denyblocks before the classifier is consulted and can't be overridden. A developer-addedallowentry can override an organization'ssoft_deny, so the classifier layer is additive, not a hard policy wall.
One more detail worth knowing: the classifier ignores autoMode in project-level .claude/settings.json. That's deliberate, since a checked-in repo could otherwise grant itself permissions. Your config lives in ~/.claude/settings.json.
The other two things in 2.1.304
Code Review gained Quick, Standard and Deep levels, which is handy if you've been using one setting for everything. And Pro and Max plans now get a warning when resuming an inactive conversation would use a large share of your 5-hour limit. That one pairs well with the idle compaction change I wrote about last week.
What I'd do today
Update, run /auto-mode-setup once in your busiest project, read the draft before accepting it, then check the result with claude auto-mode config. If you've been approving the same prompts by hand for a month, this is the afternoon-saving fix.
Primary sources: the Claude Code changelog, the auto mode configuration docs, and the permission modes page.
Related posts
Claude Code Stopped Asking Permission This Week
Auto mode became the default in Claude Code on August 14. Here's what the classifier actually checks before it acts without you, what it still refuses to do no matter what, and the two settings I changed before trusting it on real work.
Claude Code Can Now Refuse to Write Outside Your Project, in Every Permission Mode
Claude Code v2.1.314 (October 30, 2026) added permissions.blockWritesOutsideWorkingDirectories, a setting that makes Write, Edit and NotebookEdit refuse any path outside your working directories. Here's what it covers, what it doesn't, and the settings file I'd put it in.
Claude Code Now Lets Slow MCP Tools Run in the Background
Claude Code 2.1.319 (November 6) adds support for MCP tasks in the terminal. A long-running tool call moves to the background and Claude gets the result when it finishes. Here's what that fixes, the two environment variables worth knowing, and what it won't do.