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.
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.
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