How to choose the model for Claude Code's auto mode classifier with an environment variable
In auto mode, a separate classifier model reviews Claude's actions before they run. Claude Code 2.1.302 (October 16) adds CLAUDE_CODE_AUTO_MODE_MODEL to choose that classifier's model. It applies only to the classifier requests Claude Code sends itself; it doesn't change the model when the server reviews the session.
-
Sessions on a direct Anthropic API connection, a cloud provider, or an LLM gateway ask the server to review actions first. To pick the classifier model yourself, turn server review off so Claude Code sends its own classifier requests.
-
Put both variables under
envin settings.json.
{
"env": {
"CLAUDE_CODE_AUTO_MODE_SERVER": "0",
"CLAUDE_CODE_AUTO_MODE_MODEL": "<model name>"
}
}
- When the server doesn't review the session (for example, a gateway drops the review request or its results), Claude Code falls back to its own classifier, so the setting applies there too.
The changelog doesn't give the value format or default. Server-side review runs as part of the session's model requests at no charge, while Claude Code's own classifier requests are billed as token usage as before. On a direct Anthropic API connection, CLAUDE_CODE_AUTO_MODE_SERVER needs 2.1.281 or later.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.