claude-code - 💡(How to fix) Fix Teammate overlay ghost entries persist after TeamDelete (and across subsequent TeamCreate) [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52789Fetched 2026-04-25 06:20:54
View on GitHub
Comments
1
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×5closed ×1commented ×1

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.

Root Cause

  • 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".

Fix Action

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.

Code Example

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

---

TeamCreate(team_name: "team-b", description: "...")
   Agent(..., team_name: "team-b", name: "dev-b", ...)
RAW_BUFFERClick to expand / collapse

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", ...)
  2. Let the agents do real work (tool calls, tokens consumed).
  3. Send each SendMessage(..., message: {"type": "shutdown_request", ...}).
  4. Receive shutdown_approved back from each.
  5. TeamDelete() — directories under ~/.claude/teams/team-a/ disappear; ps -ef | grep agent-id shows no surviving processes for team-a.
  6. Create a new team:
    TeamCreate(team_name: "team-b", description: "...")
    Agent(..., team_name: "team-b", name: "dev-b", ...)
  7. 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".

extent analysis

TL;DR

The most likely fix involves updating the teammates overlay to properly garbage-collect entries for deleted teams and their members, potentially through a /clear-teammates command or automatic pruning upon TeamDelete.

Guidance

  • Investigate the history.jsonl file to understand how it contributes to the persistence of ghost entries in the teammates overlay.
  • Consider implementing a /clear-teammates slash-command to manually prune ghost entries without ending the session.
  • Review the overlay's logic for displaying teammates to ensure it accurately reflects the current state of teams and their members, suppressing animated whimsy-words for exited processes.
  • Examine the TeamDelete function to ensure it properly updates the UI state to remove deleted team members from the overlay.

Example

No specific code example is provided due to the lack of direct code references in the issue, but the solution may involve modifying the TeamDelete function or the teammates overlay rendering logic.

Notes

The issue seems to be related to a UI state leak rather than leaked processes, as evidenced by the absence of surviving processes for deleted teams and the persistence of ghost entries across sessions.

Recommendation

Apply a workaround by implementing a /clear-teammates command to manually prune ghost entries, as a more permanent fix may require updates to the TeamDelete function and the teammates overlay logic.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Teammate overlay ghost entries persist after TeamDelete (and across subsequent TeamCreate) [1 comments, 1 participants]