Claude Code headless runs exit with an error when auto mode cannot check an action
From Claude Code 2.1.337, claude -p and Agent SDK runs end with is_error: true and exit code 1 when auto mode could not check an action. Set CLAUDE_CODE_DISABLE_UNCHECKED_ACTIONS_ERROR=1 to keep the old behaviour.
What does this mean for me?
Action needed
Engineering leadership
Cost, risk, timeline, team impact Action neededCI pipelines running Claude Code headless in auto mode can start failing after 2.1.337 where the safety check is refused, such as behind gateways or on cloud providers. Have teams check their jobs now.
Engineer
What to change, what breaks, what to test Action needed`claude -p` and Agent SDK runs now return `is_error: true` and exit 1 when auto mode couldn't check an action. Fix the check's access, or set `CLAUDE_CODE_DISABLE_UNCHECKED_ACTIONS_ERROR=1` to restore the old exit.
General consumer
Using the Claude apps, not the API No impactNothing to do: this changes Claude Code's command-line exit behaviour and does not affect the Claude apps.
Claude Code 2.1.337 changes how non-interactive runs finish when auto mode’s safety check could not run on an action. claude -p and Agent SDK runs now end with is_error: true and exit with code 1 in that case.
A CI job or script that runs Claude Code headless in auto mode, for example behind a gateway or on a cloud provider where the check can be refused, can start failing after this update even though its work completed. Setting CLAUDE_CODE_DISABLE_UNCHECKED_ACTIONS_ERROR=1 opts out. The same release improves the error messages that say when the check was refused and who can fix it.
The changelog does not date its versions. The date is the day this release first appeared in the changelog, between the previous run on December 3 and this one.
API surface
| Parameter | Change | Breaking | Models |
|---|---|---|---|
CLAUDE_CODE_DISABLE_UNCHECKED_ACTIONS_ERROR | added | no | |
is_error | changed | yes |
Topics: Coding tools