Fleet/agents view: "deleted" (Ctrl+X) background sessions get respawned by the daemon supervisor and become un-openable ("running in another terminal")
Describe the bug
In the claude agents (Fleet) view, deleting a session with Ctrl+X does not actually terminate the session. The daemon supervisor respawns the worker, so the session reappears in the Completed group after the view restarts. Because a live worker keeps holding the session lock, trying to open the reappeared session fails with:
Can't open — this session is running in another terminal
The result is a limbo state: sessions that appear in the list but can be neither opened nor removed. Over time the Completed list fills up with these zombie entries (I remembered ~5-6 agents, now many more show up).
Environment
- Claude Code version: 2.1.204
- Platform: macOS (darwin 25.5.0)
To reproduce
- Launch several background agents from the Fleet view (
claude agents). - Delete some of them with Ctrl+X (stop, then delete).
- Restart / reopen the agents view.
- The deleted sessions reappear in the Completed group.
- Try to open one →
Can't open — this session is running in another terminal.
Evidence (from ~/.claude/daemon/roster.json)
All 7 registered workers are alive (verified with kill -0). Three of them show "attempt": 2, i.e. the supervisor already respawned them at least once after they were stopped:
worker attempt pid
A 2 (alive)
B 2 (alive)
C 2 (alive)
D 1 (alive)
E 1 (alive)
F 1 (alive)
G 1 (alive)
Each worker's dispatch has "source": "fleet", launch.mode: "resume", respawnFlags: ["--agent","claude","--permission-mode","auto"]. The supervisor keeps them (or respawns them) even after a Ctrl+X delete, so killing the worker PID alone doesn't help — the supervisor brings it back.
Expected behavior
- Deleting a session from the Fleet view should terminate the underlying worker and prevent the supervisor from respawning it.
- A finished/deleted session should not be reported as "running in another terminal".
- There should be a way to fully clear a session from the Completed list without manually stopping the daemon supervisor.
Actual behavior
- Delete only hides the entry in-memory; the worker stays alive and is respawned, so the entry comes back and stays un-openable.
Notes
- Daemon supervisor pid holds the roster; the only reliable workaround found is to stop all
claudeprocesses AND the daemon supervisor, otherwise workers respawn.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗