Parallel AI agents without Git branch collisions
Two agents finish sooner than one only when each lane has a real boundary. I give each agent its own Git worktree and a list of files it owns, name the shared files in advance, and merge the lanes one at a time.

Adding a second agent does not add a second unit of throughput on its own. Two agents can produce two good changes at once. They can also edit the same manifest, regenerate the same index, bump the same cache version, or leave the release branch in a state neither of them intended.
Before I start more agents, I count how many independent ownership lanes the work has: sets of files that only one agent will change. That count is the upper limit on how many agents I let write at once. Then I make every shared part of the work serial.
Parallelise at the ownership boundary
Different descriptions do not make two tasks independent. “Write the guide” and “update the content index” are two prompts, yet both can touch the same metadata and the same generated navigation. A new guide and a read-only accessibility review can run together, because the review writes no source files and the guide owns its own.
A lane is ready to run when it has three things:
- One defined outcome: the concrete file, page or change the lane must leave behind.
- One set of owned files: the files or components that only this lane may change.
- One integration contract: the check results and handoff the integrator will receive.
If any of the three is vague, the work is not ready to split. I settle the boundary before creating another branch or worktree.
Map worktrees, ownership, and gates first
The map shows where lanes would collide before any work begins. This example has two writing lanes and one read-only review lane, and keeps the shared release files for a single integrator.
| Lane | Owns | Collision points | Integration gate |
|---|---|---|---|
Worktree A (lane/guide) | New guide and its dedicated image | May read the manifest; must not edit it | Finished guide, focused diff, handoff note |
Worktree B (lane/example) | Standalone example and local copy | May read global styles; must not change them | Isolated change, acceptance check results, handoff note |
Review lane (lane/review) | Findings only; no source writes | Can inspect every lane without owning files | Prioritised findings, each tied to a page or file anyone can check |
| Integration lane | Manifest, generated index, shared styles, release state | Every shared and generated file meets here | Integrate one lane at a time, regenerate once, verify the combined state |
Each lane reads widely and writes only its own files. Shared metadata, generated files, cache versions and release state stay with the integration lane.
What worktrees isolate, and what stays shared
A separate Git worktree gives each agent its own directory, index and branch. One agent’s uncommitted files never appear in another agent’s directory, and each lane is easy to inspect and throw away.
A worktree cannot decide who owns a shared stylesheet, whether two changes imply incompatible behaviour, or which agent may advance release state. It prevents overlap on disk. Semantic overlap, where two lanes make changes that disagree in meaning, still gets through. So I use one worktree per write lane, one branch per outcome, and one integration owner.
Issue a lane contract before the prompt
The lane contract supplies the coordination that Git does not provide. It should be short enough to read before acting, and specific enough to stop an agent from “helpfully” editing files that belong to the next lane.
LANE
Name and bounded outcome
WORKSPACE
Dedicated worktree and branch
OWNS
- Exact files, components, or artifacts this lane may change
MAY READ
- Context this lane may inspect but not modify
RESERVED SHARED SURFACES
- Manifests, lockfiles, generators, shared styles, cache versions,
release state, or any file owned by another lane
ACCEPTANCE
- Observable conditions the artifact must satisfy
HANDOFF
- Focused diff, evidence, open risks, and integration notes
STOP IF
- The useful next change crosses ownership, needs a shared file,
or conflicts with another active lane
The stop condition matters as much as the ownership list. Without it, an agent that finds a dependency outside its lane will often widen its own scope instead of handing the decision back to the integrator.
Give every shared file one policy
Some files attract collisions because many changes rightly depend on them. Typical ones are a central manifest, a package lockfile, a global stylesheet, generated navigation, a route table, a version constant and a release note.
Before the lanes start, I choose one policy for each shared file:
- Integrator-owned: lanes supply the new record or instruction, and the integrator edits the shared file once.
- Partitioned: the file has stable regions that do not overlap, with one named owner per region.
- Deferred generation: lanes change inputs; only the integrator runs the generator, after every accepted input is in.
- Read-only during parallel work: nobody changes the file until the lanes stop.
Cache versions and release state get the strictest policy. If every lane advances them on its own, the final number or status records the merge order and says nothing reliable about the release.
Integrate serially, even when creation was parallel
The integration lane is narrow on purpose. Parallel work stops at the gate, and changes cross it one at a time.
- Freeze the completed lane. No opportunistic edits after the handoff.
- Compare the diff with the contract. Reject scope drift before it reaches the shared branch.
- Integrate the least coupled lane first. Later conflicts stay small and easy to read.
- Update shared files once. Apply manifest entries, generator runs and cache changes from the combined state.
- Check the combined behaviour. Each lane’s own checks prove its part; the integration checks prove the parts still work together.
- Record the new state. Close the accepted lane and name the next owner.
This is the step a compact handoff packet is for. The integrator needs the current state, the check results, the boundaries and the remaining risks. The lane’s full conversation can stay behind.
Watch for coordination that only looks parallel
- Different branches, same directory: uncommitted state collides before Git can help.
- Different files, same concept: two lanes encode incompatible assumptions in separate files.
- Every lane runs generators: derived files turn into noisy merge conflicts, when they should be generated once from the accepted inputs.
- Every lane bumps a version: the cache version advances with no coherent combined release behind it.
- First finisher becomes integrator: timing decides who owns the merge, and nobody made that judgement.
- Agents merge each other: no one keeps a clear view of the intended final state.
When two lanes keep running into the same shared decisions, they are probably one task. I merge the work plans before merging the branches.
Do not parallelise the critical decision
Parallel agents suit independent production, inspection, research and experiments with a fixed scope. They are a poor fit when the next step depends on a single open question. That can be an architecture choice, a schema that is still changing, a global design decision, or a release step only one agent can hold at a time.
Sometimes the fastest plan uses one agent until the critical choice is settled, then fans out to several.
A five-minute launch sequence
- List the outputs you want before you look at how many agents are free.
- Map which files each lane writes, and circle every shared or generated file.
- Put files that change together into one lane.
- Give each write lane one worktree, branch, owner, set of acceptance checks and stop condition.
- Reserve shared files and release state for the integration lane.
- Start the lanes, collect each lane’s handoff, then integrate one lane at a time.
Use this

← Previous: AI agent handoff template: what the next session needs
Want this inside your team’s workflow? The Verified AI Operations Sprint tests one workflow in ten working days. See the sprint →