Blog · Guide · 27 November 2026

Merge Conflict Hotspots: Where Parallel Coding Agents Collide

Merge conflict hotspots are the few files that almost every feature has to touch: route tables, registries, package manifests and lockfiles, barrel exports, migration folders, shared config. When several coding agents work in parallel, most of their conflicts land in these files, because two unrelated tasks both add one line to the same list. You can find your hotspots from git history in a minute, remove some of them by changing how the code is laid out, and manage the rest by giving each file one owner at a time. This guide covers all three, and what still slips through.

Why a few files take most of the conflicts

Two agents asked to add a search page and a billing page touch different components, different tests, different styles. Then each opens routes.ts and adds an entry at the end of the same array. Git sees two changes to the same lines and stops.

The usual suspects:

Hotspot Why agents collide there
Route tables, URL maps Every new page or endpoint adds an entry
Registries (plugins, commands, DI containers, feature flags) Every new thing registers itself in one list
package.json, pyproject.toml, go.mod Every new dependency
Lockfiles An install rewrites large parts of the file
Barrel files (index.ts re-exports) Every new module is exported from one place
Migrations Two agents both create migration 0042
Shared types and schemas A field added for one feature, renamed for another
CI and tool config Every task that needs a new check

Augment's guide to multi-agent workspaces names the same group (routes, registries and configs) and recommends a single writer for them. Capy's write-up adds the ones outside the files themselves: a pnpm install rewriting the lockfile mid-test, two agents generating the same migration number, two dev servers on port 3000.

Finding your merge conflict hotspots

From git history

Files changed most often are the first candidates:

git log --since=6.months --name-only --pretty=format: \
  | grep -v '^$' | sort | uniq -c | sort -rn | head -20

Files that change together with many different features are the real hotspots. A rough test: for each file, count how many distinct branches or pull requests touched it.

git log --since=6.months --merges --pretty=%H | while read m; do
  git diff --name-only "$m^1...$m^2"
done | sort | uniq -c | sort -rn | head -20

A file near the top of both lists, and not owned by any one feature, is a hotspot.

From a run of agents

History shows where people collided. Agents collide in their own places, so look at a real run too. On a Forkit fan-out's page, the who-edits-what map lists every changed file with the agents editing it, a state dot per agent and a total per file; a file with five agents on it is a hotspot whether or not history agrees. The same page lists conflicts first: each pair of agents and file, with both line ranges.

Patterns that remove the hotspot

The best fix is a layout where parallel features do not share a file.

  • One file per feature. Instead of one routes.ts, a routes/ folder where each feature adds its own file, collected at build time or with a glob import.
  • Generated registries. Discover plugins, commands or migrations by scanning a directory, and generate the list. Nobody edits the list by hand.
  • Append-only sections with room. If a list must stay in one file, sort it and leave each feature's entries in its own block. Sorted entries spread insertions across the file instead of piling them at the end.
  • Timestamps, not counters, for migrations. 20261127_1402_add_cents.sql does not collide; 0042_add_cents.sql does.
  • No barrel files in folders agents add to often. Import from the module directly.

This is what people mean by a "zero-conflict architecture". It is worth doing for human teams too, but it pays off faster with agents, because agents run more tasks in parallel than people do.

Patterns that manage the hotspot

Some files cannot be split: the package manifest, a shared schema. Give them an owner.

One owner per file at a time. Before editing a hotspot, an agent claims it; another agent asking for the same file is told who holds it and until when. In Forkit, a claim that overlaps another agent's exclusive claim is not granted: the answer lists it as refused with the holder, its pattern and expiry, grants the rest, and tells both agents so they can agree a split. An edit under another agent's exclusive claim is refused by the agent's hook before it happens. Claims expire (30 minutes by default) and renew while the agent keeps working, so a crashed agent does not lock a file forever. An exclusive claim cannot cover the whole repository: a pattern starting with a wildcard is refused.

Shared claims for append-only files. Where every agent adds a line and nobody rewrites, mark the claim shared. Two shared claims do not block each other, and the record still shows who is in the file.

One agent makes both edits. When two agents need the same change in one hotspot, one makes it and sends the other the patch. The other applies it instead of writing its own version. This matters more than it sounds. In one CooperBench task (go-chi 26), two agents in separate checkouts agreed that one would make both edits, but the other could not see that change and made its own anyway; the two patches clashed at merge. That run is why Forkit added patches on messages: the agent that makes both edits sends the change itself (forkit share), and the other applies it (forkit apply). Sharing patches between agents has the details.

Lockfiles: one installer. Let one agent change dependencies. The others note what they need, wait for that change, then rebase. Never let two agents run installs that both rewrite the lockfile.

Plan around hotspots. When a planner splits work, it should hand each hotspot to one worker, or schedule the edits to it in sequence. Planner-worker task decomposition covers that.

What still slips through: semantic conflicts

Removing textual conflicts does not make parallel work safe. Two agents can edit different files, merge cleanly, and break each other: one renames a field another still reads, or changes what a helper returns.

A September 2026 paper, "Passes Alone, Fails Together" (Xia, Wu and Park), measured this. On constructed tasks around twelve Django helpers, interference appeared in 97% of runs; a message describing the concurrent change recovered 82% of them. On 417 pairs of real merged pull requests it found interference only once, and the authors warn the constructed rates are not estimates of how often it happens in practice. The lesson is narrower and useful: telling an agent what its peer changed fixes most of these cases.

Another 2026 paper, on asynchronous software engineering agents (Geng and Neubig), found that "branch-and-merge is a central coordination mechanism for multi-agent collaboration", with isolated workspaces merged under test-based verification. Both point the same way: isolate the work, tell agents about each other's changes, and test the merged result, not each branch alone.

More in semantic merge conflicts and AI agents and coding agents without merge conflicts.

Checklist

  • List your top 20 files by churn and by number of features touching them.
  • Split route tables, registries and barrels where you can; generate what you cannot split.
  • Use timestamped migrations.
  • Give every remaining hotspot one owner per run (exclusive claim) or mark it append-only (shared claim).
  • One agent installs dependencies.
  • When two agents need the same edit, send the patch.
  • Run tests on the merged result.

Forkit has a Free plan; Pro is $20 a month and Team $40 per seat a month, billed per person, never per agent. More at forkit-mcp.com.

Sources

Read on 27 Nov 2026: