Team UI indicators persist after force-deleting team files (zombie teammates)

Resolved 💬 12 comments Opened Feb 23, 2026 by daern91 Closed Jun 5, 2026

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

  1. Create a team with TeamCreate and spawn 3 teammates via Task tool
  2. While teammates are still running, manually kill them:
  • Switch to each teammate's tmux pane
  • Press Ctrl+C to interrupt the running agent
  • Type exit to close the tmux pane
  1. Return to the lead agent's session
  2. Result: UI still shows "3 teammates" with spinning indicators, time counter ticking, but 0 tokens used
  3. Attempting TeamDelete fails with "Cannot cleanup team with 3 active member(s)"
  4. Even force-deleting files (rm -rf ~/.claude/teams/team-name ~/.claude/tasks/team-name) does not clear the UI indicators
  5. 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)
  • TeamDelete should support a --force flag 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.

View original on GitHub ↗

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