#6886

vercel session-start-profiler.mjs appends duplicate export lines to the session env file on every resume or compaction

Openlmoya2005opened 6d ago

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

  1. Start a session with the vercel plugin enabled.
  2. Resume or compact the session several times.
  3. Count identical lines in ~/.claude/session-env/<sid>/sessionstart-hook-N.sh. On 2026-10-23 I measured 199 copies of the same export.

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

0

No activity yet.