Skip to content

fix: send_event.py exits 0 on JSON parse error (fixes #30)#40

Open
yurukusa wants to merge 1 commit intodisler:mainfrom
yurukusa:fix/send-event-exit-code
Open

fix: send_event.py exits 0 on JSON parse error (fixes #30)#40
yurukusa wants to merge 1 commit intodisler:mainfrom
yurukusa:fix/send-event-exit-code

Conversation

@yurukusa
Copy link
Copy Markdown

  • send_event.py exits with code 1 on JSON parse error, which blocks ALL Bash operations when hooks are chained
  • Changed sys.exit(1) to sys.exit(0) to match the stated design principle on line 178: "Always exit with 0 to not block Claude Code operations"
  • Applied fix to both .claude/hooks/send_event.py and apps/demo-cc-agent/.claude/hooks/send_event.py
    When multiple hooks are chained in PreToolUse configuration, the first hook consumes stdin. send_event.py then gets empty stdin, triggers a json.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.py exits with code 1 on JSON parse error, blocking all Bash operations #30

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.
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.

Bug: send_event.py exits with code 1 on JSON parse error, blocking all Bash operations

1 participant