Teammate overlay ghost entries persist after TeamDelete (and across subsequent TeamCreate)

Resolved 💬 2 comments Opened Apr 24, 2026 by yogsototh Closed Apr 24, 2026

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

  1. 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", ...)
``

  1. Let the agents do real work (tool calls, tokens consumed).
  2. Send each SendMessage(..., message: {"type": "shutdown_request", ...}).
  3. Receive shutdown_approved back from each.
  4. TeamDelete() — directories under ~/.claude/teams/team-a/ disappear; ps -ef | grep agent-id shows no surviving processes for team-a.
  5. Create a new team:

``
TeamCreate(team_name: "team-b", description: "...")
Agent(..., team_name: "team-b", name: "dev-b", ...)
``

  1. Open the teammates overlay (the Shift+↑/↓ to select panel 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 contains Agent/SendMessage calls 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 0 suggest 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)

  1. TeamDelete garbage-collects the overlay entries for that team's members so new sessions start clean and current sessions visually reconcile.
  2. Surface a /clear-teammates slash-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).
  3. 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_requestshutdown_approved) OR via TeamDelete without shutdown first.
  • The skills I drive teams with (/iroh-team, /multi-agent) now enforce a shutdown handshake before TeamDelete as a defensive measure, but the overlay still leaks — so the root cause is not "missing shutdown handshake in user code".

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗