TeamDelete needs --force flag: agents stuck on shutdown block entire team lifecycle

Resolved 💬 3 comments Opened Mar 19, 2026 by zzecool Closed Mar 23, 2026

Problem

When using 10-agent teams, 1-3 agents consistently fail to respond to shutdown_request after work is done. They remain "active" and block TeamDelete, which refuses to clean up with active members. The only workaround is /exit to restart Claude Code entirely.

This happens on nearly every team cycle, adding 5-10 minutes of overhead per cycle.

Root Cause

Agents stuck in long tool calls (Bash, file I/O, network reads) never process the queued shutdown_request because they only check messages at REPL idle. If the tool call hangs or takes very long, the agent is permanently stuck.

Expected Behavior

TeamDelete should have a --force option (or timeout parameter) that terminates agents regardless of their state. Alternatively, a ForceKillAgent(agent_name) tool for the orchestrator.

Current Workaround

  1. Send shutdown_request to all agents
  2. Wait 30 seconds
  3. Send plain text "Shut down now"
  4. Wait 10 more seconds
  5. If TeamDelete still fails, tell user to /exit

Environment

  • Claude Code CLI
  • Windows 11
  • 10-agent teams with team_name + name parameters
  • Agents spawned as both subagent_type: "Explore" (Phase 1) and default (Phase 2)

Reproduction

  1. Create a team with 10 agents
  2. Have agents do real work (Bash commands, file reads on slow drives)
  3. Send shutdown_request to all 10
  4. 1-3 will never respond
  5. TeamDelete fails with "Cannot cleanup team with N active member(s)"

View original on GitHub ↗

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