fix: send_event.py exits 0 on JSON parse error (fixes #30)#40
Open
yurukusa wants to merge 1 commit intodisler:mainfrom
Open
fix: send_event.py exits 0 on JSON parse error (fixes #30)#40yurukusa wants to merge 1 commit intodisler:mainfrom
yurukusa wants to merge 1 commit intodisler:mainfrom
Conversation
Fixes disler#30 When multiple hooks are chained in PreToolUse, the first hook consumes stdin, leaving nothing for send_event.py. The JSON parse error caused sys.exit(1), which Claude Code interprets as a tool failure, blocking ALL Bash operations. Changed to sys.exit(0) to match the stated design principle on line 178: "Always exit with 0 to not block Claude Code operations." Applied to both .claude/hooks/send_event.py and apps/demo-cc-agent/.claude/hooks/send_event.py.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
send_event.pyexits with code 1 on JSON parse error, which blocks ALL Bash operations when hooks are chainedsys.exit(1)tosys.exit(0)to match the stated design principle on line 178: "Always exit with 0 to not block Claude Code operations".claude/hooks/send_event.pyandapps/demo-cc-agent/.claude/hooks/send_event.pyWhen multiple hooks are chained in PreToolUse configuration, the first hook consumes stdin.
send_event.pythen gets empty stdin, triggers ajson.JSONDecodeError, and exits with code 1. Claude Code interprets exit 1 as a hook error but still processes it as a failure signal, causing all subsequent Bash commands to fail.One-line change per file:
sys.exit(1)→sys.exit(0)in the JSON parse error handler.Fixes Bug:
send_event.pyexits with code 1 on JSON parse error, blocking all Bash operations #30