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
SessionStart hook appends its exports to CLAUDE_ENV_FILE on every start, so the file grows with each resume or compaction #810
scripts/session-lifecycle-hook.mjs (plugin codex 1.0.6) writes its three variables with fs.appendFileSync(process.env.CLAUDE_ENV_FILE, "export NAME='value' ") on every SessionStart. Claude Code fires SessionStart on startup, resume, clear, and compaction and keeps one environment file per session, so the file accumulates one copy of the three lines per event. After one long day the file held 16 copies (4,538 bytes), and because Claude Code prepends the whole file to every Bash tool command as part of a single bash -c string that Windows cuts at about 8,191 characters, Bash commands above about 3 KB began failing with unexpected EOF while looking for matching and the budget kept shrinking. Expected: the hook writes each variable once per session, for example by reading the file first and skipping a variable that is already exported with the same value, or by rewriting its own lines in place. The accumulation and the cut are also reported to Claude Code (the file is never deduplicated there and the Windows command-line limit is unhandled), but the plugin can stop the growth on its own with this change.
Reproduction: install the plugin on Windows with Git Bash, resume or compact the session a few times, then in the Bash tool run tr '' ' ' < /proc/$$/cmdline | grep -c 'export CODEX_COMPANION_SESSION_ID'; the count is the number of SessionStart events so far.
Activity