Run Multiple Claude Code Agents in Parallel
Six ways to run Claude Code agents in parallel: worktrees, subagents, agent view, agent teams, workflows and cloud sessions, plus how Codex multi-agent works.

To run multiple Claude Code agents in parallel, start several sessions yourself, each in its own git worktree, or use one of the five built-in options in Anthropic's Run agents in parallel guide: subagents, agent view, agent teams, dynamic workflows and projects. They range from you dispatching each task to Claude coordinating the workers. Worktrees keep parallel edits apart, and every extra agent adds to your usage. Below: how to set up each Claude multi-agent option, when to pick it, and how Codex multi-agent compares.
This guide is written by the Super Agent team. Super Agent is built on the Super-Agent design DeepSeek published, so we have a stake in the topic. We are not affiliated with Anthropic or OpenAI; product details below come from their documentation, checked December 4, 2026.
Key Takeaways
For sessions you drive yourself, start each one with
claude --worktree <name>so it edits its own checkout on its own branch.Subagents handle side tasks inside one session and return a summary. By default, at least 20 can run at once.
Agent view (
claude agents, a research preview) dispatches background sessions, moves each into its own worktree before it edits, and shows which ones need you.Agent teams and dynamic workflows let Claude coordinate the workers. Cloud sessions keep running after you close your laptop.
Parallel agents multiply usage: Anthropic says ten background agents use quota roughly ten times as fast as one.
Which Claude Code multi-agent option should you use?
Choose by who coordinates the work, whether the workers need to talk to each other, and whether they edit the same files. Those are the three questions in Anthropic's choose an approach checklist. Here is how the options line up:
| Option | Who coordinates | Workers talk to each other? | Own checkout? | Good fit |
|---|---|---|---|---|
| Sessions in worktrees | You | Via cross-session messaging | Yes, one worktree each | A few tasks you want to steer yourself |
| Subagents | Claude, inside one session | No, they report to the session | With isolation: worktree | A side task that would flood your main conversation |
| Agent view (research preview) | You dispatch each task | Results go to you | Yes, automatic before edits | Independent tasks you hand off and check later |
| Agent teams (experimental) | A lead session | Yes, directly | No, split files by hand | A project Claude splits up and keeps in sync |
| Dynamic workflows | A script Claude writes | Script passes results | — | Codebase-wide audits, large migrations, cross-checked research |
| Cloud sessions and Projects | You, or Claude in a project | — | Separate cloud session | Work that should keep going with your laptop closed |
1. Run several sessions in git worktrees
Give each session its own git worktree so parallel edits don't collide. A worktree is a separate checkout with its own files and branch that shares the repository's history. Pass --worktree (or -w) with a name, once per terminal:
# terminal 1
claude --worktree feature-auth
# terminal 2
claude --worktree bugfix-login
Claude Code creates each worktree under .claude/worktrees/<name>/ on a new branch named worktree-<name>. Three setup details from the docs:
- Add
.claude/worktrees/to.gitignoreso worktree contents don't show up as untracked files in your main checkout. - A worktree is a fresh checkout. Install dependencies there, and list gitignored files such as
.envin a.worktreeincludefile so they're copied into every new worktree. - When you exit, Claude asks before removing a worktree that has work in it; a clean worktree from an unnamed session is removed automatically.
To manage checkouts yourself, run git worktree add ../project-feature-a -b feature-a, then cd into it and start claude. In the desktop app, open more sessions with + New (Cmd+N on macOS, Ctrl+N on Windows) and turn on Worktree before each one starts (desktop docs).
Sessions you run yourself can still share news: with cross-session messaging (Claude Code v2.1.224 or later on macOS and Linux, v2.1.234 on native Windows), Claude can tell your other sessions what landed, including sessions on another machine or in the cloud.
2. Use subagents for side tasks in one session
Subagents are workers Claude spawns inside your current session. Each runs in its own context window and returns only a summary, which keeps search results and logs out of your main conversation (subagents docs). Ask for them in plain language:
Research the authentication, database, and API modules in parallel using separate subagents
Subagents that Claude spawns from your main conversation (except web-fetch) start in the background by default, so you can keep working. At least 20 can run at once in a session, and CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS (Claude Code v2.1.217 or later) changes that limit. If subagents will edit files, add isolation: worktree to a custom subagent's frontmatter, or ask Claude to "use worktrees for your agents."
Each subagent spends its own tokens, and the docs warn that many detailed results coming back "can consume significant context." For one large change, the /batch skill packages this pattern. It splits the work into 5 to 30 units and shows you a plan. Once you approve, it runs one background subagent per unit in its own worktree, and each one opens a PR or reports what happened.
3. Dispatch background sessions with agent view
Agent view is the closest built-in match to several Claude Code agents, each on its own task. Run claude agents, type a task and press Enter, and a background session starts on it. Every prompt you enter starts another session (agent view docs). It is a research preview, so the interface may change.
You can also dispatch straight from your shell:
claude --bg --name "flaky-test-fix" "investigate the flaky SettingsChangeDetector test"
Claude prints the session's short ID, and claude attach, claude logs and claude stop take that ID to open, read or stop it. Inside a session you already have open, /bg sends it to the background.
Isolation is what makes this practical for parallel coding. Before a dispatched session edits files, Claude moves it into its own worktree under .claude/worktrees/. When it has made changes, it commits, pushes the branch if the repository has a remote, and never pushes to main or master, force-pushes or merges. If your task or CLAUDE.md says you handle git yourself, it leaves git to you. Each session ends with a report of what it did and where the work is.
Two limits: background sessions run on your machine and stop if it shuts down, and deleting a session in agent view deletes its Claude-created worktree, so commit first.
4. Let a lead session coordinate an agent team
Agent teams put one lead session in charge of several teammates that share a task list and message each other. They are experimental and off by default; enable them with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 (agent teams docs). Teammates aren't isolated in worktrees, so give each one its own files. Anthropic suggests starting with 3–5 teammates, and its costs page says teams use approximately 7x more tokens than standard sessions when teammates run in plan mode. For setup, display modes and limits, see agent teams in Claude explained.
5. Run large fan-outs with dynamic workflows
A dynamic workflow is a JavaScript script Claude writes to run many subagents and cross-check their results while your session stays responsive (workflows docs). Include the keyword ultracode in a prompt, or ask Claude to "use a workflow":
ultracode: audit every API endpoint under src/routes/ for missing auth checks
Workflows suit jobs that outgrow a handful of subagents, such as a codebase-wide audit or a 500-file migration. A run uses up to 16 concurrent agents by default (fewer when Claude Code has fewer CPUs available), is capped at 1,000 agent() calls, and can't take input from you mid-run. Workflows are available on all paid plans; on Pro, turn them on from the Dynamic workflows row in /config. Try the bundled /deep-research workflow to watch one run.
6. Send tasks to the cloud
Cloud sessions run on Anthropic's infrastructure and keep going after you close your laptop. Each claude --cloud command starts its own independent session, so you can launch several at once (cloud docs):
claude --cloud "Fix the flaky test in auth.spec.ts"
claude --cloud "Update the API documentation"
The cloud VM clones your GitHub remote at your current branch, so push local commits first. Cloud sessions are available on Pro, Max, Ultra and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. They count toward your plan's usage limits, with no separate charge for the VM. Projects go further: one ongoing conversation where Claude starts a thread for each task and runs the threads in parallel, in the cloud or on your computer through Remote Control. Projects are in public beta and still rolling out on Pro, Max and Ultra. If the work has to stay on your own computer and you only want to check it from your phone, Claude Code Remote Control is the built-in route.
Script parallel runs with headless mode
Headless mode isn't a separate coordination style; it's a scripted version of option 1. claude -p runs Claude Code non-interactively, for scripts and CI (headless docs). Add --worktree and each run gets its own checkout; -p runs skip the workspace trust check. A shell loop is enough:
for m in auth billing search; do
claude --worktree "fix-$m" -p "Fix the failing tests in the $m module" \
--allowedTools "Read,Edit,Bash" > "fix-$m.log" 2>&1 &
done
wait
Two catches: Claude doesn't clean up worktrees from -p runs, so remove them with git worktree remove, and agent teams don't spawn in -p mode.
What about Codex multi-agent?
Codex has its own multi-agent feature, called subagents. OpenAI's subagents docs say current Codex releases enable subagent workflows by default, with activity shown in the ChatGPT desktop app, the Codex CLI and the IDE extension. Codex spawns subagents when you ask directly, or when AGENTS.md or skill instructions request it, then collects their results into one response. OpenAI's example prompt:
Review this branch with parallel subagents. Spawn one subagent for security risks, one for test gaps, and one for maintainability. Wait for all three, then summarize the findings by category with file references.
What else the docs cover:
- Codex ships three built-in agents:
default,worker(implementation and fixes) andexplorer(read-heavy codebase exploration). Add your own as TOML files in~/.codex/agents/or.codex/agents/. - In the CLI,
/subagentsswitches between running agent threads.agents.max_concurrent_threads_per_sessioninconfig.tomlcaps how many spawned threads run at once, not counting the main thread. - Subagents inherit the sandbox and approval settings in effect for the parent turn, and a custom agent file can't override them. They also use more tokens than a comparable single-agent run.
- OpenAI suggests starting with read-heavy work (exploration, tests, triage, summarization) and taking more care with parallel edits, which "can create conflicts."
For separate Codex chats on one repository, the desktop app's Worktree option gives each chat its own git worktree. In Codex Cloud, each task has its own workspace and keeps working while your computer sleeps. To reach a running Codex session from another device, see our Codex remote control guide.
Tips to keep parallel agents out of each other's way
- One task and one checkout per agent. Use worktrees for sessions you start yourself; agent view and
/batchset them up for you. Agent teams need the files split by hand. - Budget for usage. Anthropic's agent view docs say ten background sessions use quota "roughly ten times as fast" as one, and cloud sessions share your rate limits.
- Know where to check status.
claude agentslists background sessions,/taskslists background work in the current session, and/workflowslists workflow runs.
Running agents across several computers
Every Claude Code option above runs Claude sessions. Anthropic's overview says: "In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an MCP server." If you want one place that hands work to Claude Code and Codex workers on several of your own computers, that is the router and worker design we describe in what is a super agent.
Super Agent is how we built that. Each of your computers runs the Super Agent desktop app, and each bot pairs one computer with an AI worker (Claude Code or Codex) and a project folder. Each request becomes a task, follow-ups go into the same task, and the result comes back to you. Edits and commands that need permission wait for you to allow or reject them from any device. On Pro ($14.90/month), an assistant hands each request to the right bot and reports back.
Frequently Asked Questions
How many Claude Code agents can run at the same time?
It depends on the method. A session can run at least 20 subagents at once by default, and a dynamic workflow runs up to 16 agents concurrently by default. Agent teams have no hard limit, but Anthropic suggests 3–5 teammates. In practice, your usage quota is the ceiling.
Does running multiple Claude Code agents cost more?
Yes. Each agent sends its own requests against the same usage limits. Anthropic's agent view docs say ten background agents use quota roughly ten times as fast as one, and its costs page says agent teams use approximately 7x more tokens than a standard session when teammates run in plan mode.
Is there a Claude multi-agent option for the API?
Yes. Outside Claude Code, Claude Managed Agents has multiagent orchestration, currently in beta. One agent hands work to subagents or dynamic workflows, and agents can act in parallel with their own isolated context.
Conclusion
The quickest way to run multiple Claude Code agents is claude --worktree <name> in a few terminals. Use agent view when you'd rather hand tasks off and check back. Let subagents, an agent team or a dynamic workflow take work Claude can split itself, and send tasks to the cloud when they should outlive your laptop. Whichever you pick, give each agent its own task and its own files or checkout, and watch your quota. If your agents live on more than one computer, try Super Agent free and manage their Claude Code and Codex bots from one browser workspace.