How to Run Multiple Claude Code Agents in Parallel
How to run multiple Claude Code agents in parallel in 2026: local git worktrees and background sessions, subagents and /batch, headless scripts that leave a reviewable git diff, Claude Code on the web, and unattended cloud runs on an orchestration platform.
To run multiple Claude Code agents in parallel, give each one its own copy of the code (a git worktree locally, or a VM in the cloud) and its own session, then review each agent's work as a separate branch and pull request. Everything else is a question of where the sessions run and who watches them. Locally, worktrees and background sessions get you a handful of agents on one machine. Claude Code on the web moves each session to an Anthropic-managed VM that keeps running after you close your laptop. For a fleet of agents that run unattended and keep working after the PR opens, you add an orchestration platform.
This guide walks through each option using Anthropic's Claude Code documentation, from the simplest local setup to unattended cloud runs. For the vendor-neutral version, see how to run coding agents in parallel in the cloud.
What are the ways to run multiple Claude Code agents at once?
There are three tiers: parallel sessions on your own machine, parallel sessions in Anthropic's cloud, and unattended agents managed by an orchestration platform. Within a single session, Claude Code can also fan work out to subagents.
| Approach | Where it runs | Isolation | Best for |
|---|---|---|---|
Worktree sessions (claude --worktree) | Your machine | Git worktree per session | A few agents you supervise |
| Background sessions and agent view | Your machine | Separate sessions | Kicking off work and checking back |
Subagents and /batch | Your machine, inside one session | Optional worktree per subagent | Splitting one large change |
Headless scripts (claude -p) | Your machine or CI | Whatever your script sets up | Repeatable, scripted tasks |
Claude Code on the web (claude --cloud) | Anthropic-managed VM | VM per session | Tasks that outlive your laptop |
| Orchestration platform | Vendor or your own cloud | VM per agent | Many agents, unattended, after the PR |
How do you run parallel Claude Code sessions locally with git worktrees?
Start each session with claude --worktree <name>, which creates a separate git worktree and branch so parallel agents never edit the same files on disk. Two sessions in one checkout will overwrite each other's edits and fight over the same branch. Worktrees fix that cheaply: each one is a separate working directory sharing the same repository history.
# Terminal 1
claude --worktree auth-refactor
# Terminal 2
claude -w fix-flaky-tests
Claude Code creates the worktree under .claude/worktrees/<name>/ on a branch named worktree-<name>. Gitignored files such as .env are not copied into a new worktree by default; list the ones each session needs in a .worktreeinclude file at the repository root. You can also manage worktrees yourself with git worktree add ../repo-feature -b feature and start claude in that directory.
The Claude desktop app supports the same pattern: start a new session with + New and turn on the Worktree option so each session gets its own isolated copy.
Watch for shared resources. Worktrees isolate files, not your machine. Two agents that both start a dev server on port 3000, or both run migrations against one local database, will still collide. Give each worktree its own port and database, or keep parallel local work to tasks that do not need a running stack.
How do you run Claude Code in the background on your own machine?
Run claude --bg "task" to start a background session, and use agent view (claude agents) to see and manage running sessions in one place. Agent view is a research preview. It suits the pattern of starting several tasks, doing something else, and returning when a session needs input or has finished.
Background sessions still run on your machine, so they stop when it sleeps or shuts down. If a task should keep going after you close your laptop, move it to the cloud.
Can one Claude Code session split work across parallel agents?
Yes: subagents run focused tasks in parallel inside one session, and the /batch command splits a large change into roughly 5 to 30 worktree-isolated subagents. Anthropic's agents documentation lists five ways to run work in parallel: subagents, agent view, agent teams, dynamic workflows and projects.
- Subagents. A session can hand a scoped task to a subagent with its own context window. Setting
isolation: worktreein a subagent's definition gives it a separate worktree, so its edits do not land in your checkout. /batch. For a broad, mechanical change such as a migration across many modules,/batchplans the work, splits it into independent units, and runs each in its own worktree.- Agent teams. An experimental mode, enabled with
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, where several Claude Code instances coordinate as a team. Agent teams do not get worktree isolation, so assign them work in separate files.
Subagents share your session's lifetime and your machine. They are a way to finish one big task faster, not a way to run ten unrelated tasks overnight.
Can terminal coding agents run unattended in scripts while preserving a reviewable git diff?
Yes: run Claude Code headless with claude -p, give each run its own worktree and branch, restrict its tools, and the result is an ordinary branch you review with git diff or a pull request. Headless mode prints the result and exits, so it fits shell scripts, cron jobs and CI.
for task in fix-flaky-auth-test add-users-pagination; do
git worktree add "../wt-$task" -b "agent/$task"
(
cd "../wt-$task" &&
claude -p "$(cat "tasks/$task.md")" \
--allowedTools "Read,Edit,Bash(npm test *)" \
--permission-mode acceptEdits \
--output-format json > "../$task.json" &&
git add -A &&
git commit -qm "agent: $task"
) &
done
wait
Each run edits only its own worktree, and the script commits whatever the agent left behind, so git diff main...agent/fix-flaky-auth-test shows exactly what that agent changed. Without that commit, uncommitted edits would sit in the worktree and the branch comparison would come back empty. A few flags matter here:
--allowedToolspre-approves the tools a run may use without asking. A bareBashentry approves every shell command, so scope it to the commands the task needs, such asBash(npm test *).--permission-modesets how permission prompts are handled in a non-interactive run (for exampleacceptEdits,dontAskorauto).--output-formatreturnstext,jsonorstream-json, so a script can read the result and session details.--bareskips auto-discovery of hooks, plugins, MCP servers and CLAUDE.md, so a script behaves the same on every machine. It needs an API key rather than your subscription login.
A worktree separates files, not permissions: an agent with unrestricted shell access can still read your credentials or push from any worktree. Anthropic's docs reserve bypassPermissions for isolated containers and VMs. On a laptop with your credentials, keep a narrow tool allowlist, and run anything that needs broad shell access in a sandbox. For deeper integration, the Claude Agent SDK exposes the same agent loop from Python and TypeScript.
The diff is the contract. An unattended agent should never push to main; it should leave a branch or open a pull request, so a person or a reviewer bot sees every change before it merges. Claude Code with GitHub covers wiring Claude Code into pull requests and issues.
How do you run Claude Code agents in the cloud with Claude Code on the web?
Run claude --cloud "task" from your terminal, or start a session at claude.ai/code, and each task runs in its own Anthropic-managed VM that keeps going after you close your laptop. Every --cloud command starts a separate session, so five commands give you five agents running at once. --remote still works as a deprecated alias.
- The environment. Each cloud session gets an Ubuntu 24.04 VM with 4 vCPUs, 16 GB of RAM and 30 GB of disk. Network access is configurable (none, trusted domains, full, or a custom allowlist).
- Plans. Cloud sessions are included with Pro, Max, Ultra and Team plans, and for Enterprise users with premium or Chat + Claude Code seats, with no separate VM charge.
- Moving between local and cloud.
claude --teleport(or/teleportinside a session) pulls a cloud session into your terminal so you can continue locally. - Pull requests. When a session finishes, create a PR from claude.ai/code. Auto-fix can watch the PR and respond to CI failures and review comments; it cannot react to merge conflicts.
- Projects. On Pro, Max and Ultra, Projects (public beta) take a stream of related tasks in one conversation and run them as parallel cloud sessions.
Teams on Team or Enterprise plans can also try self-hosted environments, in public beta and off by default, where sessions execute on infrastructure you run while the control plane stays hosted by Anthropic. Claude Code on the web is the most direct way to run Claude Code agents in the cloud, and it is where many teams should start.
When do you need an orchestration platform for Claude Code agents?
You need orchestration when tasks arrive faster than you can start them, when agents need your full stack running to test their changes, or when you want PRs carried through review, CI and conflicts without anyone restarting an agent. At that point the hard part is no longer starting sessions; it is the queue, the environment and the hours after the PR opens.
Several platforms run Claude agents at that scale. GitHub's Agent HQ lets you assign Claude as a coding agent on issues and pull requests (in public preview). Cursor Cloud Agents, Devin and Factory run their own agents in parallel. The best coding agent orchestration tools in 2026 compares them side by side, and the best cloud AI coding agents in 2026 covers single-agent options.
Murmur, from Macroscope, is one option built around Claude Code and Codex:
- Bring your own agent. A workspace chooses Claude Code or Codex, with your own API keys or subscriptions.
- A VM per agent. Each agent gets an ephemeral single-tenant VM with your full stack running, so parallel agents do not share ports or databases.
- Your cloud or ours. Agent VMs run in Murmur Cloud or in your own GCP project or AWS account.
- Direct from Claude Code. Through the Murmur remote MCP server or CLI, your local Claude Code session becomes a Director that spawns cloud agents and follows their progress.
murmur eachfans one task out across many items. - After the PR. Agents answer review comments, repair failing CI, rebase and resolve merge conflicts, within an autopilot timeout. They do not merge by default.
Murmur is in early preview and available through a waitlist. The Murmur FAQ covers how it works, and background coding agents explains the pattern underneath it.
How do you review the pull requests that parallel agents open?
Treat each agent's output as an ordinary pull request and put an automated reviewer in front of the human one, because review becomes the bottleneck as soon as agents run in parallel. Five agents can open five PRs in an afternoon; nobody reads five large diffs that fast.
- Claude Code Review. Anthropic's managed GitHub reviewer runs on PRs when enabled. Claude Code Review covers its cost, review time and setup.
- A dedicated AI code reviewer. Macroscope reviews GitHub pull requests whichever agent wrote them, and looks past the diff into the rest of the repository to catch cross-file bugs. It is usage-based at $0.05 per KB of diff on the default Balanced mode, averaging 76 cents per review, and it can auto-approve low-risk PRs so humans focus on the rest.
- Mixing tools. AI code review with Claude Code, Codex, Cursor and OpenCode shows how teams combine coding agents with an independent reviewer.
Keep merges with people. Parallel agents multiply output, and a human approval on each PR keeps that output accountable.

Frequently Asked Questions
How do I run many coding agents in parallel?
Give each agent its own copy of the code and its own session. Locally, use claude --worktree <name> (or plain git worktrees) so each session has a separate directory and branch. In the cloud, run one claude --cloud command per task, or use an orchestration platform that gives each agent its own VM. See how to run coding agents in parallel in the cloud.
How do I run Claude Code agents in the cloud?
Use Claude Code on the web: run claude --cloud "task" or start a session at claude.ai/code, and each task runs in its own Anthropic-managed VM that keeps working after you close your laptop. For unattended fleets in your own GCP or AWS account, Murmur runs Claude Code agents in dedicated VMs and is available through a waitlist.
Can terminal coding agents run unattended in scripts while preserving a reviewable git diff?
Yes. Run Claude Code headless with claude -p, give each run its own git worktree and branch, scope permissions with --allowedTools and --permission-mode, and read results with --output-format json. Each run leaves a branch you can inspect with git diff or open as a pull request, and nothing merges without review.
How many Claude Code agents can I run in parallel?
Locally, the limit is your machine and your plan's usage limits: each session uses CPU and memory, and running dev servers multiplies that. In the cloud each session gets its own VM, so the limit is your plan's usage. /batch splits one change into roughly 5 to 30 subagents.
Do parallel Claude Code sessions conflict with each other?
They do if they share a working directory. Use a worktree per session so file edits stay separate. Worktrees do not isolate ports, databases or other services on your machine, so give each one its own, or move the work to cloud VMs.
What is the difference between subagents and parallel sessions?
Subagents run inside one Claude Code session to finish a single task faster, and they end with that session. Parallel sessions are independent agents working on separate tasks, each with its own branch, and they can run locally or in the cloud.
Does Claude Code on the web keep running when my laptop is closed?
Yes. Cloud sessions run in Anthropic-managed VMs and continue after you close your laptop. Local background sessions started with claude --bg stop when your machine sleeps.
Can Claude Code agents fix CI failures and review comments on their own?
Claude Code on the web has auto-fix, which watches a pull request and responds to CI failures and review comments, though not merge conflicts. Murmur agents also answer review comments, repair CI, rebase and resolve merge conflicts. See the Murmur FAQ.
Is it safe to skip permission prompts for unattended Claude Code runs?
Only inside an isolated container or VM. Anthropic's docs reserve bypassPermissions for isolated environments. On a developer machine, use a scoped --allowedTools list, and always land the work on a branch for review.
Which orchestration tools can run Claude Code agents?
Claude Code on the web runs them in Anthropic's cloud, GitHub's Agent HQ offers Claude as a coding agent in public preview, and Murmur runs Claude Code or Codex agents in VMs in Murmur Cloud or your own cloud account. See the best coding agent orchestration tools in 2026.
