All resources
Guide/8 min read

How to orchestrate coding agents: 5 ways, from subagents to cloud VMs

Published October 7, 2026

Summary

There are five practical ways to get several coding agents working at once: subagents inside one session, Claude Code agent teams, parallel sessions in git worktrees, a provider's cloud such as Codex cloud, and an orchestration platform. This guide shows how to set up each one and when it is the right choice.

Overview

Five ways to orchestrate coding agents

The options differ in where the agents run and how isolated they are from each other. Isolation decides how many agents you can run before they start overwriting files, fighting over ports, or overwhelming your review queue. Checked October 7, 2026 against vendor documentation. Replicas publishes this guide and is one of the options.

WayWhere agents runIsolationBest for
SubagentsInside one Claude Code or Codex sessionOwn context window; optional worktreeResearch, review, and side tasks inside one job
Agent teamsSeveral Claude Code instances on one machineOwn context windows and a shared task listProblems that benefit from teammates debating or owning separate pieces
Git worktreesSeveral sessions on your machineA separate checkout and branch per sessionA few independent tasks you steer yourself
Provider cloudA vendor-managed VM or container per taskA separate machine per taskHanding off tasks to one vendor's agent
Orchestration platformA managed VM per task, across agentsA separate machine and environment per taskTeam backlogs started from team tools, with a choice of agent

Way 1

Subagents: delegate inside one session

Subagents are the lightest form of orchestration. The main session hands a focused task to a helper with its own context window, and only the result comes back, so searches and logs do not fill the main conversation.

Subagents in Claude Code

Ask for it in plain language, for example "use subagents to investigate how auth and billing each handle sessions". To make a reusable worker, save a Markdown file in .claude/agents/ with name, description, tools, and model in the frontmatter and the instructions below it. Claude delegates to it when a task matches the description, or when you ask for it by name.

Add isolation: worktree to the frontmatter for workers that edit code, so each one gets a temporary worktree instead of sharing your checkout.

  • By default, up to 20 subagents run at once and they can nest three levels deep.
  • Every subagent request counts toward your usage limits.

Subagents in Codex

Current Codex releases enable subagents by default. Prompt with "spawn one agent per point" or "delegate this work in parallel", and Codex collects the results into one response. Built-in agents are default, worker, and explorer; custom agents are TOML files in .codex/agents/ with a name, description, and developer_instructions. Subagents inherit your sandbox and approval settings.

Way 2

Agent teams: let Claude Code coordinate teammates

Agent teams are an experimental Claude Code feature. Set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your environment or in the env block of settings.json, then describe the team you want, for example "spawn three teammates to review PR 142: one for security, one for performance, one for test coverage".

The lead session creates a shared task list, teammates claim tasks and message each other directly, and the lead combines the findings. Teammates run inside your terminal by default; set teammateMode to tmux to give each one its own pane.

  • Start with three to five teammates and give each one its own files, since two teammates editing the same file overwrite each other.
  • Teammates do not inherit the lead's conversation, so put the context they need in the spawn prompt.
  • Known limits: /resume does not restore in-process teammates, a session has one team, teammates cannot start their own teams, and token use grows with every teammate.

Way 3

Git worktrees and tmux: run parallel sessions yourself

A git worktree is a second working directory with its own branch that shares the repository's history. Running each agent session in its own worktree means one session can build a feature while another fixes a bug without touching the same files. This works with any agent: Claude Code, Codex, OpenCode, Cline, or a mix.

Claude Code creates worktrees for you. Run claude --worktree feature-auth to start a session in .claude/worktrees/feature-auth on a new branch named worktree-feature-auth, then run it again with another name in a second terminal. Add .claude/worktrees/ to .gitignore, and list files such as .env in a .worktreeinclude file so they are copied into each new worktree.

For other agents, create the worktree with git: git worktree add ../app-feature-a -b feature-a. Then start the agent there in a detached tmux session, for example tmux new-session -d -s feature-a -c ../app-feature-a codex, and attach with tmux attach -t feature-a when you want to check in.

  • Worktrees isolate files, not runtimes. Two dev servers on the same port, a shared local database, or two test suites competing for CPU still collide.
  • Each worktree is a fresh checkout, so it needs its own dependency install.
  • Your machine has to stay on, and you review and merge every branch yourself. Remove finished worktrees with git worktree remove.

Way 4

Provider clouds: hand tasks to one vendor's machines

Each major coding agent now has a hosted mode that runs every task on its own machine and returns a branch or pull request. You can start several at once and close your laptop. Each runs only its own agent, with its own environment settings and task list.

Claude Code cloud sessions

Each claude --cloud "task" command, or each task started at claude.ai/code, runs in its own Anthropic-managed VM, so several commands in a row run in parallel. Sessions need a GitHub repository and count toward your Claude plan's limits. Agent teams can be turned on in a cloud environment's variables.

Codex cloud

Codex cloud runs each task in an OpenAI-managed container built from an environment you configure once, with a setup script and internet access off by default while the agent works. Tasks start from chatgpt.com/codex, the IDE, the CLI, GitHub, GitLab, Linear, or Slack.

Cursor Cloud Agents and GitHub Copilot

Cursor Cloud Agents run in isolated VMs and start from the editor, web, mobile, Slack, GitHub, Linear, or an API. GitHub Copilot's cloud agent takes assigned issues and works in GitHub Actions environments. Both return a branch and pull request.

Way 5

An orchestration platform: one queue for every agent

A platform takes over the parts you would otherwise script yourself: the queue, the environment, the trigger, and the review loop. Replicas runs each task in its own Linux VM prepared from an environment your team defines once, and lets you pick Claude Code, Codex, Cursor, OpenCode, or another supported agent per task. Tasks start from Slack, Linear, GitHub, GitLab, schedules, webhooks, failed CI runs, or the API.

Because every task has its own machine, runtimes do not collide: each agent can start services, run the full test suite, and use a desktop browser. Reviewers can watch a session, take over, comment on the diff, and have the agent continue in the same workspace. Devin and Factory also orchestrate at this level, each around its own agent. The agent orchestration platforms guide compares them in detail.

Decision guide

Which way should you start with?

Start with the lightest option that covers the work, and move up when isolation, triggers, or review start to hurt. The options combine: an agent running in a Replicas workspace or a cloud session can still delegate to its own subagents.

You need research or a second opinion inside one task
Subagents.
One hard problem would benefit from several perspectives
Agent teams, starting with research or review rather than parallel edits.
You are running two to four tasks yourself today
Worktrees, one terminal or tmux session per task.
You want work to continue with your laptop closed
A provider cloud, if your team uses one agent and one code host.
Your team wants agents working its backlog
An orchestration platform, so tasks start from team tools, run in consistent environments, and arrive as pull requests everyone can review.

Before you scale up

Problems that show up with parallel agents

These appear whichever way you orchestrate. Plan for them before adding more agents.

Merge conflicts
Split work by module or file ownership, and keep each task to one pull request.
Review capacity
More agents produce more pull requests. Measure how many your reviewers can handle before adding agents.
Shared resources
Ports, local databases, and caches collide on one machine. Separate machines per task remove the problem.
Cost
Every subagent, teammate, and parallel session uses its own tokens. Check usage after the first few runs.
Missing context
Workers do not see the lead's conversation. Put file paths, constraints, and acceptance checks in each task prompt.

FAQ

Orchestrating coding agents: common questions

Getting started with Replicas

Orchestrate your team's agents without building the platform

Replicas includes a 14-day free trial with no credit card required. Connect a repository, define the environment once, and assign a few independent tickets from the dashboard, Slack, or Linear. Each task runs in its own Linux VM with the agent you pick and comes back as a pull request.