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-jsonoutput 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.
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is unclear which local commands actually report an exit code.