The Claude Code Changelog
All Episodes
Fixing CI Breakages from Auto Mode Changes in 2.1.319

Fixing CI Breakages from Auto Mode Changes in 2.1.319

0:00|0:00

In Claude Code 2.1.319, auto mode removes its automatic client-side fallback when server safety checks fail, meaning headless pipelines behind gateways can now fail closed with exit code one. Learn how to diagnose your setup using /status, configure the CLAUDE_CODE_AUTO_MODE_SERVER environment variable, and prepare your CI workflows.


Chapter 1

Auto Mode Server Checks and Exit Code 1 in 2.1.319

Lachlan Reed

This one's brought to you by Jellypod AI, and it's the other half of the unattended stability story from last time. We covered denyInsteadOfPrompting in 2.1.319, which stops agents stalling on permission prompts. Same release, there's a change to auto mode that can quietly turn your CI red.

James Turner

Right, so here's what changed. Before 2.1.319, if auto mode couldn't reach the server side safety check, Claude Code fell back to a built in client side classifier. That happened with telemetry or feature flags off, and behind LLM gateways. Now there's no fallback. Calls the server can't check are asked about or denied. Bedrock, Vertex and Foundry are unchanged, per the release notes.

Lachlan Reed

And the headless part is the sharp edge. Previously, claude dash p in auto mode could exit zero even when its actions were refused because no safety check was available. A green tick, and nothing actually happened. Now, text and JSON output both exit one.

James Turner

So that's good, it fails closed. But if you upgrade a pipeline running behind a gateway, it can go red the moment you pull 2.1.319. Same for a resumed run: claude p with resume and a prompt now exits one if a deferred tool call's MCP server is missing, keeps the call, and refuses later input.

Lachlan Reed

Okay, so how do you deal with it. First, check what your session actually has. Run slash status and look at the Auto mode server row. That row used to say Enabled even when a gateway was dropping the server side review. It's fixed now, so it tells you the truth.

James Turner

Then you've got two env vars. If you want the old behavior, the client side classifier, set CLAUDE_CODE_AUTO_MODE_SERVER equals zero. So: export CLAUDE_CODE_AUTO_MODE_SERVER=0 in your shell or CI environment. That's the explicit opt in to the fallback.

Lachlan Reed

Other direction is one. Behind a gateway, CLAUDE_CODE_AUTO_MODE_SERVER equals one turns the server side check on, even with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set. And if your managed settings set that betas variable, they have to set the one too, or the check won't come on.

James Turner

For CI, practical step: stop treating zero as a given. Run your claude p job with auto mode in a test branch, and confirm your script handles a non zero exit. If it fails, check status output first, because the likely cause is a gateway not passing the server review through. Fix the gateway, or choose zero on purpose.

Lachlan Reed

One more caveat. If your permission rules or autoMode settings are very large, auto mode used to refuse without saying why. Now it explains, and unless you've set autoMode deny rules, it asks you in the terminal.

James Turner

A few smaller things worth a mention. There's a new CLAUDE_CODE_DISABLE_FEATURE_FLAGS variable that stops feature flag fetching without turning off telemetry, so every flag uses its built in default. Slash usage now shows spend for today, this week and this month, for developers behind a Claude apps gateway with no spend limit.

Lachlan Reed

And slash tasks has a new Earlier in this session row listing finished subagents, so you can reopen one and message it, even after a restart. Also slash claude-api latency-optimize, which finds where your API code makes people wait and tries faster settings against your eval. Bottom line: check status, pick one or zero deliberately, and test your exit codes before Monday.