[FEATURE] Distributed Agent Teams: coordinate Claude Code instances across machines (peer over LAN)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Today Claude Code can coordinate multiple agents only on the SAME machine (Agent Teams,
via a local mailbox at ~/.claude/teams/). "Remote Control" only lets you control ONE
session from another device; it does not let two independent instances collaborate. In
real deployments we have several machines on the same network with different capabilities
(one with GPU/large RAM for heavy models, another holding the data or the project
context), and we need one Claude instance to delegate tasks to another, see its status/
progress, and keep working in parallel, while the second reports progress and results.
Proposed Solution
Introduce Distributed Agent Teams.
Each Claude Code instance can optionally become a network peer.
Peers discover each other on the LAN (or by explicit address) and share:
task queue
mailbox
status
progress
artifacts
approvals
Conceptually, this extends the current file-based mailbox into a network transport.
Instead of
~/.claude/teams/
the mailbox abstraction becomes transport-independent.
Possible implementations:
shared filesystem (SMB/NFS)
local TCP service
mDNS discovery
WebSocket
gRPC
The existing Agent Team architecture remains unchanged.
Only the transport layer changes.
Alternative Solutions
Extend "Agent Teams" to work ACROSS MACHINES (same account / same LAN): a shared mailbox
and task list over the network, so Claude Code instances on different servers can:
- Delegate tasks to each other.
- Query each other's status/progress.
- Review the work/results the other produces.
- Work in parallel, each on its own machine.
With per-peer security controls (approval before accepting/sending cross-machine tasks;
the hinted "isolatePeerMachines" setting seems aimed at this).
POSSIBLE NAMES:
- Primary: "Distributed Agent Teams" (or "Networked Agent Teams" / "Cross-Machine Agent Teams")
- Sub-concepts: "Peer Messaging", "Peer Discovery", "Team Mailbox (networked)",
security control "isolatePeerMachines".
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
- Document pipeline (our real case): 2,000 scanned union records to split into 7 docs
each and upload to a government system. One machine does vision-based classification;
another (32 GB) runs a heavy local OCR model (Chandra, 5B params) that doesn't fit on
the first. Coordinating them is manual today.
- Hardware split: a GPU box runs inference/training; a non-GPU box that holds the repo
and context orchestrates, reviews, and commits.
- Data isolation: sensitive data lives on a server that can't reach the internet; a
local instance there processes it and returns only results to the coordinating
instance, so raw data never leaves that machine.
- Parallel builds/tests: one instance kicks off the test suite/build on a powerful
machine and keeps coding on its own while watching status.
- Long-running without blocking: multi-hour jobs (bulk OCR, migrations, ETL) run on a
"worker" on another machine; the main instance stays unblocked and reviews as it goes.
- Reviewer + executor ("GitHub across servers"): one instance applies changes in a
staging environment; the other reviews output/logs and approves or requests fixes.
- Multi-site teams: two people, each with their own Claude on their machine, share a
distributed team to collaborate on one project with common context and tasks.
- Failover / continuity: if one machine dies or hits its usage limit, a peer instance
picks up the pending task queue from the shared mailbox.
Additional Context
BENEFIT:
Scales Claude Code from "one agent per machine" to "a mesh of agents that split work by
hardware, data, and availability", with security and without external infrastructure
(works on LAN/on-prem, important for regulated data).
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
The cross-machine coordination gap is real and hits a different class of problem than same-machine agent teams. A few patterns people use today to approximate it:
None of these have the latency or reliability of a native LAN peer protocol. The GPU/large-RAM use case you describe -- one machine for heavy lifting, another holding the data -- is a natural fit that the current architecture can't serve cleanly.
One design question worth raising in this issue: should the peer protocol be point-to-point (machine A talks to machine B directly) or mediated (a coordinator machine routes messages to peers)? The mediated model is easier to implement and debug but adds a single point of failure. The point-to-point model is harder to implement but maps better to the "different machines with different capabilities" framing.
Disclosure: I'm building Claudeverse, which addresses some of the fleet visibility and coordination gaps around multi-session Claude Code. This issue is at the edge of that scope (cross-machine is beyond what we handle today) but worth tracking.
Distributed Agent Teams — Complete Architecture Proposal
Making the Agent Teams mailbox transport-independent, with a transactional task lifecycle, recovery, and Zero-Trust security
---
1. Executive summary
Today Agent Teams coordinate multiple agents on the same machine via a local mailbox
(
~/.claude/teams/). Real deployments run several machines on the same LAN with differentcapabilities (GPU / large-RAM nodes, data-holding nodes, orchestration nodes). We need one
instance to delegate work to another machine, monitor it, and keep working — while the peer
executes and reports back.
This document proposes:
Review → Settle → Receipt) with unique id and explicit owner.
(time sync, versioning, fair scheduling) that make it production-grade.
Everything reuses the existing Agent Teams coordination logic; only the transport changes.
---
2. The pluggable transport (the core idea)
The programming model never changes. Whether tickets travel by paper rail, a printer, or a
screen, the kitchen works the same way.
LocalMailboxTransportstays the default;distributed transports are opt-in.
---
3. Kitchen analogy legend (the explanatory thread)
| Kitchen role | System component |
|---|---|
| Host / Maître d' | Admission + peer identity |
| Head chef / Expediter (the "pass") | Coordinator control plane (leader) |
| Stations / Cooks | Workers, each with a specialty (GPU, OCR, vision) |
| The runner / messenger | The transport carrying the ticket |
| The ticket / comanda | The task, with its lifecycle |
| Kitchen Display System (KDS) | Central observability dashboard |
| The pantry | Shared data store (network drive) |
| The closed check / POS receipt | Settlement record |
| Sentinels / kitchen cameras | Runtime monitors + anomaly detection |
---
3.1 Diagrams
Deployment overview
Task lifecycle (7 stages + retry / reject / dead-letter)
4. The 7-stage task lifecycle
Each task has a unique id and an explicit owner, and moves through:
quote → approve → execute → progress → review → settle → receipt(orerror).4.1 Quote
model, or has no GPU → the task is rejected, queued forever, or crashes the node. No time
estimate, no capacity reservation.
flight) and its capability card; the coordinator requests a quote; the worker replies
accept + ETA or decline with reason, and a slot is reserved.
before promising the customer. "Yes, 20 min" or "86'd, out of that."
4.2 Approve
could inject or steal work, or a task is double-dispatched.
availability, and binds the task to a single worker.
cook. Only badged staff enter the kitchen.
4.3 Execute
(duplication, waste, conflicting results). If nobody grabs it → abandoned.
in-progress with
owner=hostand takes a lease with expiry. It must send an ACKand change state. An idempotency key prevents a redelivery from re-executing.
it in progress. The label on plate+cook is a DHCP-style lease: it expires, renews, or
is released.
key.
4.4 Progress
the worker is alive. If the cook collapses mid-cook, the plate never comes out and the
customer waits forever (lost work).
persistent board (never the dying agent's local memory) + lease renewal. If the
heartbeat stops, the lease expires and a watchdog reassigns the task to the
least-loaded worker. A checkpoint** (checklist) on the shared board lets the replacement
resume from where it stopped, not from zero.
reassign. The progress is written on the shared whiteboard, like a ride-share app keeps
the trip state on its server, not on the driver's phone.
checkpoint** for resumability.
4.5 Review
not reach the customer.
validates (schema, tests, content). Reject → back to the queue.
"re-fire!".
4.6 Settle
atomically. The dish isn't done until it reaches the table, the ticket is closed, and the
station is freed. A half-delivered result (network cut mid-copy) must not exist.
one atomic commit flips it to official. One dish = one cook + ACK; a reconciler
continuously enforces "1 ticket = 1 owner". Winner rule: the result from the current
valid lease holder wins; results from an expired lease are discarded. The worker
releases the ticket (like a DHCP release) and becomes free. On delivery failure
(ride-share analogy) the driver/passenger notify and the order is re-dispatched.
leaves the rail, the station is freed, the check is closed.
resolution; resource release.
4.7 Receipt
who did what, recover from a crash, or avoid re-doing completed work.
approvals). The receipt is the LAST step and is the "closed" marker: no receipt =
order still open = safe to retry; receipt exists = do not redo (dedup).
twice.
---
5. Robustness layers (R1–R8)
| # | Layer | Problem | Solution (kitchen + tech) |
|---|---|---|---|
| R1 | Crash recovery | A cook dies mid-cook; work is lost | Shared-persisted checkpoint + watchdog reassigns; resume from the checklist, not from zero |
| R2 | Routing + backpressure | Overloading a station; sending a dish nobody can make | The guard/gateway routes by load and enforces queue limits |
| R3 | Idempotency / exactly-once | A reprinted ticket cooked twice | Receipt-based dedup (if a receipt for #123 exists, don't redo) |
| R4 | Dependencies / ordering | "OCR before classify"; courses out of order; incomplete assembly | Checklist per dish; coursing by estimated duration (fire-timing: start the 20-min dish later so both plate hot together); fan-out (split a complex dish, each cook owns a subtask and confirms); shared prep (a sauce station, reusable + cacheable). Cycles: the head chef rejects circular recipes (A→B→A) at admission (acyclic graph). Fan-in: "assemble" waits for all N receipts (barrier). Cascade on failure: dependents are held; use a backup / plan B-C (a cached sauce with a prior receipt) or remake within the retry limit; if it hits dead-letter, cancel downstream and the customer decides keep-partial or cancel |
| Capability card | Skills routing | A cook doing the wrong cuisine | Cook taxonomy (Italian cook ↔ Italian dish, Thai ↔ Thai); affinity (same dish → same cook); shared roles (sauce makers) |
| R5 | Deep security (Zero Trust / Palo Alto) | An authenticated cook can still do harm | 1 Least privilege: the sauce cook reaches only his fridge/station; permissions only toward his destination; master→node model (a node only does what the master assigns); sentinels watch movement at runtime — off-route → alert/evict (RBAC + policy enforcement + egress control, "verify at every hop"). 2 Data locality: the secret recipe is encrypted + access-controlled + masked; not copyable; held in custody by the head chef (with a vetted successor / break-glass); every plate is labeled and follows only an authorized route (DLP). 3 Encryption in transit: the plate/ticket travels covered (encrypted + signed), on an authorized route; mutual authentication blocks man-in-the-middle. 4 Microsegmentation + default-deny: the kitchen is closed/segmented (the public dining room may be open); zones are subnets/VLANs + security groups; doors use vision/fingerprint (biometrics) that allow or deny by the cook's role in that zone (default-deny); sentinels monitor entrances (no one is trapped; lateral movement is detected). 5 Impostor/anomaly: entry via id + password + MFA; the master chef knows every cook; content is validated by the inspector (Review). 5b Behavior (UEBA): if a chef makes a strange recipe, the sentinel checks who and their pattern (baseline + anomaly detection) |
| R6 | Observability (KDS) | The head chef is blind to the whole service | A central Kitchen Display: dish states, completed, available runners (transport), available cooks (capacity), same dish ordered 2+ times (duplicate/idempotency visibility), and KPIs to quantify effort (throughput, per-stage times, per-cook load, rejections). Camera-like sentinels watch state + actions and alert the head chef on anomalies (tied to R5 UEBA). End-to-end trace per order (Quote→Receipt) via state history + receipts |
| R7 | Poison / retries + pre-validation | A dish that always burns; bad input propagated | Failure taxonomy: oven (infra) fails → reschedule the same dish on another oven/node (failover; doesn't count against the poison limit); sauce/data fails → regenerate the artifact (don't propagate bad data). Validate BEFORE / during: each step validates its inputs + resource first (check the sauce before saucing; check the oven before baking) = preconditions/guards; Review validates AFTER, this validates BEFORE; on in-flight failure, redo what's possible and return to the last good state (checkpoint). Retries: max 3 (configurable) with exponential backoff (1→5→15 min). Per-dish timeout/SLA. Dead-letter ("86 corner") with an owner + full traceability (reason, who, attempts, times); labeled 🔴 poison (always fails, fix recipe/data) vs 🟡 not completed (timeout/resources, retryable). Notify the user; for complex dishes, give guidance BEFORE starting |
| R8 | Single expediter (anti split-brain) | Two head chefs calling the same rail = chaos | Leader election (Kubernetes/OpenShift/Spark style): several candidate chefs, but one leads (active) and announces it; others on standby. Leadership is a renewable lease (same as Execute); if the leader dies, re-election hands the baton to a standby. Anti split-brain: majority quorum — only the side with >50% of chefs can elect/keep a leader; the minority stops (no rogue cooking). Odd number of masters (3 or 5) |
---
6. Completeness extras
| # | Extra | Problem | Solution |
|---|---|---|---|
| E1 | Synchronized clocks | Leases/timers (Execute lease, R7 backoff, R8 baton) depend on the clock; drift expires them wrong | NTP on all kitchens; sentinels validate every clock shows the same time |
| E2 | Single recipe edition (versioning) | One cook uses the old recipe book, another the new → the "same" dish differs | Identical recipes/manuals for everyone; the head chef validates recipes; if a cook improvises / uses another version, UEBA detects different elements = version drift/tampering |
| E3 | Quota + fair priority (scheduler) | One big table monopolizes the kitchen and exhausts resources (this happened to us: we exhausted our usage quota) | Rule 0: if they don't compete for the same station → run both in parallel (calamari at the sauce station, fries at the fryer); fire-timing (R4) starts the slow one early. If they compete for the same scarce resource: weighted priority = shortest-job-first (SJF) + impact (people waiting) + aging (the complex dish gains priority the longer it waits — no starvation) + value/SLA (VIP/premium). Per-table quota: nobody hogs the kitchen. = Fair/Capacity Scheduler, YARN/K8s/Spark style |
---
7. Data model (draft)
id,type,required_capabilities[],prerequisites[],state (quote/approve/execute/progress/review/settle/receipt/error),owner,lease_expires_at,checklist[],estimated_min,attempts,deadline.id,owner,inputs_hash,artifacts[],timestamps,approvals,outcome.host,ip,fingerprint (SHA256),capabilities[],approved.---
8. Why this fits Agent Teams (backward compatible)
Agent Teams already provide the task queue, mailbox, coordination, and ownership. This
proposal only replaces the transport layer and adds the lifecycle/robustness semantics
around it. The local filesystem stays the default implementation; distributed transports
(shared folder, LAN, SSH, A2A, cloud) become optional. A2A is not a competitor — it is one
possible transport implementation, giving interoperability with external agents while
preserving the Agent Teams programming model.
The value is not two Claude instances talking. It is cooperative execution across
heterogeneous machines while preserving security, explicit approvals, deterministic task
ownership, recoverability, and compatibility with the existing Agent Teams model.
---
9. Technology mapping (for technical grounding)
| Concept in this design | Established technology |
|---|---|
| Pluggable transport | Message-transport abstraction; A2A as one transport |
| Lease on Execute / leadership | Distributed lease/lock; etcd/ZooKeeper leases |
| Watchdog + reassignment | Kubernetes controller reconcile loops |
| Leader election + quorum (R8) | Kubernetes/OpenShift control plane, Spark HA, Raft/Paxos |
| Idempotency via receipt | Exactly-once processing; dedup keys |
| Settle all-or-nothing | ACID transactions / parquet-style staged commit |
| Zero-Trust security (R5) | Palo Alto: least privilege, microsegmentation, App-ID, Threat Prevention, default-deny; RBAC, mTLS, DLP, data masking, MFA, UEBA |
| Fair scheduling (E3) | YARN/Kubernetes/Spark Fair & Capacity Schedulers; SJF + aging |
| Clock sync (E1) | NTP |
| Versioning (E2) | Artifact/version pinning |
---
_End of proposal._
VOLY implements this with A2A federation — network-based agent coordination, not file-based mailbox.
A central orchestrator decomposes a task into roles (architect, developer, tester, reviewer, devops) and dispatches them to remote agent workers via Cloudflare Workers + service bindings. Each worker runs an independent claude-code executor on its own machine. Results are collected back and merged into a single report.
Transport: HTTP + async callbacks, so agents can be on separate machines with different capabilities (GPU, RAM, project context).
https://github.com/voly-codes/voly/blob/main/docs/backend/a2a.md#a2a-federation
Are you mixing claude-code with other agents (cursor, codex) or coordinating same-model instances?