You're already using Claude Code, and a single session is starting to strain. Say you're adding a billing feature: one change touches the API, the database migration, the tests and the docs. By the time the session reaches the tests, its context is crowded with everything that came before, and quality drifts.
The obvious fix is a lead agent that plans the work and hands each piece to a specialist. This article goes beyond the quick answer by walking through the setup step by step, then comparing the main options side by side: subagents, parallel sessions, agent teams and prebuilt packs. You'll see where each one fits, what it costs you in complexity, and how to choose before you build.
What users report
Users describe two broad approaches: a lead agent that plans and delegates to specialist sub-agents, or a single agent kept on a tight task. The evidence here is limited to a handful of posts, so treat it as anecdotal rather than a verdict.
What users report working
- One Reddit builder shared a project for multi-agent orchestration for Claude Code using only
.claude/configuration, which suggests a setup can live in config files rather than extra tooling. - Another user on r/ClaudeAI said they got tired of one Claude session running out of context partway through serious work, so they made Claude Code the main orchestrator. Their post, Set up multi-agent orchestration with Claude Code as the boss, also asks whether the design is overcomplicated.
Questions users raise
- Users on r/AI_Agents note that many agent tools now ship a multi-agent mode, with a planner that splits a task and hands pieces to worker agents. The thread, Do you actually use multi-agent orchestration, or is a single agent enough, asks whether that extra layer is worth it in practice.
Practical takeaways
- Start with one lead agent and a small number of specialists.
- Keep the setup simple enough that you can tell when it is overcomplicated.
- Compare against a single-agent run before committing to more structure.
What does multi-agent orchestration in Claude Code actually mean?
It means one agent plans the work and hands defined pieces to specialist agents, which execute them and report back. This is the planner-executor (central orchestrator) pattern: the lead decides what needs doing and in what order, and the specialists do the focused work.
If you are new to the building block, start with what a Claude Code agent is. In this pattern, each specialist is a subagent with its own context window, its own instructions and its own tool access. A reviewer can be limited to read-only tools, while an implementer can edit files and run commands.
When one agent is enough
A single agent usually handles small, well-bounded tasks: a bug fix in one module, a short refactor, a script. Splitting that work adds coordination overhead without much benefit.
When it stops being enough
- Context overload: a long session fills the context window with exploration, logs and half-finished ideas, and the agent loses track of earlier decisions.
- Mixed skill sets: one set of instructions cannot serve research, implementation, testing and review equally well.
- Different permissions: some steps should not have write access.
Three terms that get confused
- Subagents: specialists the lead delegates to inside one session, each with a separate context and a summary returned to the lead.
- Parallel sessions: independent Claude Code sessions running side by side, with no lead coordinating them.
- Agent teams: several agents that work together and coordinate with each other on a shared goal, rather than only reporting to one lead.
How do I set up multi-agent orchestration in Claude Code step by step?
Define a few specialist subagents as files in .claude/agents, tell a lead agent to plan first and delegate each piece by name, give every specialist one narrow job with a checkable output, then run a small task and read the plan before approving it. The four steps below follow that order.
Step 1: Create specialist subagent files
Each specialist is a Markdown file in .claude/agents with YAML frontmatter. Give it a name, a clear description, a limited set of tools and a model. If you want a walkthrough of the file format, you can create a Claude Code subagent by following that guide.
Here is a sample file, .claude/agents/test-writer.md:
---
name: test-writer
description: Writes unit tests for a specified module. Use proactively after code changes in src/ need test coverage.
tools: Read, Grep, Glob, Write
model: sonnet
---
You write unit tests for one module at a time.
Return: the test file path, a list of cases covered, and any behavior you could not test.
Do not modify source files.
The tools line keeps the specialist from doing more than its job. Omit it and the subagent inherits the available tools.
Step 2: Write the lead instruction
Put a short rule in CLAUDE.md so the main session acts as the lead:
## Orchestration
For any task touching more than one file, first write a numbered plan.
Assign each step to a named subagent (test-writer, code-reviewer, etc.).
Wait for each result, check it against the expected output, then continue.
Do not do specialist work yourself.
Step 3: Give each specialist one narrow job
A specialist works best when its description makes the job and the expected result clear:
- One job: "reviews diffs for security issues," not "reviews and fixes code."
- A defined return format: file paths, a pass/fail list, or a short summary.
- Explicit limits: what the specialist must not touch.
The description field matters because Claude uses it to decide when to delegate automatically. A vague description means the specialist is rarely picked; a specific one with phrases like "use proactively" makes routing more reliable. You can also name a subagent directly in your prompt.
Step 4: Run a small task and read the plan
Begin with a small task before relying on delegation for larger work. Read the lead's plan before approving it: check that each step names the right specialist, that no step overlaps another, and that outputs are things you can verify. Adjust descriptions or the CLAUDE.md rule if delegation goes to the wrong place.
How agent teams are enabled
Claude Code subagents work out of the box. Agent teams, where teammates coordinate with each other, are experimental and off by default: you turn them on by setting CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to 1 in your environment or in the env block of settings.json, and they need an interactive session.
For how delegation works in detail, see the official Claude Code subagents documentation.
Which orchestration option should I choose?
Choose the simplest option that fits the task: a single agent for small jobs, subagents with a lead for work that splits into distinct roles, parallel sessions for large independent workstreams, and a prebuilt specialist pack when you want a team without writing definitions yourself.
The table compares the four options on the criteria that usually decide the choice.
| Option | Setup effort | How work is split | Best for | Not for |
|---|---|---|---|---|
| Single agent | None | One agent handles everything in one context | Small fixes, quick questions, short tasks | Long tasks where context fills up or roles clash |
| Claude Code subagents with a lead | Moderate: you write each subagent definition and the lead's instructions | The lead plans, then delegates pieces to specialists, each in its own context | Features that span review, tests, and implementation | Teams that don't want to maintain prompts and tool permissions |
| Parallel sessions | Higher: you manage several sessions and keep their changes from colliding | Separate sessions work on separate parts at the same time | Large, independent workstreams, such as different modules | Tightly coupled changes where pieces depend on each other |
| Prebuilt specialist pack | Low: a one-line install adds the team, nothing else changes | A lead hands pieces to ready-made specialists | Developers who want delegation without authoring definitions | People who need roles shaped around an unusual workflow |
How to read the table
Start with a single agent. Move to a lead with subagents when you notice one agent juggling planning, coding, and review in a single crowded context.
Parallel sessions add speed but also coordination work, so use them only when the pieces truly don't overlap. If you would rather not write definitions from scratch, a prebuilt pack is a shortcut, and a roundup of the best subagents for Claude Code can help you compare what exists.
When you review the best claude code subagents, check that each role has a narrow job and limited tool access. Narrow roles keep the lead's delegation predictable.
What should the lead agent delegate, and what should it keep?
The lead agent should delegate bounded tasks whose output can be checked, and keep every decision that affects the whole project. A good test: if a specialist could finish the task without knowing the rest of the codebase, delegate it. If getting it wrong would change the shape of the project, the lead keeps it.
Delegate:
- Writing or running tests for a defined piece of code
- Code review of a specific diff or file set
- Research, such as reading a library's docs or surveying how existing code handles a problem
- Building a single module against a clear interface
Keep with the lead:
- Architecture and design choices that span modules
- Deciding task order and dependencies
- Merging results and resolving conflicts between specialists
- Final judgment on whether the work meets the goal
Write the plan down
Have the lead write the plan to a shared to-do or planning file, such as a PLAN.md in the repository. Specialists read it for their assignment and update their status, so nothing depends on one conversation's memory. A simple template works:
| Task | Owner | Inputs | Done-when | Status |
|---|---|---|---|---|
| Add validation module | specialist-1 | spec in docs, existing schema file | Unit tests pass, no changes outside /validation | in progress |
| Write tests for validation | specialist-2 | validation interface | Tests cover valid and invalid input and run green | not started |
| Review the diff | reviewer | final diff | Issues listed, none blocking | not started |
The "done-when" column matters most, because it makes each task checkable.
Avoid overlapping edits
Do not let two specialists edit the same files at the same time. Their changes can overwrite or conflict with each other, and the lead then spends effort untangling them. Assign each specialist its own files or directory, and list those boundaries in the plan file.
How do I run Claude Code agents in parallel?
Start several Claude Code sessions or subagents at the same time, but only on tasks that do not depend on each other and do not touch the same files. Independent work runs side by side; dependent work waits its turn.
When parallel helps
Parallel runs fit tasks with separate inputs and outputs. Typical examples:
- A code review running alongside a test-writing pass
- Documentation updates while a separate module is refactored
- Research or codebase exploration in one agent while another implements a small, well-defined change
The lead agent can split the plan into these independent pieces, hand each to a specialist, and then merge the results.
How to do it safely
Two agents writing to the same files in one working directory can overwrite each other's changes or leave the code in a broken state.
- Give each agent its own git worktree or branch, so every agent works on an isolated copy of the repository. A subagent file can set
isolation: worktreeto get a temporary worktree automatically. - Assign clear file or directory boundaries in each agent's instructions.
- Have the lead agent review and merge each branch one at a time, running tests after each merge.
When to stay sequential
Use a sequential flow when one step needs the output of another. For example, an agent should finish a schema change before another agent writes code that relies on it. Running them in parallel would mean the second agent works from assumptions that may be wrong.
For exact commands and current options, check the official Claude Code worktrees documentation.
How do I connect tools and keep multi-agent runs under control?
Give each specialist only the tools and MCP servers its job requires, measure token use before adding more agents, and add an explicit review step. Control comes from narrow scope, visible cost and a check on the output.
Scope tools per specialist
Each specialist should get only the tools its role calls for. In Claude Code, a subagent's file can list the tools it may use, so set that list deliberately instead of inheriting everything. Fewer tools also means fewer wrong choices and a smaller attack surface if a prompt goes astray.
The free Subagent Generator is one way to do this: you pick a role, tools and model, and download a valid .claude/agents file.
Measure cost before you scale
Every subagent runs in its own context, so more agents means more tokens. Run one workflow with two or three agents first, then measure subagent token use before you add more. Match models to tasks: lighter models for routine lookups, stronger ones for planning and review.
Common failures
- Vague descriptions. The lead agent routes work by each specialist's description. "Helps with code" gives it nothing to route on.
- Overlapping roles. Two agents that both "review and refactor" will collide or duplicate effort. Give each one a distinct job.
- No review step. Add a reviewer or a human checkpoint so the output gets checked before you rely on it.
Validate before you run
A malformed MCP entry usually shows up as a server that silently fails to load. Paste your setup into the MCP config validator first. It is one of the free tools, needs no signup, and nothing leaves your browser.
Catching a typo in a config takes seconds. Catching it after a long multi-agent run costs tokens and time.
Can I use ready-made Claude Code agents instead of building my own?
Yes. Ready-made claude code agents are a reasonable shortcut if your goal is to get a lead-and-specialists setup running quickly.
Building your own means writing a prompt, tool list and scope for every specialist, then testing how the lead agent hands work to each one. That is manageable for two or three agents. It gets slow when you want a full team.
Agentsforce is one option in this category. Here is what it offers:
- Tech Lead: plans big jobs and hands each part to the right specialist.
- 55 ready-made specialists and 89 playbooks.
- $49, one-time payment.
- One-line install command. You keep using Claude Code as you do today.
If you only need a single subagent, there is also a free Subagent Generator for building your own subagent file.
Who it is not for: people who want full custom control of every prompt.
Related articles
Frequently asked questions
Can a Claude Code subagent call another subagent?
Yes. By default a subagent can start its own subagents, up to three layers below the main conversation, and you can stop one from doing so by leaving Agent out of its tools list. For most projects a flat structure is still easier to follow: one lead and several specialists that each report back to it. The lead plans the work, hands each piece to the right specialist and combines the results.
How many specialist agents do I need to start?
Start with a small number of specialists whose jobs are clearly different. Add another only after you see a repeated task that the existing agents handle badly. Extra agents with overlapping roles tend to make the lead's routing choices harder.
How do I use multi-agents and orchestrated agents in Claude Code if I am not an expert?
Tell the lead to write its plan before touching anything. Then run one check: confirm the lead printed a plan before any file was changed. If it did, you have the core loop working and can add a second specialist.
Do I need a framework or UI to orchestrate Claude Code agents?
No, for most teams. Plain agent files plus a clear lead instruction are enough to plan, delegate and review work from the terminal. A framework or UI starts to matter when you need runs outside the terminal, scheduling, or logs that many people can read. Until then, extra tooling adds setup without solving a problem you have.