[BUG] Duplicate/stale idle_notification messages from background teammate agents flood the parent session

Open 💬 0 comments Opened Jul 4, 2026 by lebaige

Preflight

  • [x] I have searched existing issues and this hasn't been reported yet (searched: "idle notification duplicate", "stale idle_notification teammate")
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code (2.1.200)

What's Wrong?

When background subagents (spawned via the Agent tool, addressable via SendMessage) complete or go idle, the parent/orchestrator session receives repeated idle_notification messages for the same agent — including:

  • notifications that arrive after the agent's final report was already delivered and acknowledged in the parent session;
  • re-deliveries of the same idle event minutes later, with the original timestamp;
  • idle notifications that race with (arrive just before) the agent's actual final report message, so the parent sees "idle, no report" followed moments later by the report.

In one long multi-agent orchestration session (~18 hours, 5–10 concurrent background agents at times), we counted 20+ stale/duplicate idle notifications, each delivered as a fresh teammate message that consumed an orchestrator turn (and the corresponding tokens) just to recognize and discard.

Typical shape of the redundant delivery:

{"type":"idle_notification","from":"<agent-name>","timestamp":"<original event time>","idleReason":"available"}

…arriving after that same agent had already sent its full final report via SendMessage and the parent had already responded to it.

What Should Happen?

One completion/idle signal per agent stop, deduplicated — or at minimum a monotonic event ID / "new since last delivery" marker so the parent can cheaply distinguish a fresh idle event from a re-delivery. An idle notification should also not be delivered after that agent's final report has already been delivered to the parent.

Steps to Reproduce

  1. In a session, spawn several background agents with the Agent tool (run_in_background default), each instructed to do a unit of work and SendMessage the result to the parent.
  2. Continue working in the parent session while they run; exchange a few SendMessage round-trips with one or more of them (e.g. request a follow-up fix after their first report).
  3. Observe the parent session's incoming teammate messages: the same agent produces multiple idle_notification deliveries — after its report, and repeated with the same timestamp across subsequent turns.

Frequency: reproduces routinely in any session with several background agents and follow-up message round-trips; the duplicate count grows with session length and with the number of parent→agent re-pings.

Environment

  • Claude Code 2.1.200, Windows 11 Pro (10.0.26200), PowerShell + Git Bash
  • Multi-agent: Agent tool with named background teammates + SendMessage

View original on GitHub ↗