Unverified50% confidenceDecision RuleExact time
Hooks scripts use exit code 0 to allow the action normally and exit code 2 to block the current operation, in which case the standard error output is passed back to the model as the reason for blocking; other non-zero exit codes are usually treated only as the script itself erroring and do not necessarily block.
1
Sources
50%
Confidence
Long-term
Relevance
10/20/2026
First Seen
Sources
Related Entities
Related Claims
UnverifiedThe script should serve as a gate rather than a grade, exiting with a non-zero status code so that failures surface in the terminal.77% similarUnverifiedThe script chooses exit code 2 rather than 1 as the failure code because, by shell convention, 2 is commonly used for "usage error or condition not met," making it easy to distinguish a script crash from an active ledger rejection.72% similarUnverifiedWhen a coding agent's hook crashes, times out, or points to a nonexistent script, most tools by default choose to let it pass (fail-open).72% similarUnverifiedThe Claude Code cloud environment setup script should always exit with 0, because a failed setup script prevents the session from starting, and failure information should be logged to a file.69% similarUnverifiedAn exit code is an integer returned to the parent process when a Unix process ends, with the convention that 0 means success and non-zero means failure; CI systems decide whether the pipeline passes based on the exit code rather than log text.68% similar
Cite This Claim
Stable URI
https://kongchang.com/claim/1076589API
curl https://kongchang.com/api/v1/knowledge/claims/1076589MCP
get_claim(id=1076589)