[BUG] Real-time inter-agent messaging for coordinated multi-agent workflows
### Problem
Agent-to-agent messages via SendMessage are queued and delivered only between turns. This means
agents are effectively deaf during tool execution. In coordinated workflows (teams/swarms), this
breaks the fundamental requirement of real-time coordination.
### Why this matters
Multi-agent workflows require agents to act as cooperative task schedulers — each agent must be able
to:
- Receive and react to signals during execution, not after
- Cancel, pause, or redirect work based on real-time feedback from teammates
- Prevent resource waste (OOME, CPU blocking, redundant work) by responding to control signals
immediately
- Maintain shared awareness of team state at all times
With queued-only delivery, none of this is possible. Agents are isolated black boxes during their turns,
leading to:
| Scenario | Current behavior | Expected behavior |
|----------|-----------------|-------------------|
| Lead sends "STOP" during 5-min command | Message waits in queue | Agent receives signal, cancels
command |
| Agent A discovers Agent B's task is redundant | B continues for minutes unaware | B receives cancel,
pivots immediately |
| Memory pressure detected | No way to signal agents to reduce load | Agents receive backpressure signal,
shed work |
| Lead reassigns priorities mid-execution | Old priorities continue until turn ends | Agent pivots to new
priority in real-time |
### Current workaround
User manually kills agent processes (tmux panes) to force turn boundaries. This is fragile, error-prone,
and defeats the purpose of autonomous coordination.
### Proposed: real-time message bus
Agents should have access to a real-time message channel that is checked:
- After every tool call — before the agent plans its next action, check inbox
- During long-running bash commands — periodic check (every N seconds) with ability to interrupt
- On explicit poll — agents can
check_inbox()at any point in their reasoning
This transforms agents from isolated workers into coordinated processes with the same control
primitives as a proper task scheduler:
- Interrupt: High-priority message preempts current work
- Signal: Non-blocking notification checked at next opportunity
- Backpressure: Resource-aware signals (memory, CPU) that agents can respond to
- Barrier: Synchronization point where agents wait for each other
### Benefits
- Zero wasted compute: Cancelled work stops immediately, not minutes later
- No OOME risk: Agents can be told to shed load in real-time
- Perfect coordination: Team lead has actual control, not delayed suggestions
- Autonomous teams: Agents can self-coordinate without human intervention to kill processes
- Scalability: More agents doesn't mean more chaos — signals keep everyone aligned
### Environment
- Claude Code CLI
TeamCreate/SendMessagemulti-agent coordination- Agents spawned with
run_in_background: true - Linux (WSL2)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗