, The Lanekeeper team

Your agents are breaking each other's code

Parallel coding agents each pass their own tests and still break main together. Why git and CI miss it, and what we built instead.

Running several coding agents at once is now normal. One works on the login flow, another on reports, a third on the billing migration, each in its own git worktree. Each one finishes, its tests pass, its pull request is green.

Then two of them merge and main is broken.

Key takeaways:

  • Parallel AI coding agents can break each other’s code even when each passes its own tests and git merges without a conflict.
  • Git compares lines, not intent: a changed function signature in one branch and a call to the old signature in another merge cleanly and break at runtime.
  • Lanekeeper solves this with ten deterministic rules that compare lanes in real time, without calling a language model. It is measured against 187 clash scenarios (33 from open-source projects) and publishes precision and recall per rule with every release.
  • The analysis runs locally; source code never leaves the developer’s machine.

A merge without a conflict

Here is the smallest version of it. In one worktree, Claude adds an option to login():

export function login(user: User, opts: { remember: boolean }): boolean {

In another, Cursor writes a weekly report that signs the admin in:

if (!login(admin)) throw new Error("not signed in");

Git merges these without complaint: the two branches touched different files. Each branch’s tests pass, because each branch is consistent with itself. The type error only exists in the combination, and nothing ever builds the combination before it lands.

Other versions of the same problem: one agent deletes formatDate() while another starts using it. Two agents both add migration 0042. Two agents rewrite the same function in different directions, and whichever merges second quietly wins.

Why the usual tools miss it

Git compares lines. It reports a conflict when both sides edit the same lines, and otherwise merges happily. A changed signature in one file and a new call in another are not a conflict to git.

CI tests each branch against the base, one at a time. It never sees branch A and branch B together until one of them is already on main.

The agents can’t see each other. Each one works in its own directory with its own context. Even a careful agent has no way to know that another lane is about to change the function it is calling.

People working in parallel cover this gap by talking: “I’m changing login(), hold off.” Agents don’t.

What Lanekeeper does

Lanekeeper is the conversation the agents aren’t having.

  • A daemon on your machine watches every worktree and turns each lane’s changes into code facts: this function’s signature changed and now takes two arguments; this lane adds a call with one.
  • Ten deterministic rules compare the lanes. When lane A’s change would break lane B’s new code, that is a clash, with a severity, the exact location, and one instruction.
  • The agent hears about it while it is working. In Claude Code a hook puts the clash in front of the agent right after the edit, so it can fix its call; in block mode the breaking edit is refused before it is written, with the other lane’s new signature as the reason. Cursor and Codex get the same information through hooks and an MCP server.
  • In CI, the GitHub Action compares each pull request with the other open ones, suggests a merge order, and, given your build and test commands, builds the risky pairs together.

Your code stays on your machine. Lanekeeper doesn’t send it anywhere and doesn’t use a language model to guess; the same changes always give the same answer. When it isn’t sure, it says nothing, because a tool that cries wolf gets turned off.

How we measure it

Every rule is checked against 187 clash scenarios (33 derived from real code in open-source projects including FastAPI, Requests, Hono, Express and Zod; 154 synthetic). Each scenario stages two lanes and says which clashes should and should not appear. High-severity precision and recall are both 100% on the realistic subset. We publish precision and recall per rule with every release, and a release doesn’t ship if high-severity precision drops below 95%.

Lanekeeper is free on your own machine and works with Claude Code, Cursor and Codex. Try the quick start: it takes about two minutes.

Further reading