15 from Merge Debt: The 2026 Bill Your Parallel AI Agents Are Running Up
The landing order: parallel agents count once their work is in main, shaped and in a chosen order
By Vladimir Mikhalev Docker Captain · CNCF Ambassador · IBM Champion
Blueprint 15 Worktrees parallelize the work. Main is a single sequence. The gap between code agents have finished and code that has landed, reviewed and reconciled, is merge debt, and it grows in front of the one gate that did not scale: human review.
The controls below need no vendor claim. They make the debt visible and the repayment cheap enough to happen daily.
- 1
Give every agent its own worktree
Each agent edits its own copy of the tree, so nothing collides while the work is in flight. One working tree has one index, and two writers share it like a clipboard: two scripted writers in one tree put the other writer's file into 333 of 333 commits with a pause of 200 milliseconds between
git addandgit commit, and lost 4 files thatgit addhad accepted in 2,000 tries; with a worktree each, none. It is the right primitive for the work, and it moves the problem to the landing. Owner: the engineer who launches the agents, with the team lead making it the default for any run of more than one agent. - 2
Measure the shared index on your own runners
The race is timing-dependent, so one clean run proves nothing. Run it on the git version your runners use, in a shared tree and with a worktree each, and keep the result file. Watch the counters a healthy-looking history hides: commits with the other writer's file, commits under the other writer's message, files lost from the index. In a shared tree any of them above zero means the setup is not safe for parallel agents, whatever the agents did that day. Owner: the platform engineer who owns the CI runners and the agent tooling.
- 3
Check what each worktree touches before you spawn another
Two agents aimed at the same module is a collision you scheduled. A commit graph that shows every active worktree and its working changes in one view (GitLens 18 does) makes it a ten-second look.
- 4
Give the landing order an owner
When several branches finish together, the sequence is an engineering decision: smallest blast radius first, or the hottest file first, chosen, not left to whoever presses merge first. Owner: the engineer or lead who owns the target branch.
- 5
Cap diff width per agent task
Cap agent tasks the way you cap pull request size for people, and split before landing, not after the review stalls. Every downstream cost (rebase, review, revert) grows with the width.
- 6
Make commit shaping the entry fee to main
Machine output does not enter history as one blob called "update payments". Reviewable commits with meaningful messages, shaped by hand or by a tool such as Commit Composer (part of GitKraken AI, a paid plan), are required before review.
- 7
Plot the debt next to velocity
Two numbers per team on the same dashboard: time from agent-done to merged in main (the queue depth) and the share of agent-authored code reworked within two weeks (the quality echo). Owner: the engineering manager.
Three questions for the next engineering leadership meeting
- What is our median time from agent finished to merged in main, and is it growing?
- Who decided the landing order of the last three parallel branches that touched the same service, and was it decided at all?
- What share of AI-authored code merged last quarter was rewritten within two weeks?
What it rests on
The study behind the perception gap, the measured race behind the first two steps, and the tools the steps name.
- METR, the randomized controlled trial of early-2025 AI tools, 10 July 2025: 19% slower, believed 20% faster, 16 developers, 246 tasks.
- The worktree index race of 5 November 2026, git 2.56.0: with a 200-millisecond pause, 333 of 333 commits in one tree carry the other writer's file and none with a worktree each; without the pause, 19 of 382; over 50 repeats, 4 files lost in one tree. The worktree merges took a median of 22.9 to 40.0 milliseconds with no conflicts (the result file).
- GitLens 18: agent sessions, worktrees and working changes in one commit graph.
- GitKraken AI: Commit Composer restructures a sprawling diff into reviewable commits before review.
Generating is parallel. Landing is serial, and someone should choose the order.
The long version is the post Merge Debt. METR, Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity, 10 July 2025; GitKraken, GitLens 18. The measured race is in the post Git Worktrees for Parallel AI Agents; git, git worktree, checked November 2026.