If you do run several agents on a codebase, these are the things that break, roughly in order of how often they catch people out.
Agents undoing each other's work. Two agents given adjacent tasks both decide the same helper function needs changing, in different directions. The second write silently reverts the first. Nothing errors, and the only signal is a feature that worked an hour ago and does not now.
Merge conflicts clustering on hotspot files. Conflicts are not evenly distributed. They pile up on a predictable set of files: routing tables, config, component registries, barrel exports, type definitions, database schemas, because nearly every feature touches them. Git catches the textual conflicts. It does not catch the semantic ones.
Semantic conflicts that compile. The genuinely dangerous case. Two agents implement the same interface differently. Both branches compile, both pass their own tests, and the integration either breaks in a way nobody expects or silently drops a feature. There is no automated signal for this at all. It is the strongest argument for keeping writes single-threaded, and the strongest argument for having an eval suite that runs on the merged result rather than on each branch, which our guide on
knowing whether AI output is right covers in detail.
Stale snapshots and compounding conflict cost. Each agent branches from a frozen view of the codebase and cannot observe the others' in-flight changes. Merging branch A changes the base for every remaining branch, creating conflicts that did not exist when those branches were created. The practitioner Dave Paola frames the conflict surface across N parallel branches as roughly N times N minus 1, over 2, and notes that Amdahl's law does not model merge cost at all. That is blog reasoning rather than measurement, but it matches the shape of the CooperBench decline, and his practical scale is worth keeping in mind: two agents means occasional easy conflicts, five means frequent cascading ones, nine means agents spend more time resolving conflicts than writing code.
Runaway spawning. Anthropic report early versions of Claude Research "spawning 50 subagents for simple queries" and agents "scouring the web endlessly for nonexistent sources". Their fixes were explicit termination conditions in prompts and better spawn logic, which is to say the surrounding code has to enforce limits, because the agent will not.
The review bottleneck. Three agents produce three noisy diffs that overlap in surprising ways, and the human becomes the integration layer. Parallelism that moves work from the agent to the reviewer is deferred cost, not a gain. This is the failure mode that looks like success on a dashboard, because the agents all finished.
The mitigations practitioners converge on are consistent, and they are all versions of the same principle:
-
One writer per module. Make write scopes disjoint by construction. This is Yan's second principle turned into a rule you can enforce.
-
Map file ownership before spawning, not after. Only parallelise tasks whose expected file sets do not overlap.
-
A git worktree per agent, so agents cannot clobber a shared index.
-
A serialised merge queue with automated verification before anything lands.
-
Each agent returns a receipt: files changed, commands run, checks passed, risks left open. One integration pass can then reconcile without re-deriving everything from the diff.
-
Turn caps and boolean exit gates enforced by the surrounding code rather than by the agent's own assessment of whether it is done.