Worktrees
Use git worktrees with parallel AI coding agents
Worktrees give each agent its own checkout and branch. Here is what they solve, what they leave open, and how to keep worktree agents aware of each other.
The problem
Worktrees stop agents trampling each other's working copy. They don't stop two branches implementing the same thing, or making incompatible changes to one interface.
What people try
- One worktree per agent and merge at the end
- Each branch looks fine on its own. The incompatibilities show up as merge conflicts or, worse, as code that merges cleanly and breaks.
- Rebasing every branch often
- Catches textual conflicts sooner, but says nothing about the plan each agent is following.
With Concord
01
Create the worktrees
git worktree add ../feature-a -b feature-a, one per agent, as usual.
02
Share one workspace
Concord follows git's commondir from each linked worktree back to the main checkout, so every worktree shares one Concord database.
03
Claim across branches
A claim can carry its branch and worktree, and overlaps are reported across all of them before either branch is merged.
Result
Worktrees isolate the files. One shared workspace keeps the plans visible across them.
Common questions
- Do I need to run concord setup in every worktree?
- No. Run it once in the main checkout. Linked worktrees resolve to the same .concord/ workspace automatically.
- Are worktrees still worth it with Concord?
- Yes. They prevent agents interfering with each other's uncommitted files and builds. Concord covers the coordination worktrees don't.
Further reading
Give your agents shared work-state.
npm install -g @concord-ai/concord-mcp