Skip to content
codee3.dev/guides/run-agents-in-parallel

How to run several coding agents at once without them clashing

A practical setup for Claude Code, Codex or Gemini CLI on the same project, using git worktrees and a shared decision log.

Guide6 min readUpdated 2026-10-21gitworktreesclaude-code
THE SHORT ANSWER

Give each agent its own git worktree: a separate working folder of the same repository, on its own branch. Agents then can’t edit the same files at once. Keep one written list of decisions that every agent reads first, and merge each branch only after you’ve looked at it.

Why agents clash

Two agents in the same folder see each other's half-finished edits. One rewrites a file the other is reading, tests fail for reasons neither caused, and you spend the afternoon untangling it. They also forget what you decided yesterday, so each one makes its own choices.

ONE FOLDER, TWO AGENTS
Codex<<<<<<< Form.tsx
=======
>>>>>>>
Claude Code
Both edit Form.tsx. Someone's work is lost.
ONE WORKTREE EACH
Codexbooking/Claude Codeemails/
Separate folders. No one steps on anyone.

1. Give each agent its own worktree

A worktree is a second working folder for the same repository, on its own branch. Agents in different worktrees can't touch each other's files, and they all share one history.

C:\code\shopmain · your copy
CodexC:\code\shop-bookingbooking
Claude CodeC:\code\shop-emailsemails
Gemini CLIC:\code\shop-docsdocs
PowerShell
PS C:\code\shop> git worktree add ..\shop-booking -b booking
PS C:\code\shop> git worktree add ..\shop-emails -b emails
PS C:\code\shop> git worktree list
C:/code/shop a1f3c2d [main]
C:/code/shop-booking a1f3c2d [booking]
C:/code/shop-emails a1f3c2d [emails]

2. Write the decisions down, once

Keep a short file of what's been decided and tell every agent to read it before starting. When an agent wants to go against it, it should ask you instead.

DECISIONS.md
# Decisions
Read this before you change anything. Ask if you'd break one.
 
- D-014 Bookings close at 5pm.
- D-015 No card payments online.
- D-016 Deposits go through Polar.
In Codee3, this file is the project's brain. Agents read it automatically, and with Founder, guards stop a change that breaks a decision before it lands.

3. Review, then merge one branch at a time

When an agent says it's done, look at the change, run the tests, and merge it. Then rebase the next branch on top before you merge that one.

mainbookingemails (before rebase)emails, rebasedmerge 1merge 2
PowerShell
PS C:\code\shop> git switch main
PS C:\code\shop> git merge booking
PS C:\code\shop> git worktree remove ..\shop-booking
# then, in ..\shop-emails
PS C:\code\shop-emails> git rebase main

Setting up each agent on Windows: Claude Code GUI for Windows, Codex CLI on Windows and Gemini CLI GUI for Windows. Tools that run several agents for you are compared in Codee3 vs Conductor and other orchestrators.

Codee3 does all three for you, free.Each agent you start gets its own worktree, every agent reads your decisions, and nothing lands until you say. Founder adds an orchestrator that hands out the jobs, and guards.Download for Windows