Follow Discord
Sweep 28 Sep 2026 · 18:16Z Build v2.1.284 505 read Stable v2.1.277 Latest v2.1.284 Next v2.1.284 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.284 ·

Scripts using claude -p get a local command's exit code

In -p mode with text or json output, Claude Code now exits with the exit code a local slash command reported, instead of always 0

Use it now Improvements
JSON All of v2.1.284
Use it nowTier: how much it should matter to you
3Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
Headless ModeArea: what it touches
ImprovementsKind: in v2.1.284,
What probably matters to youSection of the release
What

When you run Claude Code non-interactively with claude -p, the exit code (the number a program returns to say whether it succeeded) was 0 on success. With text or json output it now comes from a local slash command, meaning a command Claude Code handles itself without asking the model, when that command reported an exit code and the turn did not go on to the model. Otherwise it stays 0.

  • Commands from plugins do not set it.
  • With stream-json output the exit code is still 0.
Why

Scripts that run something like claude -p "/some-command" can now tell from the exit code whether the command failed.

How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is unclear which local commands actually report an exit code.

See this entry in the whole of v2.1.284 →

Feedback