Plugin SessionStart hooks execute but additionalContext stdout is silently discarded
Status Fixed / completed
Maintainer reply None cached
Activity 6 comments · opened Apr 8, 2026 · closed Apr 8, 2026
Problem
Plugin SessionStart hooks execute successfully (side effects work) but their stdout JSON containing hookSpecificOutput.additionalContext is silently discarded. The injected context never appears in the agent conversation.
Stop hooks in the same plugin work correctly (blocking error prompts appear). Only SessionStart additionalContext is affected.
Reproduction
- Install a plugin with this hooks.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh",
"timeout": 10
}
]
}
]
}
}
- session-start.sh outputs valid JSON:
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "This text should appear in conversation context"
}
}
- Start a new interactive terminal session
Expected: additionalContext text appears as a system-reminder in conversation context
Actual: Hook executes (file side effects work), stdout is discarded, no context injected
Evidence
- Hook execution confirmed via file markers (touch commands in the script create files)
- Plugin loading confirmed via channel MCP tools appearing in deferred tools list
- Manual execution of the script produces valid JSON
- Stop hooks in the same plugin/hooks.json work correctly
- Tested across 4 agents in different project directories, all consistent
- Same hooks.json format that works for settings.json hooks
Environment
- Claude Code latest (2026-04-08)
- Plugin installed at user scope
- macOS Darwin 25.3.0
- Interactive terminal sessions (not --print mode)
6 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Correction: the
--printmode exception I mentioned does not hold. An agent falsely reported success (it saw channel MCP tools load and assumed additionalContext was injected -- it was not).The bug affects all modes: interactive terminal,
--print, and watch-spawned sessions. No plugin SessionStart hook can inject additionalContext. Hook execution works (side effects confirmed), but stdout is always discarded for SessionStart. Stop hooks in the same plugin work correctly.Second correction: the
--printmode exception DOES hold after all. The contradictory reports were from two concurrent sessions of the same agent -- one terminal (no additionalContext), one watch-spawned viaclaude --print(additionalContext present).Confirmed behavior:
claude --print -p "prompt": plugin SessionStart additionalContext IS injectedThe bug is specific to interactive terminal mode.
Narrowed down: this is a regression in v2.1.97 (released 2026-04-08T21:52:34Z). Plugin SessionStart additionalContext was working correctly on v2.1.96 this morning. Same plugin, same hooks, same machine. The only change was the Claude Code auto-update to 2.1.97.
Closing as duplicate of #12151, #16538, #28305. Added regression data (v2.1.97) to #12151.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.