Teammate overlay ghost entries persist after TeamDelete (and across subsequent TeamCreate)
Summary
The Claude Code "teammates running" overlay (Shift+↑/↓ to select) retains ghost entries for teammates from previously TeamDelete'd teams. The ghosts persist across new TeamCreate calls within the same session, all showing frozen "0 tool uses · 0 tokens" counters regardless of the work those agents did before exiting.
Environment
- Claude Code version:
2.1.118(macOS) - OS:
Darwin 25.4.0 - Model:
us.anthropic.claude-opus-4-7
Reproduction
- In a Claude Code session, create a team:
````
TeamCreate(team_name: "team-a", description: "...")
Agent(subagent_type: "general-purpose", team_name: "team-a", name: "dev-a", ...)
Agent(subagent_type: "general-purpose", team_name: "team-a", name: "reviewer-a", ...)
- Let the agents do real work (tool calls, tokens consumed).
- Send each
SendMessage(..., message: {"type": "shutdown_request", ...}). - Receive
shutdown_approvedback from each. TeamDelete()— directories under~/.claude/teams/team-a/disappear;ps -ef | grep agent-idshows no surviving processes for team-a.- Create a new team:
````
TeamCreate(team_name: "team-b", description: "...")
Agent(..., team_name: "team-b", name: "dev-b", ...)
- Open the teammates overlay (the
Shift+↑/↓ to selectpanel in top-right).
Expected
Overlay lists only team-lead + dev-b (the actually live members of the only live team).
Actual
Overlay lists team-lead + dev-b AND all of dev-a, reviewer-a, and any other member from the deleted team-a. All ghost entries show 0 tool uses · 0 tokens even though they actually consumed tokens. Whimsy-words ("Jitterbugging…", "Scampering…", etc.) keep animating on the ghost entries as if they were live.
Screenshot in the linked post — reproduced multiple times across separate sessions.
Evidence this is a pure UI state leak (not leaked processes)
ls ~/.claude/teams/→ only the live team's dir.ps -ef | grep -E 'claude.*--agent-id'→ only the live teammate process.~/.claude/teams/<deleted-team>/config.json→ file doesn't exist.- The session's
history.jsonl/ project transcript still containsAgent/SendMessagecalls referencing the old teammates, which appears to be what the overlay replays from.
Impact
- Cosmetic, but actively misleading: users see "agents running" that aren't, which erodes trust in the overlay as a source of truth for "what's happening in this session". (I spent time debugging the ghost list before realizing it was stale UI, not a real problem.)
- Counters frozen at
0suggest the overlay isn't pulling live telemetry from live agents either — so a user watching token burn-down may misread a truly idle overlay as "nothing running" and a ghost-laden one as "agents burning cycles".
Desired behaviors (in priority order)
TeamDeletegarbage-collects the overlay entries for that team's members so new sessions start clean and current sessions visually reconcile.- Surface a
/clear-teammatesslash-command or keyboard shortcut that prunes ghost entries in the current session without ending it (important when the session is monitoring a long-running teammate that shouldn't be interrupted). - At minimum, suppress animated whimsy-words on entries whose backing process has exited so users can tell ghosts from live agents at a glance.
Workaround
None known in-session. Starting a fresh session pretends to help (the old session's transcript doesn't load), but since the same history.jsonl is involved for the project, ghosts can also carry across.
Notes
- Same behavior whether teammates were shut down cleanly (explicit
shutdown_request→shutdown_approved) OR viaTeamDeletewithout shutdown first. - The skills I drive teams with (
/iroh-team,/multi-agent) now enforce a shutdown handshake beforeTeamDeleteas a defensive measure, but the overlay still leaks — so the root cause is not "missing shutdown handshake in user code".
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗