TeamDelete fails when teammate exhausted context and can't respond to shutdown

Resolved 💬 2 comments Opened Feb 12, 2026 by jeffeharris Closed Feb 12, 2026

Bug

When a teammate runs out of context window and can't respond to shutdown_request, TeamDelete permanently fails because it still sees that member as "active". There's no way to force-remove them through the API.

Steps to Reproduce

  1. Create a team with TeamCreate
  2. Spawn a teammate via Task tool with team_name
  3. Let the teammate exhaust its context window (large implementation task)
  4. Send shutdown_request via SendMessage — teammate can't respond (context exhausted)
  5. Call TeamDelete — fails with: Cannot cleanup team with 1 active member(s): <name>. Use requestShutdown to gracefully terminate teammates first.
  6. The tmux pane is already dead (tmux kill-pane returns exit 1)
  7. Even manually editing config.json to set isActive: false doesn't help — TeamDelete still refuses

Workaround

Manual cleanup: rm -rf ~/.claude/teams/<team-name> ~/.claude/tasks/<team-name>

Expected Behavior

Either:

  • TeamDelete should have a --force option to clean up despite active members
  • shutdown_request should have a timeout after which the member is considered terminated
  • If the tmux pane is dead, the member should automatically be marked inactive

Environment

  • Claude Code v2.1.39
  • Linux 6.8.0-100-generic
  • Team had 5 members over its lifetime, 4 shut down cleanly, 1 exhausted context

View original on GitHub ↗

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