You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin SessionStart hooks execute but additionalContext stdout is silently discarded #45438
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.
{
"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
Correction: the --print mode 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 --print mode exception DOES hold after all. The contradictory reports were from two concurrent sessions of the same agent -- one terminal (no additionalContext), one watch-spawned via claude --print (additionalContext present).
Confirmed behavior:
claude --print -p "prompt": plugin SessionStart additionalContext IS injected
Interactive terminal session: plugin SessionStart additionalContext is NOT injected
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.
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.
Activity
github-actions commentedon Apr 8, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
ssilvius commentedon Apr 8, 2026
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.ssilvius commentedon Apr 8, 2026
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.
ssilvius commentedon Apr 8, 2026
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.
ssilvius commentedon Apr 8, 2026
Closing as duplicate of #12151, #16538, #28305. Added regression data (v2.1.97) to #12151.
github-actions commentedon Apr 16, 2026
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.