Auto-updater prunes the running version's binary, silently breaking all subagent/teammate spawns mid-session
Summary
The auto-updater can prune the currently-running version's binary from ~/.local/share/claude/versions/. The running session survives (the OS keeps the deleted inode alive), but every subsequent subagent/teammate spawn silently fails: the launcher execs children via the parent's versioned binary path, which no longer exists.
Environment
- Platform: macOS (Darwin 25.5.0)
- Session started on version:
2.1.221 - Versions dir at failure time:
2.1.191, 2.1.204, 2.1.222, 2.1.226, 2.1.227, 2.1.228—2.1.221absent (pruned mid-session) - Long-lived interactive session (multi-day), agent teams enabled (
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1)
Repro / evidence
Run a long-lived session; let the auto-updater install newer versions and prune the running one. Then spawn a subagent (Agent tool / teammate). The spawn command the launcher constructs:
env CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 $HOME/.local/share/claude/versions/2.1.221 \
--agent-id <name>@session-<id> --agent-name <name> --team-name session-<id> \
--parent-session-id <id> --agent-type general-purpose ...
env: $HOME/.local/share/claude/versions/2.1.221: No such file or directory
Impact
- From inside the session,
Agenttool calls return "Spawned successfully" and the agent simply never runs and never reports — the failure is silent from the model's/user's perspective (it looks like a hung/lazy agent). We lost several hours across multiple days to "agents never started" before catching the exec error by running the spawn command manually. - Everything else in the session keeps working, which makes it harder to suspect the binary.
Expected
Any of:
- The updater never prunes the version a live session is running (pid/lockfile check).
- The teammate/subagent launcher falls back to the stable
claudeshim (or newest installed version) when the parent's versioned path is missing. - At minimum, the spawn failure surfaces as a loud error in the session instead of a silent no-op after "Spawned successfully".
Workaround
ln -s ~/.local/share/claude/versions/<newest> ~/.local/share/claude/versions/<pruned-running-version> — spawns recover immediately; minor parent/child version skew appears harmless.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗