Agent Teams: shutdown_request wakes idle agents who lose messages to already-terminated peers

Resolved 💬 3 comments Opened Mar 9, 2026 by sgbett Closed Mar 12, 2026

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

  1. Create an agent team with 3 teammates: analyst, developer, PM
  2. Analyst completes work, goes idle
  3. Shut down the analyst via shutdown_request — analyst approves and terminates
  4. Developer completes work, goes idle
  5. Send shutdown_request to developer
  6. Developer wakes, attempts to send a message to the (now dead) analyst with a final observation
  7. Message is silently lost
  8. 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:

  1. Messages to terminated peers should bounce back to the sender or the lead — so the information isn't lost
  2. shutdown_response should support a content field on approval — allowing agents to surface final observations during graceful shutdown (approve: true, content: "by the way, I noticed X")
  3. The lead should be notified when a message fails to deliver — rather than silent loss
  4. 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_TEAMS enabled
  • 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>

View original on GitHub ↗

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