Feature Request: Enable Agent-to-Agent Communication for Collaborative Workflows
Title: Feature Request: Enable Agent-to-Agent Communication for Collaborative Workflows
Is your feature request related to a problem? Please describe.
Yes. The current subagent architecture in Claude Code is excellent for delegation—handing off a self-contained task to a specialist and getting a result. However, it falls short for tasks that require true collaboration and iterative feedback between agents. This creates two primary problems:
- Lack of Iterative Feedback Loops: Complex software development is rarely a linear process. For example, a common workflow is a dev-test-fix cycle. Currently, if I have a "Developer Agent" and a "Tester Agent," the workflow is cumbersome:
- The Developer Agent writes code.
- The user (me) must manually instruct the Tester Agent to test it.
- If tests fail, the Tester Agent reports back to me.
- I then have to copy the failure details, re-engage the Developer Agent, and provide the context for the fix.
This manual intervention breaks the autonomy of the system and makes it impossible to assign a high-level goal like "Implement and test feature X until it passes all acceptance criteria."
- Destructive Interference in Parallel Work: When tackling a large epic, the natural approach is to use multiple agents in parallel. However, these agents are unaware of each other's existence or work-in-progress.
- Scenario: I assign Agent A to build an API endpoint and Agent B to build a related frontend component. Both are working in the same codebase.
- Agent A adds
api/new-endpoint.ts. - Agent B, when attempting to build or test its own work, sees
api/new-endpoint.tsas an unexpected file not relevant to its immediate task. - To "fix" its local build environment, Agent B might decide to run
rm api/new-endpoint.ts, destroying Agent A's work.
This forces users into complex workarounds like Git Worktrees, which provide isolation but prevent true collaboration on a shared context.
In short, agents currently operate as isolated contractors. We need them to operate as a cohesive, communicative team.
Describe the solution you'd like
I propose introducing a first-class system for agent-to-agent communication. This could be implemented in layers, from a simple messaging API to a more advanced collaborative framework.
Level 1: A Core Messaging Bus
An internal API that allows a running agent (or subagent) to send a message to another named agent.
- API: A new tool or internal function like
sendMessage(targetAgent: string, message: object). - Example: A
tester-agentcould executesendMessage('developer-agent-1', { type: 'TEST_FAILURE', file: 'auth.ts', line: 42, error: 'NullPointerException' }). - The
developer-agent-1would receive this message in its context and could be prompted to act on it.
Level 2: A Shared Dynamic State (or "Whiteboard")
A transient, shared key-value store or context space that is accessible to all agents within a single "team" or session. This would solve the parallel work problem.
- How it works: Agents could post their status or discoveries to the whiteboard.
- Example:
- Agent A:
sharedState.add('files_in_progress', 'api/new-endpoint.ts') - Agent B:
const inProgress = sharedState.get('files_in_progress');Before cleaning up its directory, Agent B would know to ignore files that other agents are actively working on.
Level 3: A "Team" or "Squad" Abstraction
A higher-level construct to formalize agent groups. When initiating a task, a user could assign it to a pre-configured team of agents.
- Configuration: A user could define a
frontend-teamconsisting of areact-developeragent, acss-stylistagent, and acypress-testeragent. - Invocation:
claude --team=frontend-team "Build a new settings page with these form fields." - The team would then autonomously coordinate using the messaging bus and shared state to complete the task.
Describe alternatives you've considered
I am aware of and have used the following workarounds, which highlights the need for a native solution:
- Manual User Orchestration: As described above, the user acts as the communication bus. This is slow, error-prone, and doesn't scale.
- File-Based Mailboxes: Having agents write status updates or messages to a shared
communication.mdfile. This is clunky, requires agents to constantly poll the file, and is subject to race conditions.
- Git Worktrees: This is the best current solution for preventing destructive interference in parallel work. It provides isolation. However, it does not enable collaboration. The agents remain unaware of each other.
- Claude Code SDK: It is technically possible to build a custom orchestration script using the SDK that manages multiple agent processes and pipes I/O between them. This is extremely powerful but requires the user to become an expert in building agentic systems, which defeats the purpose of having a seamless, out-of-the-box tool. The proposed feature is about bringing this advanced capability into the core product for all users.
Additional context
Implementing this feature would be a transformative step for Claude Code, evolving it from a world-class "AI pair programmer" into a true "AI software development team in a box." It would unlock the ability to tackle much larger, more complex, and long-running tasks with a higher degree of autonomy.
Imagine being able to give Claude Code a JIRA epic and have a team of agents autonomously design the architecture, divide the work, implement features in parallel, test each other's code, and finally merge a complete, working feature branch. This is the future of agentic software development, and direct agent communication is the foundational technology required to get there.
Thank you for considering this. Your work on subagents has already laid an amazing foundation, and I believe this is the logical and most impactful next step.
9 Comments
Found 3 possible duplicate issues:
If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
Would love this as well 💯👍
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
+10000
Alternative Approach: Temporal Coordination via Shared Context Files
This is a thoughtful proposal. The use cases you describe—dev-test-fix cycles, parallel work interference—are real pain points I've encountered extensively.
I've been working on an approach that addresses these without requiring new messaging primitives. The key insight:
---
Mental Model Comparison
---
Proposed:
.claude/Directory StandardMapping to Your Proposal
---
Your Use Cases, Solved
Use Case 1: Dev-Test-Fix Cycle
The Problem:
The Solution:
Result:
No user orchestration required. Agents coordinate through the file.
---
Use Case 2: Destructive Interference
The Problem:
The Solution:
Result:
---
What This Enables Beyond Your Proposal
Cross-Session Learning
Each agent inherits everything previous agents learned. The "team" gets smarter over time without any orchestration layer.
---
Verification Checkpoints (SAIF Pattern)
Your proposal has agents messaging each other without verification. This model requires checkpoints before phase transitions.
---
Audit Trail
Sample Log Entries:
Full transparency on what each agent did and why.
---
Comparison Table
| Aspect | Real-time Messaging | Temporal Coordination |
|--------|--------------------|-----------------------|
| Agents must run simultaneously | ✅ Required | ❌ Not required |
| Infrastructure needed | Message bus, shared memory | Filesystem only |
| Race conditions | Possible | Impossible (sequential) |
| State persistence | Lost on termination | Persists indefinitely |
| Knowledge accumulation | Per-session only | Across all sessions |
| Verification gates | Not built-in | Native (SAIF pattern) |
| Audit trail | Requires additional infra | Native (logs/) |
| Complexity | High (orchestration layer) | Low (read/write files) |
---
Integration with Devcontainers
Context loads automatically on container start. Saves automatically before shutdown. Reloads on branch changes so agents don't carry stale assumptions.
---
Shell Aliases for Zero Friction
---
Summary
Your proposal identifies real problems. This approach solves them with:
Happy to discuss implementation details or share the full specification.
---
This approach is already working in production workflows.
+1000
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
I think the newly released https://code.claude.com/docs/en/agent-teams may be close to the original idea.
Nevertheless, this issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.