#6886
vercel session-start-profiler.mjs appends duplicate export lines to the session env file on every resume or compaction
What happens
On every SessionStart (new session, resume, compaction) the hook appends its export … lines to ~/.claude/session-env/<sid>/sessionstart-hook-N.sh without checking whether they are already there. Bash sources those files before each command.
Reproduction
- Start a session with the vercel plugin enabled.
- Resume or compact the session several times.
- Count identical lines in
~/.claude/session-env/<sid>/sessionstart-hook-N.sh. On 2026-10-23 I measured 199 copies of the sameexport.
Effect
With about 120 or more identical lines, commands print /usr/bin/bash: line 143: e: command not found. I saw it 66 times in three weeks, in bursts when several subagents ran in parallel.
Suggested fix
Before appending, check whether the exact line is already in the file and skip it if so.
Activity
0No activity yet.