[BUG] Stderr not in transript (Ctrl + O) when SessionStart hook fails with non-blocking status code
Resolved 💬 4 comments Opened Feb 5, 2026 by liukatkat Closed Mar 6, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I created a SessionStart hook which prints "TEST OUTPUT" to stderr and returns with exit code 1. For Claude Code v2.1.25 or prior, output to stderr can be observed when in transcript mode.
▐▛███▜▌ Claude Code v2.1.25
▝▜█████▛▘ Sonnet 4.5 · API Usage Billing
▘▘ ▝▝ /Users/katrinaliu
⎿ SessionStart:startup hook error: Failed with non-blocking status code: TEST OUTPUT
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Showing detailed transcript · ctrl+o to toggle · ctrl+e to show all
However, starting from v2.1.27, the output disappeared.
▐▛███▜▌ Claude Code v2.1.27
▝▜█████▛▘ Sonnet 4.5 · API Usage Billing
▘▘ ▝▝ /Users/katrinaliu
⎿ SessionStart:startup hook error
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Showing detailed transcript · ctrl+o to toggle · ctrl+e to show all
What Should Happen?
According to the docs:
Any other exit code is a non-blocking error. stderr is shown in verbose mode (Ctrl+O) and execution continues.
if the exit code is not 0 or 2, anything outputted to stderr should be shown in verbose/ transcript mode, which means the behavior of Claude Code from v2.1.27 onwards is wrong. I have also tried it on the latest version, and the behavior remains.
Error Messages/Logs
Steps to Reproduce
- Create a SessionStart hook that prints to stderr and returns with a non-blocking exit code
- Run
claudewith the hook added - Toggle Ctrl + O
- Observe that the output doesn't show up
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.25
Claude Code Version
2.1.27, 2.1.32
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗