TeamDelete needs --force flag: agents stuck on shutdown block entire team lifecycle
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
- Send
shutdown_requestto all agents - Wait 30 seconds
- Send plain text "Shut down now"
- Wait 10 more seconds
- If
TeamDeletestill fails, tell user to/exit
Environment
- Claude Code CLI
- Windows 11
- 10-agent teams with
team_name+nameparameters - Agents spawned as both
subagent_type: "Explore"(Phase 1) and default (Phase 2)
Reproduction
- Create a team with 10 agents
- Have agents do real work (Bash commands, file reads on slow drives)
- Send
shutdown_requestto all 10 - 1-3 will never respond
TeamDeletefails with "Cannot cleanup team with N active member(s)"
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗