Skip to content

docs: clarify hook blocking exit code#57046

Open
MiladZarour wants to merge 1 commit intoanthropics:mainfrom
MiladZarour:docs/44707-hook-exit-code-warning
Open

docs: clarify hook blocking exit code#57046
MiladZarour wants to merge 1 commit intoanthropics:mainfrom
MiladZarour:docs/44707-hook-exit-code-warning

Conversation

@MiladZarour
Copy link
Copy Markdown

Summary

  • Clarify that only exit code 2 blocks Claude Code hook execution
  • Note that exit code 1 and other non-zero codes are non-blocking
  • Update the Bash hook example comments and hook-development troubleshooting docs

Motivation

Fixes #44707.

The current docs mention that “Other” exit codes are non-blocking, but this is easy to miss because developers often expect exit(1) / sys.exit(1) to block failed enforcement hooks.

Testing

  • Ran git diff --check
  • Ran python -m py_compile examples/hooks/bash_command_validator_example.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] Hook exit codes: exit(1) silently non-blocking - needs prominent warning

1 participant