mirror of
https://github.com/mksglu/context-mode.git
synced 2026-09-19 03:27:16 +08:00
6891def8a7
resolveSessionId() read CLAUDE_SESSION_ID (an env var Claude Code never sets) and otherwise fell back to a /proc PID walk (`pid-<n>`), while discarding the stdin JSON payload it parses. The recording hooks key session_events by the Claude session UUID delivered in that payload's `session_id`, so `pid-<n>` never matched -> sessionBytes was always 0 -> the bar always rendered the global lifetime aggregate, identical in every session. Read session_id from the stdin payload first, then env, then PID walk (a strict superset of prior behavior). Widen the test harness to send a stdin payload and add a mutation-defeating regression test for the production path. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>