# AI agent orchestrators: how they work and which to use for coding

An AI agent orchestrator decides which agent does which piece of work, gives each one its instructions, and combines what comes back. For coding, the orchestrator is either the lead session of a coding agent, such as Claude Code or Codex delegating to subagents, or a platform that runs many agents in separate environments for a team. This guide explains both and when to use each.

- Canonical: https://replicas.dev/resources/ai-agent-orchestrators
- Start a free trial: https://app.replicas.dev/auth?mode=signup
- How to orchestrate coding agents: https://replicas.dev/resources/how-to-orchestrate-coding-agents

## What is an AI agent orchestrator?

An agent orchestrator is the agent or system that coordinates other agents. It breaks a goal into tasks, starts a worker for each task with a focused prompt, keeps the workers from getting in each other's way, and decides what happens with the results: combine them, verify them, retry, or ask a person.

Frameworks such as LangGraph, CrewAI, and the OpenAI Agents SDK let developers build an orchestrator into their own product. This guide covers orchestrators for coding agents, which come in two forms. Checked October 7, 2026 against vendor documentation. Replicas publishes this guide and is one of the platforms below.

- **An orchestrator agent:** A coding agent session that plans and delegates. The main Claude Code or Codex session spawns subagents, each with its own context window, and merges their findings into one answer.
- **An orchestrator platform:** Software that takes tasks from a queue, prepares an environment for each one, runs a coding agent in it, and routes the result back for review. The orchestration happens across sessions and machines rather than inside one conversation.

## The orchestrator-worker pattern

Almost every orchestrator follows the same loop. What changes between products is where the workers run and how isolated they are.

- **Plan:** Split the goal into subtasks that can proceed without waiting on each other.
- **Dispatch:** Start a worker per subtask with its own prompt, tools, and model.
- **Isolate:** Give each worker its own context window and, for code, its own checkout or machine so edits do not collide.
- **Collect and verify:** Bring results back, run tests, and review the changes with something other than the worker that made them.
- **Decide:** Merge, retry, reassign, or hand the decision to a person.

- Every worker is a separate model session, so orchestration uses more tokens than one agent doing the same work.
- Parallel workers only help when subtasks are independent. Sequential steps and edits to the same files are usually faster in a single session.

## Claude Code as an orchestrator

The main Claude Code session is an orchestrator. It delegates to subagents, each running in its own context window and returning a summary, so exploration and logs stay out of the main conversation. Claude Code ships with Explore, Plan, and general-purpose subagents, and you can define your own as Markdown files with YAML frontmatter in .claude/agents/ for a project or ~/.claude/agents/ for yourself.

By default up to 20 subagents run at once and they can nest three levels deep. Adding isolation: worktree to a subagent's frontmatter gives it a temporary git worktree, so parallel edits do not touch the same files. The /batch command uses this to fan one change out to many worktree subagents that each open a pull request.

Agent teams, which are experimental, take this further. With CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS set to 1, the lead session spawns teammates that are full Claude Code instances, share a task list, and message each other directly.

|  | Subagents | Agent teams |
| --- | --- | --- |
| Who coordinates | The main session manages all work | Teammates self-coordinate through messages and a shared task list |
| Communication | Results return to the caller | Teammates message each other directly |
| Token cost | Lower: results are summarized back | Higher: each teammate is a separate Claude instance |
| Best for | Focused tasks where only the result matters | Work that benefits from discussion, such as competing debugging hypotheses |

### Example: a reviewer subagent

Source: https://code.claude.com/docs/en/sub-agents

Save a file at .claude/agents/code-reviewer.md with name: code-reviewer, a description that says when to use it, tools: Read, Glob, Grep, and model: sonnet in the frontmatter, then the reviewer's instructions below it. Claude delegates to it when a task matches the description, or you can invoke it directly by asking for the code-reviewer subagent.

## Codex as an orchestrator

Codex also runs subagent workflows, enabled by default in current releases. It delegates when you ask, or when AGENTS.md or a skill tells it to, then spawns agents in parallel and collects their results into one response. That suits codebase exploration and multi-step feature plans. For example, ask it to "spawn one agent per point" or "delegate this work in parallel".

Codex ships with default, worker, and explorer agents. Custom agents are TOML files with a name, a description, and developer_instructions, stored in ~/.codex/agents/ or a project's .codex/agents/, and can set their own model and sandbox mode. Subagents inherit the current sandbox policy and approval settings, and each one uses its own tokens.

## Orchestrator platforms for coding teams

When the work is a team backlog rather than one conversation, the orchestrator moves into a platform. These differ in which agents they run, where those agents run, and what starts the work. The agent orchestration platforms guide compares nine of them in detail.

| Platform | Agents it orchestrates | Where workers run | What starts the work |
| --- | --- | --- | --- |
| Replicas | Claude Code, Codex, Cursor, OpenCode, and other supported agents | One Linux VM per task | Slack, Linear, GitHub, GitLab, schedules, webhooks, CI failures, API |
| Claude Code | Claude Code, its subagents, and agent teams | Your machine or Anthropic-hosted cloud sessions | Terminal, web, mobile, and routines |
| Codex | Codex and its subagents | Your machine or OpenAI-managed containers in Codex cloud | App, CLI, IDE, chatgpt.com/codex, GitHub, GitLab, Linear, Slack |
| Cursor Cloud Agents | Cursor Agent | Isolated VMs | Editor, web, mobile, Slack, GitHub, Linear, API |
| GitHub Copilot cloud agent | Copilot | GitHub Actions environments | GitHub issues and pull requests |
| Devin | Devin, with MultiDevin for parallel agents | Managed Devin sessions | Devin app, Slack, Linear, GitHub |
| Factory | Droids, including multi-agent Missions | Local machines or managed Droid Computers | CLI, desktop, web, Slack, Jira, Linear, CI |

## Which orchestrator do you need?

Pick the lightest orchestrator that covers the work. Most teams end up using more than one: a platform hands out tasks, and the agent inside each task still delegates to its own subagents.

- **One task with research or review on the side:** Subagents in Claude Code or Codex. No setup beyond an optional agent definition.
- **One problem that benefits from debate:** Claude Code agent teams, such as several teammates testing competing hypotheses for a bug.
- **A few independent tasks you steer yourself:** Separate sessions in git worktrees on your own machine.
- **Tasks you want off your laptop, with one vendor:** That vendor's cloud: Claude Code cloud sessions, Codex cloud, or Cursor Cloud Agents.
- **A team backlog across agents and tools:** An orchestrator platform such as Replicas, where tasks start from Slack, Linear, GitHub, or a schedule and each runs the agent you choose.

## FAQ

### What is an orchestrator agent?
An orchestrator agent is a lead agent that splits a task into subtasks, delegates them to worker agents, and combines their results. In coding, the main Claude Code or Codex session acts as the orchestrator when it spawns subagents.

### What is the difference between an orchestrator and orchestration?
Orchestration is the process of coordinating agents: routing work, isolating it, and reviewing results. The orchestrator is the component that does it, either a lead agent inside a session or a platform that runs agents across many environments.

### Is Claude Code an orchestrator?
Yes. Claude Code delegates to subagents within a session, can isolate them in git worktrees, and with experimental agent teams coordinates several Claude Code instances that share a task list. It orchestrates Claude Code only.

### Can one orchestrator run Claude Code and Codex together?
Provider-native orchestrators run their own agent. Replicas runs Claude Code, Codex, Cursor, and OpenCode in the same workspaces and lets you pick per task, and OpenHands can connect ACP-compatible agents such as Claude Code and Codex.

## Use Replicas as the orchestrator for your team's agents

Replicas includes a 14-day free trial with no credit card required. Connect a repository, define the environment once, and assign tasks from the dashboard, Slack, Linear, or GitHub. Each task runs in its own Linux VM with Claude Code, Codex, Cursor, or OpenCode, and comes back as a pull request your team can review.

## Related docs

- [How to orchestrate coding agents](https://replicas.dev/resources/how-to-orchestrate-coding-agents): Five ways to run several agents, from subagents to cloud VMs, with setup steps.
- [Agent orchestration platforms](https://replicas.dev/resources/agent-orchestration): Patterns and nine orchestration platforms compared.
- [Multi-agent orchestration for coding agents](https://replicas.dev/resources/multi-agent-orchestration-for-coding-agents): Queues, isolation, review, and merge strategy for a fleet of agents.
- [Claude Code subagents](https://code.claude.com/docs/en/sub-agents): Anthropic's reference for subagent definitions, delegation, and limits.
- [Claude Code agent teams](https://code.claude.com/docs/en/agent-teams): Anthropic's reference for experimental agent teams.
- [Codex subagents](https://learn.chatgpt.com/docs/agent-configuration/subagents): OpenAI's reference for built-in and custom Codex agents.
