[BUG] Agent Teams: Lead agent requires manual stdin input to process teammate notifications — breaks unattended orchestration
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?
Context
Project Setup: Production environment using a custom submodule/plugin named brain.
Role of brain: Acts as the session's main entry point and agent orchestrator.
Environment
Claude Code Version: v2.1.116 / Model: Opus 4.7 (1M context) · Claude Max / OS: macOS / Linux / Shell: zsh / bash / Experimental Flags: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
The Issue
When the brain orchestrator delegates tasks to Teammates, the entire session enters a "zombie" state once the teammate completes its work and sends a notification. Even though the notification is visible in the terminal, the Lead Agent (controlled by brain) stays idle. There is no visual feedback indicating that the system is waiting for manual intervention.
Technical Observations
Invisible Deadlock: The system is actually waiting for a stdin event (an Enter keypress) to process the teammate's synthetic message into the Lead's context.
Multi-cycle Scaling: The problem compounds in complex remediation loops (e.g., security-qa → fix → quality-gate → pr-governance). Each transition requires a separate manual Enter, making unattended long-running tasks impossible.
UX Failure: The tool looks frozen or crashed. The cursor blinks, but no reasoning or tools are triggered until a manual keypress occurs.
Visual Proof
As seen in the attached screenshots, the system stays in an Idle state even after the teammate has finished. The output from @pr-governance only renders after a manual keystroke is detected.
Before keystroke: System is stuck in Idle.
<img width="1615" height="217" alt="Image" src="https://github.com/user-attachments/assets/22ff519a-3f72-459d-b9b9-35de010f92ef" />
After keystroke: Teammate message and PR creation process appear instantly.
<img width="1605" height="237" alt="Image" src="https://github.com/user-attachments/assets/acf41b2f-7fd0-4fc2-8606-3b5a63900f3f" />
_Manual Enter: Breaks unattended automation and forces "chair-coupling" for the developer.
Running without Agent Teams: Results in loss of parallelism and teammate isolation, which is critical for complex multi-agent systems.
/loop command: Not designed for this specific inter-agent signaling use case and adds unnecessary overhead._
What Should Happen?
- Visual State Indicator: If the reasoning loop is paused waiting for a manual trigger to process an agent notification, display: [ACTION REQUIRED] Press Enter to allow 'brain' to process teammate response.
- Auto-process Flag: Allow a configuration (via settings.json or CLI flag) to let orchestrators like brain auto-consume teammate notifications without manual stdin events when confidence is high.
Error Messages/Logs
Steps to Reproduce
- Load a project with an agent orchestration submodule (like our brain plugin).
- Start a session with Agent Teams enabled.
- Trigger a task where a teammate must report back to the orchestrator.
- Teammate sends SendMessage(to="team-lead") upon completion.
- Notification appears in terminal as a teammate-message block.
- Lead Agent (brain) does NOT process it automatically.
- User must press Enter for brain to read the notification and continue the flow.
- Workarounds (None satisfactory)
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
Version: v2.1.116
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
6 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate. While the symptoms are similar to #38932 and #46691, this report confirms that the regression persists in v2.1.116 on macOS.
My case provides additional technical evidence:
Visual Proof: The attached screenshots clearly show that the teammate's output is already rendered in the terminal, yet the Lead Agent remains in a "zombie" Idle state. This confirms the deadlock is in the event loop's consumption of the buffer, not in the teammate's execution.
Orchestration Complexity: This occurs during complex handoffs managed by a custom orchestrator submodule ('brain'), showing that current stdin coupling breaks advanced automation workflows.
Version Gap: Reports like #38932 were filed on much older versions. This issue proves that previous fixes have not fully resolved the architectural coupling between the reasoning loop and terminal input events.
Reproduces in
claude -p(non-interactive) on v2.1.139 — not limited to Enter/TTY interactionI hit this on v2.1.139 (macOS) and the symptom set looks broader than the original report suggests. The lead never surfaces queued teammate messages even when there is no TTY/stdin in the picture, so this doesn't appear to be solely a "needs Enter keypress" issue.
Repro
Non-interactive harness via
claude -p:Observed
~/.claude/teams/t51959/inboxes/team-lead.jsonat ~t0+25s and ~t0+28s (visible by reading the file directly)read:falsethrough the full 90s wait<teammate-message>blocks ever appear in the lead's conversation (verified via stream-json output)verdict: "REPRODUCES_51959". Lead sent 0 wakeup pings (teammates did callSendMessageto write the tokens, but the lead never called it).Why this looks broader than stdin/TTY
claude -pwhere there is no user keystroke to wait onI don't know which internal component owns the delivery step, but whatever it is, it isn't being driven during
-pmode either.Monitoring
I've put this probe on a weekly cron — same harness runs every Sunday, classifies the outcome as
BUG_REPRO / FIX_DETECTED / HOOK_BLOCKED / UNKNOWN, and writes a ledger row. If two consecutive runs come backFIX_DETECTED, I'll comment back with the CC version that landed the fix.Happy to share the exact command or a redacted stream-json excerpt if useful.
Environment
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1via--settingsflag (verified reaching the spawned process)--setting-sources project,local(skips my user-scope hooks so they don't interfere)the underlying coupling is that the lead agent's loop reads from stdin as a discrete event, so teammate-message blocks don't enter the lead's context until a keystroke pumps the event loop. wrapping claude code outside the terminal (native UI, ACP transport) breaks this assumption: with no stdin in the picture, teammate messages can be injected as context events directly. as long as the lead is bound to a tty you'll keep hitting this in CI and headless flows too. the auto-process flag suggestion sidesteps the architectural piece, which is the real cost.
Here's how I ended up solving this. I moved orchestration out of the model into a small MCP-based layer: a server drives the workflow, validates each transition, and won't let agents skip steps or stall during unattended runs. Every execution is logged, making runs reproducible and auditable.
It fixed the issue for me. Happy to share access if anyone wants to try it — I'd genuinely appreciate feedback or criticism from others building agent workflows.
The manual stdin requirement is the thing that makes Agent Teams impractical for any unattended or scheduled orchestration -- it means your orchestrator has to be interactive, not a daemon.
We ran into this building a scheduled polling runner that dispatches Agent Teams jobs on a cron. The lead session stalls waiting for stdin on the teammate notification path even when there is nothing a human needs to see or respond to -- it is just an internal coordination message. This turns a batch workload into an interactive one, which defeats the purpose.
The MCP-based workaround that Dich01 described (a server driving the workflow and validating transitions) is the right structural fix at the application layer. We went a similar direction: move orchestration state out of the session and into an external coordinator, so the session itself handles execution but does not own the flow. That way the stdin requirement only affects the human-facing entry points, not the internal agent-to-agent handoffs.
Three things that would make this workable at the platform level:
The use case (scheduled, unattended multi-agent jobs) is large enough that it is worth a dedicated non-interactive mode rather than requiring everyone to build an external orchestration layer.