[Bug] Hook documentation contradicts stdout handling for exit code 0 across hooks

Resolved 💬 2 comments Opened Jan 14, 2026 by gpambrozio Closed Feb 27, 2026

Bug Description

The hook docs have several contradictions when it comes to exit code and stdout.

In https://code.claude.com/docs/en/hooks#simple:-exit-code it says: Exit code 0: Success. stdout is shown to the user in verbose mode (ctrl+o), except for UserPromptSubmit and SessionStart, where stdout is added to the context.

Then a bit further down it says: Reminder: Claude Code does not see stdout if the exit code is 0, except for the UserPromptSubmit hook where stdout is injected as context so it doesn't mention SessionStart.

AND, in https://code.claude.com/docs/en/hooks#posttooluse-decision-control it says:

Adding context (exit code 0): There are two ways to add context to the conversation:
Plain text stdout (simpler): Any non-JSON text written to stdout is added as context. This is the easiest way to inject information.

meaning that PostToolUse also considers stdout when return code is zero.

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.7
  • Feedback ID: 60380737-0112-47d4-917a-ac2914fb6b2c

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗