Skip to content

Fix hook exit codes to show output to user - #9

Merged
zhumo merged 1 commit into
masterfrom
fix-hook-exit-codes
Jan 23, 2026
Merged

Fix hook exit codes to show output to user#9
zhumo merged 1 commit into
masterfrom
fix-hook-exit-codes

Conversation

@zhumo

@zhumo zhumo commented Jan 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Use exit code 1 with stderr output so users can see usage reporting status
  • Exit code 0 hides all output, exit code 2 would inject messages into model context
  • Removed session_id and message_uuid from output (only show input/output tokens)

Test plan

  • Run a Claude Code session and verify usage reporting messages appear to user
  • Verify Claude does not see or respond to the usage output

🤖 Generated with Claude Code

Use exit code 1 with stderr output so users can see usage reporting
status. Exit code 0 hides all output, while exit code 2 would inject
messages into the model context unnecessarily.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zhumo
zhumo merged commit 2ad29d9 into master Jan 23, 2026
@zhumo
zhumo deleted the fix-hook-exit-codes branch January 23, 2026 23:03
zhumo added a commit that referenced this pull request Mar 7, 2026
Use exit code 1 with stderr output so users can see usage reporting
status. Exit code 0 hides all output, while exit code 2 would inject
messages into the model context unnecessarily.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

1 participant