Multi-agent orchestration is the software layer that coordinates tasks, messages, and execution state across agents. When Claude Code and Codex work on the same project, that layer needs to track who owns each task, who is waiting for an answer, and what should happen after an interruption. Its usefulness grows when work requires repeated communication, handoffs, or recovery.
In How to Build a Multi-Agent Orchestrator from Scratch, engineer Erwin examines T3 Code and Orca through four concerns: capability exposure, communication, state and fault tolerance, and context handoffs. This is a useful way to turn the visible experience of several agents working together into mechanisms that can be designed and inspected individually.
This article follows one development task through those mechanisms, adding qualifications from official documentation and source code. For installation, interfaces, and remote operation, see our existing guides to T3 Code and Orca.
Separate the execution environment from the coordination layer
An agent harness is the execution environment around a model. It assembles requests, exposes tools such as file access and a terminal, processes tool results, and continues the execution loop. Claude Code and Codex provide these capabilities. A harness can also support multiple models and subagents.
Cross-harness orchestration manages another set of relationships. Claude Code and Codex each maintain their own sessions, tools, and runtime state. A coordinating application uses their supported interfaces to start work, collect events, handle approvals, and pass relevant information between them.
flowchart TD
U["User: build and verify login"] --> O["Orchestration: tasks, messages, state, handoffs"]
O --> C["Claude Code harness"]
O --> X["Codex harness"]
C --> CT["Model, tools, session"]
X --> XT["Model, tools, session"]
classDef user fill:#fef3c7,stroke:#b45309,color:#78350f;
classDef orchestration fill:#e0e7ff,stroke:#6366f1,color:#312e81;
classDef harness fill:#dbeafe,stroke:#2563eb,color:#172554;
classDef runtime fill:#dcfce7,stroke:#16a34a,color:#14532d;
class U user;
class O orchestration;
class C,X harness;
class CT,XT runtime;
These are responsibility boundaries. A product can combine a harness with orchestration features, or offer both unified chat and native terminals. Inspecting which layer owns tasks and state is more informative than treating a product name as a permanent architectural category.
A coordinator agent is a participant that breaks down work, assigns responsibilities, and collects results. The orchestration layer is the software supplying dispatch, messaging, and state management. A person or model can decide how to split work; the software records those decisions and carries out the associated communication and scheduling.
Agents need an interface for collaboration
Consider a login feature. One agent handles the form and error messages, another implements the backend, and a coordinator agent assigns work and gathers verification results. Halfway through, the frontend agent needs to know which fields the API returns.
It needs a way to address the backend agent, send a question, and receive the reply. The runtime must supply these actions and explain them through tool definitions or instructions.
Erwin contrasts two interfaces:
| Interface | How the model uses it | Design concerns |
|---|---|---|
| MCP | The host discovers tools through the Model Context Protocol and exposes available actions to the model | Parameters, discovery, errors, and the host’s execution behavior |
| CLI + Skill | The model reads an operating guide and runs orchestration commands in a terminal | Version accuracy, shell quoting, flags, and parseable output |
Both can expose task delegation and messaging. Structured tools make required fields and types explicit; CLIs fit naturally into shell, Git, and text-processing workflows. The execution layer must still validate arguments, recipients, and permissions.
The original article makes MCP’s context cost and composition limits sound too universal. The MCP tools specification defines discovery and invocation messages. It does not require every definition to enter model context upfront, nor does it guarantee strict argument generation in every host.
Implementations already offer other choices. Claude Code tool search supports loading MCP definitions on demand. Anthropic’s code execution with MCP describes composing calls and filtering intermediate results in code. Compare concrete hosts when choosing an interface: neither mandatory upfront loading nor an inability to compose calls follows from MCP itself.
Organizing bounded tasks and continuing conversations
Request and return work well for bounded subtasks
A request such as “check this login form for accessibility issues” has a clear output. The coordinator can launch a worker, retain a handle, and collect its report while doing other work.
Erwin calls this an RPC execution tree. RPC means remote procedure call; the analogy here concerns request-and-return organization, and the worker can run locally. The structure keeps ownership clear. Repeated clarification introduces more coordination work: if frontend and backend agents must route every question through their parent, that parent processes more messages and context.
A request-and-return design can also add questions, resumption, and follow-up messages. Current T3 Code source includes a delegated-task question reactor that brings child questions to the parent thread. The article’s two models are best read as design emphases rather than permanent limits on either product.
Persistent identities and inboxes support continuing exchanges
In the mailbox design, each agent has an addressable identity. Messages enter an inbox managed by the orchestration layer and are delivered according to the recipient’s state. This resembles the Actor model: participants manage their own state and communicate through messages.
The login example might proceed as follows:
---
config:
sequence:
width: 85
actorMargin: 20
diagramMarginX: 5
actorFontSize: 16
messageFontSize: 16
wrap: true
---
sequenceDiagram
participant F as Frontend
participant O as Mailbox
participant B as Backend
F->>O: Ask for fields
O->>O: Queue message
O-->>B: Deliver question
B->>O: Reply with fields
O-->>F: Deliver reply
For example, the backend could confirm that a successful response contains userId and expiresAt. The frontend can then handle user information and expiration using that agreement.
The agents communicate directly at the logical level; the orchestration layer still routes the exchange. A busy recipient may receive the question in a later input. The sender may suspend or continue unrelated work. Exact delivery and wake-up behavior depends on the implementation.
Orca’s orchestration documentation separately models Runs, Tasks, Dispatches, Messages, and decision gates, while its source persists messages and deliveries. This allows questions, replies, and task progress to be tracked separately. It also creates implementation work: deduplication, acknowledgement, restart recovery, and handling recipients that have already finished.
Our Hermes Kanban analysis explores persistent task boards and work passing through several stages. A task board records progress; an inbox carries communication. They can support the same workflow.
Recovery depends on distinguishing tasks from attempts
Messaging alone leaves crashes, timeouts, and retries unresolved. Two patterns in Erwin’s article address different parts of that lifecycle.
An outbox persists execution intent alongside state
Suppose the application marks the backend task as running, then crashes before starting its process. After restart, the record says work is underway, but no worker exists.
A transactional outbox commits the task-state change and a pending execution record in one database transaction. A background executor then claims that record, performs the action, and updates its status. T3 Code’s current EffectOutbox implements persistent pending effects.
After a crash, the system can find committed execution intent that still needs handling. The transaction covers database records; process creation and external service calls happen outside it.
If the executor starts a process and crashes before recording success, a retry can repeat that action. The outbox pattern therefore also calls for idempotent handling: stable identifiers let a receiver recognize a repeated operation and avoid producing the same business effect twice.
Dispatch identity determines which attempt can complete a task
A separate failure occurs when worker A times out, worker B takes over, and A later returns a result.
Two identities help:
- Task: the work to complete, such as implementing the login API.
- Dispatch: one specific attempt assigned to a worker.
| Event | Current ownership | Result handling |
|---|---|---|
| Initial assignment | Task T, Dispatch D1 | D1 can report while its authority remains valid |
| Reassignment after failure | Task T, new Dispatch D2 | Completion authority moves to D2 |
| Old worker returns | Its report still belongs to D1 | Treat it as an expired attempt rather than the current result |
Orca documents Task and Dispatch IDs on completion and heartbeat messages, with authority derived from the active dispatch context. This governs which report the orchestration system accepts. If an old process can still write shared files, databases, or external APIs, controlling those writes also requires process termination, workspace isolation, or identity checks at the write boundary.
This is why Git worktrees complement task-state management. Worktrees separate checked-out files and branches; dispatch identities distinguish execution attempts. Shared databases, ports, and external accounts still require their own environment controls.
Model switching hands over records and progress
Imagine using Codex for implementation in turns one through three, Claude Code for review in turns four and five, and Codex again for turn six.
One continuous interface hides at least three kinds of information:
| Information | Contents | Purpose during a handoff |
|---|---|---|
| Application history | Requests, replies, tasks, activity | Explain what happened across the whole task |
| Native harness sessions | Session identifiers, tool results, processed context | Continue each agent’s own work |
| Provider prompt cache | Reusable computation for input prefixes | Reduce repeated processing when cache conditions are met |
Erwin describes the first two as AppThread and ProviderThread. The application retains the overall history, while each harness retains a session and synchronization position. When the original Codex session is recoverable, the application can supply the missing review turns before continuing.
T3 Code’s current ContextHandoffService includes both delta handoffs and full-thread summaries, with a budget for historical content. Session availability, history length, and delivery state determine which strategy is appropriate.
Session continuity and cache hits are separate questions. Anthropic’s prompt caching documentation, for example, defines reuse in terms of input prefixes and cache lifetime. Restoring a session helps preserve its history; cache reuse still depends on the service and request. A new session identifier alone also does not establish that every cached prefix becomes unusable.
For development, the immediate requirement is a usable handoff: the goal, agreed API fields, changed files, test results, and remaining work. The next agent should know that expiresAt is settled, which test failed, and what to change next. Repository state can change during a handoff, so relevant files and the current diff still need inspection.
Decide based on communication and recovery needs
The useful method in Erwin’s article is to make collaboration inspectable: trace one question, one retry, and one context transfer. These traces also help evaluate tools.
A bounded review, lookup, or modification is often easy to organize through delegation. Persistent identities, messaging, and durable state become more useful when workers repeatedly clarify requirements, work spans stages, or a person must make an intermediate decision. Switching execution between harnesses adds native-session recovery and history transfer to the evaluation.
My recommendation is to begin with one small task and inspect three outcomes: whether a worker can ask a follow-up question; whether an interruption leaves distinguishable pending, running, and review states; and whether another agent can perform the next step from the handoff record. Increasing parallelism after those checks makes the benefits and missing mechanisms easier to assess.
For product choices, continue with our Orca, T3 Code, and Herdr comparison. For file isolation and merging, read the Git worktree guide. Those operational choices work alongside the messaging, state, and session mechanisms explained here.
This is an independently organized analysis of Erwin’s article with checks against official documentation and source code, rather than a paragraph-by-paragraph translation. Sources were checked on December 2, 2026, and code links pin the inspected revision. The login workflow is illustrative; no same-task product benchmark or fault-injection test was performed. Orca’s orchestration documentation remains marked Experimental, so installed-version behavior needs confirmation.
Sources:
- How to Build a Multi-Agent Orchestrator from Scratch (Erwin, November 30, 2026)
- Tools (Model Context Protocol, June 18, 2025 specification)
- Scale with MCP tool search (Anthropic, checked December 2, 2026)
- Code execution with MCP: Building more efficient agents (Anthropic, November 4, 2025)
- Orchestration (Orca, checked December 2, 2026)
- Orchestration database table definitions (Orca, checked December 2, 2026)
- DelegatedTaskQuestionReactor (T3 Code, checked December 2, 2026)
- EffectOutbox (T3 Code, checked December 2, 2026)
- Pattern: Transactional outbox (Chris Richardson, checked December 2, 2026)
- ContextHandoffService (T3 Code, checked December 2, 2026)
- Prompt caching (Anthropic, checked December 2, 2026)
Author: Cyber Herald
Original URL: https://torchtree.com/en/post/multi-agent-orchestration-explained/
Publish Date: 2026-12-02
License: CC BY-NC-SA 4.0