v2.1.204: failed self-update deletes live background agents' worktrees; completed agents can't be removed (Ctrl+X no-op) and reappear after restart
Summary
On v2.1.204 (native install, macOS arm64), a failed background self-update deleted the git worktrees of live background agents, crashing those sessions, and left the claude agents view in a state where completed agents cannot be removed with Ctrl+X and reappear after a full restart.
Environment
- Claude Code 2.1.204 (native install,
~/.local/share/claude/versions/2.1.204) - macOS 15 (Darwin), arm64
- Uses background agents + git worktrees (
.claude/worktrees/)
What happened
- Overnight the auto-updater ran and failed.
~/.claude/.last-update-result.json:
``json`
{"timestamp":"<TS>","path":"native","outcome":"failed","status":"install_failed","version_from":"2.1.204","version_to":null}
claude update` confirms 2.1.204 is already the latest — so this is a spurious/failed self-update on the current version, not a pending upgrade.)
(
- Shortly after, two live background agents crashed because their worktree working-directories had been removed.
~/.claude/daemon.log(paths redacted):
```
<t1> [bg] bg settled <idA> (crashed): working directory no longer exists ... /.claude/worktrees/<worktreeA>
<t2> [bg] bg settled <idB> (crashed): working directory no longer exists ... /.claude/worktrees/<worktreeB>
git worktree add` restored the sessions.
The daemon only *detected* the dirs missing — it did not log removing them — so the worktree deletion came from the update/restart path, not the daemon. Committed work was safe on the remote (only the local worktrees were lost); recreating them via
- The
claude agentsview now lists all past conversations under "Completed", Ctrl+X (single and double) does not remove them, and previously-removed entries reappear after a full quit + relaunch.
Expected
- A failed/no-op self-update must never delete worktrees belonging to live background agents.
- Ctrl+X on a completed agent should remove it and it should stay removed across restarts.
Actual
- Live agents' worktrees deleted → crash loop.
- Completed agents un-removable and resurrect on restart, growing an unbounded list.
Impact
Background-agent users on worktrees lose live sessions and get a permanently cluttered, un-clearable agent view.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗