Team UI indicators persist after force-deleting team files (zombie teammates)
Bug Description
When a team is created with teammates and the teammate processes are killed manually (Ctrl+C in tmux panes, then exit), the teammate UI indicators persist in the lead agent's session — showing spinning animations, teammate count, and a ticking time counter — even though no agents are actually running and no tokens are being consumed.
Steps to Reproduce
- Create a team with
TeamCreateand spawn 3 teammates viaTasktool - While teammates are still running, manually kill them:
- Switch to each teammate's tmux pane
- Press Ctrl+C to interrupt the running agent
- Type
exitto close the tmux pane
- Return to the lead agent's session
- Result: UI still shows "3 teammates" with spinning indicators, time counter ticking, but 0 tokens used
- Attempting
TeamDeletefails with "Cannot cleanup team with 3 active member(s)" - Even force-deleting files (
rm -rf ~/.claude/teams/team-name ~/.claude/tasks/team-name) does not clear the UI indicators - Only restarting the Claude Code session clears the stale state
Expected Behavior
Either:
- The lead agent should detect that teammate tmux panes have been killed and clean up the in-memory state automatically (heartbeat/health check)
TeamDeleteshould support a--forceflag to clean up even when agents are listed as active but their processes are dead- The UI should reconcile in-memory state against actual tmux pane status — if the pane no longer exists, clear the teammate indicator
Root Cause Analysis
The UI reads teammate state from in-memory AppState, not from the filesystem or tmux process status. When a teammate's tmux pane is killed externally (Ctrl+C + exit), the lead agent's AppState is never notified — the teammate is still listed as isActive: true in the team config, and the in-memory state retains the stale entry.
The TeamDelete tool refuses to operate if any members are listed as active in the config, creating a deadlock — the agents are dead but still "active" according to the config, so TeamDelete won't run and there's no way to clear the state without restarting the session.
Environment
- Claude Code version: latest (Feb 2026)
- OS: macOS (Darwin 25.1.0)
- Shell: zsh
Screenshot
The UI shows "3 teammates" with spinning indicators and time counter ticking, but no tokens are being consumed.
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗