Run Claude Code agents in parallel
The short answer: give every agent that edits files its own git worktree, so
each one works on its own copy of the project. amux does that with one key
when you start an agent, and agents it runs can split work between them, on any
of your computers. In Claude Code alone, claude --worktree makes a worktree for
you, and sessions started from agent view move into one before they edit.
Where it goes wrong
You’re working on Tally, a small accounting app. One agent is redesigning the checkout while another writes payment tests. Both run in the same folder.
The test agent runs the suite while the checkout is half edited. The tests fail, so it starts fixing code that wasn’t broken. When you go to commit, the two sets of changes are tangled together on one branch, and neither agent knows the other exists.
Why it happens
Agents in one folder share one set of files and one branch. Each reads a file, thinks for a while, and writes it back, with no idea what else changed in between.
So running agents in parallel takes three things:
- A separate copy of the files for each agent, on its own branch.
- Tasks that don’t overlap. Split work by area, because two agents editing the same file will still conflict when you merge.
- A way to bring the work back, reviewed, into one branch.
Two more things to plan for. A worktree separates files, not everything else, so two agents can still fight over a port or a local database. And each agent uses your plan’s limits at the same time, so parallel work multiplies your usage.
Without amux
Git worktrees
A worktree is a second checkout of the same repository, on its own branch:
git worktree add ../tally-checkout -b checkout-redesigncd ../tally-checkoutclaudeClaude Code can do this for you. claude --worktree checkout-redesign creates one
under .claude/worktrees/ and starts a session in it. Either way it’s a fresh
checkout, so there’s no .env or node_modules until you set them up. List files
in a .worktreeinclude file and
Claude Code copies them in.
Agent view
Sessions you start with claude --bg or from
agent view begin in your folder
and move into a worktree of their own
before they edit anything. It’s the least work if your tasks are independent and
you only use Claude Code on one computer.
Letting Claude split the work
Subagents take a side task inside one session and report back. Agent teams go further, with a lead assigning work to several sessions, but they’re experimental and off by default, and they don’t put teammates in worktrees. In all of these, every worker is a Claude session.
With amux
Start the agent with a worktree of its own. In amux, press n, type the task, then press Ctrl+S followed by w to turn on new worktree, and press Enter. On your iPhone, it’s the New worktree switch. amux makes the worktree from the folder’s repository, and your own checkout stays as you left it.
Then you can leave the splitting to the agents. Every agent amux runs can start subagents of its own, Claude or Codex, on any computer you’ve paired, and hear back when they finish. Ask in plain words:
Split the checkout redesign into the copy changes and the payment tests, each in its own worktree, and give each one to a subagent. Bring their changes together when they’re both done.
Subagents appear beneath the agent that started them:
Here checkout-redesign has started two. copy-pass has finished, and
payment-tests is running in Codex on a faster computer called build. If a
subagent needs you, it shows up under Needs you like any other agent, and you
can open its chat and talk to it directly.
When the work comes back, review it before it lands. In an agent’s chat, press Ctrl+A then r to see every change. Press c to comment on a line, and your comments go back to the agent as one review.
To go further, Agents working together covers what agents can do with each other, and Terminal app covers reviewing.
Last reviewed on 6 November 2026.
Next: Closing the lid stops the work Keep Claude Code running when your laptop sleeps or SSH drops