Skip to main content

Auto Mode

Auto mode lets Claude Code run without routine prompts. A classifier model reads each action and blocks what is risky, such as a deploy to production or a push of secrets. You tune it with the autoMode setting.

Pick auto as the permission mode. permissions.disableAutoMode: "disable" turns it off, and permissions.defaultMode: "auto" starts in it. User settings, --settings, and managed settings set autoMode. Project and local settings do not.

Example​

~/.claude/settings.json
{
"autoMode": {
"environment": [
"$defaults",
"Trusted repo: github.com/acme/app",
"Trusted cloud buckets: s3://acme-build-cache"
],
"soft_deny": ["$defaults", "Never run migrations against the shared staging database."]
}
}

$defaults keeps the built-in entries at that place. A list without $defaults replaces them. Run claude auto-mode config to see the result.

How the Classifier Decides​

  • The classifier is a model call. It reads the transcript, with your rules as its system prompt.
  • By default it allows an action. It blocks an action that matches a hard_deny rule. It also blocks one that matches a soft_deny rule when no allow rule and no clear request from you clears it.
  • soft_deny rules cover destructive or irreversible actions that your intent can clear. hard_deny rules are security boundaries that your intent does not clear. Source: the autoMode schema text.
  • If the classifier cannot answer, the call is blocked or goes to a person. Program texts: Classifier unavailable, and Auto mode classifier transcript exceeded context window - falling back to manual approval.
  • Repeated denials trip a circuit breaker.
  • A server-side classifier can review actions instead. See CLAUDE_CODE_AUTO_MODE_SERVER. Server lists can add rules, and the program ignores server entries that are not strings, are blank, or hold control characters.

The default rule lists are on Auto Mode Default Rules.

The autoMode Setting​

Official pages: Choose a Permission Mode and Configure Auto Mode.

KeyStatusWhat it doesHow it worksScope
autoMode.allowDocumentedExceptions to the soft deny rulesList of strings. $defaults inherits the built-in rules at that placeUser, --settings, managed
autoMode.soft_denyDocumentedBlock rules that user intent can clearSame list rulesSame
autoMode.hard_denyDocumentedBlock rules that no intent clearsSame list rulesSame
autoMode.environmentDocumentedFacts about your setup and trusted resourcesSame list rulesSame
autoMode.classifyAllShellDocumentedSuspends every Bash and PowerShell allow rule in auto modeAll shell commands go to the classifier. Default false. true from ~/.claude/settings.json or --settings wins over a managed falseUser, --settings
permissions.disableAutoModeDocumentedTurns auto mode offValue disableSettings
skipAutoPermissionPromptDocumentedThe user accepted the opt-in dialogBooleanSettings
useAutoModeDuringPlanDocumentedPlan mode uses auto semanticsDefault trueSettings
permissions.defaultMode: "auto"DocumentedStart in auto modeNot from project or local settingsUser, managed

The plugin settings.json does not accept autoMode.

Not Verified

The program lists trusted sources for the rules and logs an untrusted_source event. The old notes say only policy, user, and flag settings can set the rules. The official docs confirm this only for classifyAllShell (user and --settings).

The claude auto-mode Commands​

CommandStatusWhat it doesHow it worksScope
claude auto-mode defaultsDocumentedPrints the default environment, allow, soft_deny, and hard_deny as JSONOption --label <prefix> shows only rules whose label starts with the prefix, without caseCLI
claude auto-mode configDocumentedPrints the effective config as JSONYour settings where set, defaults elsewhereCLI
claude auto-mode critiqueDocumentedAsks a model to review your custom rulesOption --model <model>. It checks clarity, completeness, conflicts, and actionabilityCLI
claude auto-mode resetDocumentedRemoves autoMode from the user settings fileOption -y, --yes skips the promptCLI
/auto-mode-setupDocumentedScans the project and recent sessions, and proposes autoMode rulesShows Auto-mode setup proposal is ready for review. Since 2.1.304 it is also on Bedrock, Vertex, Foundry, a Claude apps gateway, and with telemetry off. skillOverrides["auto-mode-setup"]: "off" turns it off (the program).Interactive

The config output tags custom rules as (custom rules added alongside the defaults) or (custom rules replacing defaults).

Environment Variables​

VariableStatusWhat it doesHow it worksScope
CLAUDE_CODE_AUTO_MODE_SERVERDocumentedServer-side review of auto mode actions0 uses own classifier requests. Needs 2.1.271Env
CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUTDocumentedRemoves the time limit of critical-path rm promptsIn auto mode these go to the classifierLaunch env only
CLAUDE_CODE_AUTO_MODE_MODELUndocumentedModel of the classifierA server-configured classifier model wins, and the bundle logs ignoring CLAUDE_CODE_AUTO_MODE_MODEL=Env
CLAUDE_CODE_BG_CLASSIFIER_MODELUndocumentedClassifier model for background sessionsListed with the model env varsEnv
CLAUDE_CODE_AUTO_MODE_TIERUndocumentedAny value sets the tier to strictSource envEnv
CLAUDE_CODE_CLASSIFIER_SUMMARYUndocumentedChooses llm or heuristic summariesBoolean parse, a hidden server-side flag picks the defaultEnv
CLAUDE_CODE_TWO_STAGE_CLASSIFIERUndocumentedTwo-stage classifierUse unknownEnv
CLAUDE_CODE_AUTO_MODE_EXTERNAL_PERMISSIONSUndocumentedUnknownUse unknownEnv
CLAUDE_CHROME_CLASSIFIER_FLOOR, CLAUDE_CHROME_PERMISSION_MODEUndocumentedChrome extension permission inputUse unknownEnv
CLAUDE_BG_SESSION_PERMISSION_RULESUndocumentedJSON with allow, deny, addDirs for a background sessionRead when CLAUDE_CODE_SESSION_KIND is bg. Removed from child envEnv
CLAUDE_CODE_PARKED_PERMISSION_WAIT_MSUndocumentedWait for a parked permissionDefault 2000Env
CLAUDE_CODE_RESTRICT_PERSONAL_CONFIGUndocumentedOwn skills and commands cannot pre-approve toolsPersonal hooks need existing rulesEnv

How It Works​

Permission Flow shows where the classifier sits: after the rules and hooks, only for calls that would otherwise ask.