· 6 min read
Claude Code orchestration: how to run multiple Claude Code agents without losing track
What Claude Code orchestration means today: subagents, agent view, agent teams, dynamic workflows and projects. Where it breaks, above all work reported done that isn't, and how to run it with every result checked, on your own Claude plan.
Claude Code orchestration means splitting a job into pieces, giving each piece its own Claude Code session and merging the results. Claude Code has five ways to do it: subagents, agent view, agent teams, dynamic workflows and projects. The hard part is the seams between the workers, and above all knowing that a piece reported as done really is.
What does orchestration mean in Claude Code?
Orchestration is everything around the work itself: how the job is split, which agent takes which piece, what context each one gets, and how the pieces come back together. Claude Code gives you five building blocks.
- Subagents. Workers that one session spawns. Each gets its own context window, does a side task, and returns a summary to the session that started it.
- Agent view. One screen, opened with
claude agents, to dispatch background sessions and see which ones need you. It is a research preview. - Agent teams. A lead session plans and assigns, teammates execute and message each other over a shared task list. Experimental, and off by default.
- Dynamic workflows. A script that runs many subagents and cross-checks their findings, for work too big for one turn.
- Projects. One ongoing conversation at claude.ai/code or in the desktop app that starts parallel sessions in the cloud. In public beta on Pro and Max.
They differ on two questions: who splits the work (you, Claude or a script), and where it runs (your laptop, or a machine that stays on). Most people start with parallel sessions, add subagents for research and review, and hit the limits of both once more than three or four things are in flight.
How do I set up subagents in Claude Code?
A subagent is a markdown file in .claude/agents/ (one project) or ~/.claude/agents/ (all your projects). The frontmatter names it, says when to use it, and limits its tools:
---
name: test-writer
description: Writes and runs unit tests for one module. Use after a feature is implemented.
tools: Read, Grep, Glob, Edit, Bash
---
You write focused unit tests and run them.
Report: files changed, tests added, what still fails.
Three habits make subagents worth having:
- Narrow descriptions. Claude delegates by matching the task against the
description, so a vague one gets ignored or misused. - Restricted tools. A reviewer that cannot edit files cannot quietly "fix" the code it was asked to judge.
- A fixed report format. The subagent starts with a fresh context, and its final summary is all the parent sees. Ask for changed files, open questions and anything it could not verify.
Subagents are the cheapest form of orchestration because everything stays inside one session. That is also their limit: they live and die with that session.
How do I run Claude Code sessions in parallel with git worktrees?
When two tasks touch the same repo, give each one its own checkout. Claude Code can create it for you:
claude --worktree feature-auth
claude --worktree fix-billing-webhook
Each command starts an isolated session on its own branch, so the edits never collide. Plain git worktree add ../app-auth -b feature-auth works too if you prefer to manage paths yourself.
Habits that keep this sane:
- One task per worktree, one branch per task, one pull request per branch.
- Copy what a fresh checkout lacks (
.env, local config) before starting. A.worktreeincludefile does this automatically. - Put the task brief in the first prompt: goal, files in scope, how to verify, where to write the result.
- Merge through pull requests, so you read every branch before it lands.
The trade-off is that you are now the orchestrator. You write every prompt, remember which session owns which branch, and answer every permission prompt across all of them. Agent view puts the background sessions on one screen, which helps with tracking. You still write each prompt and answer each question. That is fine for three sessions. At eight, the coordination becomes the job.
How do I get a lead agent to split the work?
If you would rather have Claude do the splitting, give one session the manager role and keep it out of the code. A prompt that works:
You are the lead. Do not edit code yourself.
1. Read docs/spec.md and break it into tasks small enough to finish in one session.
2. For each task write: goal, files it owns, inputs, definition of done.
3. No two tasks may own the same file.
4. Hand each task to a worker, then wait until every worker has reported.
5. Check each result against its definition of done. Report what is done, what failed, and what needs me.
Agent teams (enabled with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) give this pattern a shared task list and direct messages between teammates. Anthropic's docs suggest starting with 3 to 5 teammates and splitting the work so each one owns different files, because teammates are not isolated in worktrees. The lead has failure modes of its own; how Claude manages other agents covers prompting and reviewing a lead in detail.
Where does Claude Code orchestration break?
The work itself is rarely the problem. The seams between agents are.
- Done that isn't done. A worker's summary is all the lead sees, and a summary can say "done" when the tests never ran. Anthropic's own docs for scheduled runs put it plainly: a green status means the session exited without an infrastructure error, and "does not mean the work your prompt describes succeeded".
- Context handoff. A worker starts with what you put in its brief and nothing else. Every decision the lead made in conversation and never wrote down is gone.
- Ownership. Two agents edit the same file, or a task still says "in progress" long after its worker stopped. Nobody, including you, can say who owns what.
- Approvals. Permission prompts from every worker land on you, and while you are away the work waits. In headless runs, anything that would prompt is denied, so the run ends with part of the job skipped.
- Keeping sessions alive. A session in a terminal ends with that terminal or that machine. Overnight work needs a computer that stays on.
- Usage limits. Parallel sessions multiply token use, so a plan's limit arrives sooner, and it tends to arrive mid-task.
The first one is the expensive one, because it is silent: nothing errors, and you find out when someone asks where the work went.
How do I fix handoffs, ownership and approvals by hand?
You can get most of the way with files and discipline:
- Write every handoff to a file. One brief per task in a
tasks/folder, with goal, context, constraints, definition of done and where the output goes. Workers read the brief, and the lead never relies on memory. - Make ownership explicit. Each brief names its owner and the files it may touch. Workers update their own brief's status and nothing else.
- Pre-approve the safe actions. Allow reads, tests and edits inside the repo in your settings, so the prompts that remain are the ones that matter: deploys, deletes, anything public.
- Batch decisions. Tell workers to collect questions in a "needs you" section of their brief and keep going on everything else.
- Run long work on a machine that stays on. A small cloud server works, with
claude setup-tokenfor a long-lived login. - Have something other than the worker check the result. A reviewer subagent with read-only tools, run against the brief's definition of done. A summary that says "done" is a claim. A passing test run is evidence.
You can build all of this yourself, one script at a time. Its weak spot is that you still have to run it, every night, for every job.
How does Kavela orchestrate Claude Code agents?
Kavela is that setup, already built. You tell Kav, the lead agent, the job in plain words. Kav plans it, files each piece as a task, puts the right agent on each part and builds one when none fits. Every task sits on one calendar, so you can see what is scheduled, running, waiting on you and done.
Every result is checked before it reaches you. A second agent that didn't do the work checks each run against your goal and your checklist. Work that falls short goes back with the exact gap, and after three tries you're told what's missing. A checklist line that fails twice is raised with you, and each version of a workflow keeps its own pass rate, so you can see whether a change made it better or worse.
It runs on the Claude plan you already pay for. Each agent runs the unmodified Claude Code on your own Claude plan, signed in by you, in its own cloud computer with a shell, files, git and a browser. It keeps working when your laptop is closed. When your plan reaches its limit, the run waits on one card: wait for the reset and carry on, or finish on Kavela credits.
Anything that needs you, a sign-in, a choice or a deploy, waits in one Approvals inbox. Everything else runs, and each task ends with its deliverables attached.
Kavela starts with a 14-day free trial, no card. Start your free trial