[BUG] SessionStart hook stdout not injected into context (regression 2.1.209 -> 2.1.215, desktop app)
Summary
SessionStart hook stdout is no longer injected into session context. The hook executes (proven by its filesystem side effects), its stdout is non-empty (verified by manual re-runs of the identical command), but no hook_success attachment is written to the session transcript and the model receives nothing. This worked on 2.1.209 (07-18); it is broken on 2.1.215 (07-19, same machine, same settings, no config changes in between).
Environment
- Claude Code 2.1.215 (regression from 2.1.209)
- Claude Desktop app 1.22209.3, Windows 11 Home 10.0.26200
- Hook shell:
powershell.exe(Windows PowerShell 5.1)
Hook configuration (user settings.json)
"SessionStart": {
"matcher": "startup|resume|clear",
"hooks": [
{
"type": "command",
"command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"$USERPROFILE/.claude/hooks/session-start-sync.ps1\"",
"timeout": 60
}
]
}
The script reads cwd from stdin JSON, does some git syncing, and prints report lines to stdout (plain text, one line per report; exit 0).
Evidence
The hook ran and completed at session start. It writes a state file mid-run; on the affected session that file was stamped 12 seconds before the session's first transcript entry (state file 23:37:46 local, first transcript timestamp 23:37:58). So this is not a timeout: the full script, re-run manually with identical stdin, completes in 2.7 s against a 60 s limit.
Its stdout was non-empty. Manually re-running the exact hook command with the same stdin JSON immediately after session start prints one report line, deterministically (3/3 runs).
Nothing was delivered. The session transcript (~/.claude/projects/<project>/<session>.jsonl) contains attachments of other types (deferred_tools_delta, agent_listing_delta, skill_listing, ...) but zero hook_success entries, and the model's context contains no hook output.
On 2.1.209 the same hook's output was delivered. A 07-18 session transcript (v2.1.209, same machine/settings) contains:
{"parentUuid":null,"isSidechain":false,"attachment":{"type":"hook_success","hookName":"SessionStart:startup","toolUseID":"...","hookEvent":"SessionStart","content":"[project-sync] Repo is 5 commit(s) behind origin/main; ..."}}
Sweeping all projects on this machine for "hookEvent":"SessionStart" attachments: the last one anywhere is 07-18 23:05 (2.1.209). Every session since (all 2.1.215) has none.
Other hook events are unaffected. PostToolUse and Stop hooks on the same machine fire and work normally on 2.1.215 (verified live: a PostToolUse hook mirrored + committed a file within 1 s of the triggering Edit).
Steps to reproduce
- On Windows + desktop app, register a SessionStart hook (matcher
startup|resume|clear) whose command writes a marker file and prints a line to stdout. - Start a new session in a project.
- Observe: the marker file is written (hook ran), but the stdout line is absent from both the model's context and the session transcript (no
hook_successattachment). - Same setup on 2.1.209 produced the
hook_successattachment and the model saw the line.
Impact
Any workflow that uses SessionStart hooks to inject context (sync status, handoff/continuity notes, project reminders) silently stops informing the model. The hook's side effects still run, which makes the breakage easy to miss — the model just never sees the reports.
May be related to previously reported SessionStart delivery issues (#10373, #9591, #33612), but this instance is a clean version bisect on one machine: 2.1.209 delivered, 2.1.215 does not.