How to run multiple Claude Code agents in parallel
Run multiple Claude Code agents in parallel: one git worktree per agent, tasks that touch different files, and one list of every agent waiting on you.
It is 3:40 in the afternoon and four Claude Code sessions are open in four terminals. One has waited twenty minutes on a permission prompt to push its branch. Two wrote the same date helper in different files. The fourth says it is done, and its tests never ran.
To run multiple Claude Code agents in parallel, give each agent its own git worktree and branch, and give each one a task that touches different files. Then run only as many as you can review, and answer every waiting agent from one list instead of one terminal at a time.
The setup takes minutes. How you manage multiple coding agents after that decides whether five agents ship five changes, or one person spends the afternoon switching windows.
#How to set up parallel Claude Code sessions
A git worktree is a second checkout of the same repository, on its own branch, in its own folder. Each agent edits its own files on disk, so one agent's half-finished change never lands in another agent's build. By default, git also refuses to check out a branch that another worktree already holds.1
Claude Code creates the worktree itself. Run it once per task, each in its own terminal:2
claude --worktree billing-retry
claude --worktree export-docs
claude --worktree search-index
With plain git, the setup is one command per agent, cut from a fresh main:
git fetch origin
git worktree add ../acme-billing-retry -b fix/billing-retry origin/main
cd ../acme-billing-retry && claude
Three details decide whether the setup holds up past the first day:
- Untracked files. A new worktree is a fresh checkout, so a gitignored
.envis missing. List the files to copy in.worktreeinclude, which Claude Code reads when it creates a worktree.3 - Shared services. Worktrees split the files, not the machine. Two agents that start the same dev server port, test database, or Docker volume still collide. Give each worktree its own port and database name in its
.env. - Cleanup. Remove each worktree when its branch merges, with
git worktree remove <path>and thengit worktree prune. A forgotten worktree keeps its branch checked out, and git refuses that branch everywhere else.
Other agents use the same mechanism. Cursor 2.0 runs up to eight agents on one prompt, each in a git worktree or on a remote machine, "to prevent file conflicts."4 Worktrees stop file collisions. They do nothing for the rest of what goes wrong.
#Task boundaries that keep agents apart
Most collisions start before the first agent runs. Anthropic found that without detailed task descriptions, its research subagents "duplicate work, leave gaps, or fail to find necessary information." Some ran the exact searches their siblings had already run.5 Claude Code's guide to agent teams states the file rule: two teammates editing the same file leads to overwrites, so give each one its own set of files.6
Engineers report the same failure in code. One engineer described an agent that "rebuilt a helper that already existed two files away under a different name." The duplicate logic "slipped in until edge cases diverged."7
Four rules keep tasks apart:
- One work item per agent. Each agent gets one ticket, one branch, and one worktree. A task that needs two agents is two tickets.
- Owned files. Name the directories each task may change. A shared module gets one owner for the day.
- A map of shared code. Keep a short index of utilities and where they live in
CLAUDE.mdorAGENTS.md, so an agent finds the helper before it writes another. - Done, written first. Write what done means before the agent starts: the behavior, the test, and the doc.
The last rule matters more as the count grows. In Anthropic's long-running agent experiments, a later agent instance would "see that progress had been made, and declare the job done." Agents also marked features complete without proper testing.8 The definition of done for AI coding agents covers how to write that list so an agent can work to it.
#How many coding agents one engineer can run
The limit is your attention. Researchers have measured it for people who supervise several unmanned vehicles at once. Their measure, fan-out, divides how long a vehicle can run alone by how long a person needs to set it right. Then it adds one, for the vehicle that runs alone in the meantime.9
fan-out = neglect time / interaction time + 1
Cummings and Mitchell added the time a vehicle waits for its person: the moment to reorient, the queue when two need help at once, and the lag after losing track of what each one was doing. Counting those waits cut the predicted number of vehicles by up to 67 percent in their simulation. Losing track was the largest cause.10
The formula gives a way to reason about coding agents, though the studies covered vehicles. Neglect time is how long the agent works without you. Interaction time is how long you spend reading its state and answering it. Wait time is the rest: finding the right terminal, rereading what the agent did, and the agents queued behind the one you are reading.
Take an agent that works 30 minutes alone and needs 6 minutes of your time per check-in. With no waiting, one person keeps 6 such agents moving. Add 4 minutes of finding and rereading to each check-in, and the number falls to 4. Programmers pay a rereading cost whenever they resume a task. In 10,000 recorded programming sessions, only 10 percent had coding activity start within a minute.11
Agents one person can keep moving, by wait time per check-in
| Minutes spent finding and rereading, per check-in | Agent works 60 minutes alone | Agent works 30 minutes alone |
|---|---|---|
| 0 | 11 | 6 |
| 1 | 9.6 | 5.3 |
| 2 | 8.5 | 4.8 |
| 3 | 7.7 | 4.3 |
| 4 | 7 | 4 |
| 5 | 6.5 | 3.7 |
| 6 | 6 | 3.5 |
| 7 | 5.6 | 3.3 |
| 8 | 5.3 | 3.1 |
| 9 | 5 | 3 |
| 10 | 4.8 | 2.9 |
| 11 | 4.5 | 2.8 |
| 12 | 4.3 | 2.7 |
The curve shows two levers. Agents that run longer alone raise the ceiling. Cutting the time spent finding and rereading raises it as well, because that time sits inside every check-in. An agent that works an hour alone, checked by someone who spends 6 minutes finding it each time, supports the same 6 as a half-hour agent with no waiting.
The bill grows with the count too. Anthropic measured its agents at about 4 times the tokens of a chat, and its multi-agent research system at about 15 times.5 Claude Code's agent teams guide suggests 3 to 5 teammates to start, and warns that token use scales with each one.6
#What breaks first with parallel coding agents
Four failures show up in engineers' reports and in Anthropic's long-running agent work.78
- Approvals that nobody sees. An agent stops on a permission prompt in a terminal you are not looking at. One engineer wrote that they still miss prompts "for 10+ minutes sometimes." Their main cost was "losing track of which terminal is blocked on a permission prompt."
- Duplicate work. Two agents solve the same problem, because nobody gave it to one of them.5
- Lost context. An agent runs out of context partway through a change. The next session starts with a feature "half-implemented and undocumented."8
- Unclear done. An agent reports success while its tests never ran or a requirement is missing.8
The first two are coordination failures. The last two surface after the run ends, in review and in the unfinished work agents leave behind. Each one gets worse with every agent you add.
#Agents waiting on your approval
A row of terminals gives no single list of which coding agent is waiting for approval. One engineer asked whether tmux gives any signal when a pane is blocked on a permission prompt.7
Oxagen lists every enrolled run from Claude Code, Codex, Cursor, and Stella on one Runs page as it starts. Each row shows the run's state, its latest step, and its cost so far for model calls routed through Oxagen. Cursor sends its model calls to its own servers, so its runs show no cost as they run.12
Where a person answers a held call depends on the agent. Claude Code asks on the developer's own machine. Stella holds the call until a person answers in Oxagen. For Codex and Cursor, Oxagen refuses the call, opens an approval, and the agent sends the same call again once a person approves it.1213 Each request in Oxagen shows the rule that held it and how long it has waited, and Approve request and Deny request answer it from the same panel.
The Waiting on a person panel of the Runs page, with illustrative data. Each request names the run, the call it wants to make, the rule that routed it to a person, and how long it has waited, with Approve request and Deny request beside it.
The Console gathers everything else that waits on you into one stack: approvals, questions an agent asked, results to review, and failed CI on a default branch. Items that block the most agents come first, then the oldest. Its Active runs panel shows which runs are working and which are waiting on you, with the work item each one serves and how long it has run.
The Active runs panel of the Console, with illustrative data. Each live run shows its name, its work item, how long it has run, its cost, and whether it is working or waiting on you.
#How to steer coding agents while they run
An agent heading the wrong way keeps spending until someone reaches it. With five terminals open, that someone has to find the right one first. A steer is a short instruction sent to an agent that is already working. Oxagen sends one to a single run, to every live run of one agent, or to every live run in the workspace:14
oxagen steer "Leave the migrations alone and run the tests first" --run tse_01k5ru4a8x
oxagen steer "Stop editing the migration and run the tests first" --agent billing-bot
oxagen steer "Pause before you push" --all --mode turn_boundary
By default a steer lands after the tool call in progress. turn_boundary waits for the agent's next prompt. interrupt cuts the model call in flight, on runs whose model traffic passes through Oxagen. A Claude Code agent waiting at its prompt reads a steer at once, and Codex and Stella read it when their next turn starts. Each steer shows whether it is queued, received, or applied, so you know it landed without opening the terminal.
A live run's page with illustrative data, printed the way Claude Code prints it. The transcript holds the prompt and each tool call, and the side column holds the run's details, context, tasks, and changes.
When to interrupt an agent, and what the steer should say, is covered in steering a run you are not watching.
#A daily loop for parallel agents
The pieces fit into one loop you can run every morning. Each agent starts from a work item with a written finish line. The unfinished work it leaves comes back to you as an item to send out again.
One work item through a day of parallel agents
- PickA ready work item with a written done list
- IsolateOne worktree and one branch for one agent
- RunThe agent works alone until it needs you
- AnswerApprove or deny from one list, the item blocking the most agents first
- SteerCorrect the run before it spends more
- ReviewCheck the result against the done list
What the run left reaches you as an item to send again
| Stage | WI-433 after the stage |
|---|---|
| Pick | ready |
| Isolate | own branch |
| Run | running |
| Answer | unblocked |
| Steer | corrected |
| Review | accepted |
Start with three agents. Add a fourth after a full day in which no agent waited on you for more than a few minutes. Oxagen shows every enrolled run and every request it holds in one place, and lets you steer coding agents while they run.
#References
-
Git (2026). git-worktree: Manage multiple working trees. Git documentation. https://git-scm.com/docs/git-worktree ↩
-
Anthropic (2026). Common workflows: Run parallel sessions with worktrees. Claude Code documentation. https://code.claude.com/docs/en/common-workflows ↩
-
Anthropic (2026). Explore the .claude directory. Claude Code documentation. https://code.claude.com/docs/en/claude-directory ↩
-
Cursor (2025). Cursor 2.0: New coding model and agent interface. Cursor changelog, 29 October 2025. https://cursor.com/changelog/2-0 ↩
-
Hadfield, J., Zhang, B., Lien, K., Scholz, F., Fox, J., & Ford, D. (2025). How we built our multi-agent research system. Anthropic Engineering. https://www.anthropic.com/engineering/multi-agent-research-system ↩ ↩2 ↩3
-
Anthropic (2026). Orchestrate teams of Claude Code sessions. Claude Code documentation. https://code.claude.com/docs/en/agent-teams ↩ ↩2
-
Product Hunt community (2026). Running 3-4 Claude Code / Codex sessions at once: what breaks first for you? Product Hunt discussion, started by a developer building a tool for this problem. Comments are anecdotes from individual engineers. https://www.producthunt.com/p/vibecoding/running-3-4-claude-code-codex-sessions-at-once-what-breaks-first-for-you ↩ ↩2 ↩3
-
Young, J. (2025). Effective harnesses for long-running agents. Anthropic Engineering. https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents ↩ ↩2 ↩3 ↩4
-
Crandall, J. W., Goodrich, M. A., Olsen, D. R., & Nielsen, C. W. (2005). Validating human-robot interaction schemes in multitasking environments. IEEE Transactions on Systems, Man, and Cybernetics, Part A, 35(4), 438-449. https://doi.org/10.1109/TSMCA.2005.850587 ↩
-
Cummings, M. L., & Mitchell, P. J. (2008). Predicting controller capacity in supervisory control of multiple UAVs. IEEE Transactions on Systems, Man, and Cybernetics, Part A, 38(2), 451-460. https://doi.org/10.1109/TSMCA.2007.914757 ↩
-
Parnin, C., & Rugaber, S. (2009). Resumption strategies for interrupted programming tasks. IEEE 17th International Conference on Program Comprehension, 80-89. https://doi.org/10.1109/ICPC.2009.5090030 ↩
-
Oxagen (2026). Coverage statement. Oxagen docs. https://docs.oxagen.sh/docs/security/record-coverage ↩ ↩2
-
Oxagen (2026). Wrap an agent. Oxagen docs. https://docs.oxagen.sh/docs/cli/wrap-an-agent ↩
-
Oxagen (2026). CLI commands: oxagen steer. Oxagen docs. https://docs.oxagen.sh/docs/cli/commands ↩

