Agent Teams: shutdown_request wakes idle agents who lose messages to already-terminated peers
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using agent teams, sending a shutdown_request to an idle teammate wakes them for one final turn. In that turn, the agent may attempt to send a message to a peer who has already been terminated. The message is silently lost — neither the sender, the lead, nor the user sees the content.
In our case, a developer agent tried to flag a "vector discrepancy" to an analyst agent that had already shut down. We never learned what the discrepancy was.
Reproduction
- Create an agent team with 3 teammates: analyst, developer, PM
- Analyst completes work, goes idle
- Shut down the analyst via
shutdown_request— analyst approves and terminates - Developer completes work, goes idle
- Send
shutdown_requestto developer - Developer wakes, attempts to send a message to the (now dead) analyst with a final observation
- Message is silently lost
- Developer approves shutdown
Observed Behaviour
- The developer's idle notification showed
[to analyst] Implementation complete; one vector discrepancy noted— indicating a message was attempted - The analyst was already terminated, so the message went nowhere
- No error was surfaced to the lead or the user
- The content of the "vector discrepancy" was permanently lost
Expected Behaviour
One or more of:
- Messages to terminated peers should bounce back to the sender or the lead — so the information isn't lost
shutdown_responseshould support acontentfield on approval — allowing agents to surface final observations during graceful shutdown (approve: true, content: "by the way, I noticed X")- The lead should be notified when a message fails to deliver — rather than silent loss
- Shutdown should not wake agents for a full turn — or at least prevent new outbound messages during the shutdown turn
Workarounds
- Shut down agents in reverse dependency order (downstream agents last) so peers are available for final messages
- Instruct agents to always send findings to the team lead rather than peers
- Don't shut down agents until the entire pipeline is complete
Environment
- Claude Code: 2.1.71
- macOS arm64 (Darwin 24.6.0)
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMSenabled- In-process teammate mode
Additional Context
This was discovered during an orchestrated HLR implementation using three specialised agents (technical-analyst, ruby-implementer, project-manager) coordinating via shared task list and peer messaging.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗