Team agents that idle without completing work ignore shutdown_request messages
Summary
Team agents spawned via TeamCreate + Agent that go idle without completing their assigned task become zombie agents — they do not respond to shutdown_request messages. The only way to clean them up is manually deleting the team directory (rm -rf ~/.claude/teams/<name>/).
Steps to Reproduce
- Create a team via
TeamCreate - Spawn multiple agents via
Agenttool withteam_nameparameter - Some agents complete their work and send results via
SendMessage— these agents shut down normally when sentshutdown_request - Other agents go idle without completing their task or sending any message back (they just stop working)
- Send
shutdown_requestto the idle/zombie agents - Expected: Agent receives shutdown request, calls
shutdown_responsewithapprove: true, and terminates - Actual: Agent wakes up briefly (processes the message), then immediately goes idle again. The
shutdown_requestis never acknowledged. This repeats indefinitely.
Observed Behavior
In my session, I spawned 3 rounds of team agents (12 total) for a validation task:
Round 1 (4 agents: validator-divergence, validator-overcompute, validator-simd-btree, validator-hetero-json-meta):
- All 4 went idle without returning any results
- All 4 ignored multiple
shutdown_requestmessages
Round 2 (4 agents: validate-exp48-divergence, validate-exp49-overcompute, validate-exp50-51, validate-exp52-55-meta):
- All 4 went idle without returning any results
- All 4 ignored multiple
shutdown_requestmessages
Round 3 (4 agents: v1-divergence, v2-overcompute, v3-simd-btree, v4-hetero-json-meta):
- All 4 completed their work and sent detailed results via
SendMessage - All 4 responded to
shutdown_requestcorrectly and terminated
The pattern is clear: agents that successfully complete work shut down fine; agents that idle without completing work become zombies.
Shutdown Attempt Log
For each zombie agent, I sent 2-3 shutdown_request messages. Each time:
→ SendMessage(type: "shutdown_request", recipient: "validator-divergence", content: "Please approve this shutdown request immediately.")
← success: true, request_id: "shutdown-xxx@validator-divergence"
← (seconds later) idle_notification from validator-divergence
The agent wakes up from idle, but instead of calling shutdown_response, it just goes idle again. The request_id is never referenced in a response.
Workaround
Had to manually delete the team:
rm -rf ~/.claude/teams/gpumaxx-validation ~/.claude/tasks/gpumaxx-validation
TeamDelete also failed because it reported "Cannot cleanup team with 8 active member(s)" — the zombie agents counted as active even though they weren't doing anything.
Impact
- Cost: Zombie agents consume resources (they wake up for each shutdown attempt, process a turn, then idle again)
- Cleanup:
TeamDeleteis blocked, requiring manual filesystem cleanup - UX: The team lead has no way to forcefully terminate unresponsive agents
- Scaling: In a 12-agent team, 8/12 became zombies — this makes teams unreliable for multi-agent workflows
Suggested Fixes
- Force shutdown: Add a
force: trueparameter toshutdown_requestthat terminates the agent without requiring approval - TeamDelete --force: Allow
TeamDeleteto force-terminate all agents regardless of state - Idle timeout: Auto-terminate agents that have been idle for N minutes without any pending work
- Root cause: Investigate why agents that idle without completing work fail to process
shutdown_requestmessages — they may be in a state where the shutdown request JSON isn't being parsed/handled by the agent's conversation context
Environment
- Claude Code version: latest (2026-03-01)
- Model: claude-opus-4-6
- Platform: macOS ARM64 (Darwin 24.6.0)
- Team framework: TeamCreate / Agent / SendMessage
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗