Lanes
GitHub

Compare

Lanes vs git worktrees for parallel coding agents

In shortGit worktrees give each agent a separate copy of the repository, so agents cannot overwrite each other's files on disk, but their changes still collide when you merge. Lanes coordinates agents while they work: edits to the same file take turns, each edit is synced and published right away, and every agent is told what teammates are changing. Most teams running several agents use both: a worktree per agent, and Lanes across them.

Updated 2026-11-12 · Lanes 0.3.0 · Source on GitHub

The short version

Git worktreesLanes
Two agents overwrite the same file on diskPrevented: separate copiesPrevented: edits take turns
Two agents change the same file in their own copiesConflict at merge timeSecond agent waits, gets the first change synced, edits on top
One agent changes code another is about to callBroken build after mergeThe other agent gets a heads-up before it writes
Works across teammates' machinesNo, one machine onlyYes, one server for the team
Shows who is working on whatNoYes: VS Code, browser app, CLI, MCP
Changes reach the other agentsWhen you mergeAfter every edit, through lanes/main
Setupgit worktree addlanes init, lanes team on
CostFree, part of gitFree, open source

What worktrees do well

A worktree is a second checkout of the same repository, on its own branch, sharing one .git folder. Give each agent its own and they stop stepping on each other's files: one agent's half-finished edit never breaks another agent's build or test run. That isolation is valuable, and Claude Code and other tools now create worktrees for parallel sessions.

Where worktrees stop

Isolation delays the meeting point. Every worktree's branch has to merge back, and everything the agents did not know about each other shows up then:

  • Two agents that changed the same function produce a merge conflict, and a person resolves it after both agents' context is gone.
  • An agent that called a function another agent renamed produces code that merges cleanly and does not build.
  • A long-running agent drifts further from the other branches the longer it works.

Worktrees also exist only on one machine. Teammates on their own laptops are outside them entirely.

What Lanes adds

Lanes works while the agents work, across checkouts and machines:

  • Before an edit, the agent takes a one-edit lease on the file. If a teammate's agent holds it, it waits about a second, the teammate's change is synced into its checkout, and it edits the current version.
  • After each edit, the change is committed as the person who owns the agent and pushed to lanes/main, so every other agent starts from it.
  • With lanes team on, each agent gets a short brief of teammates' tasks at every prompt and a heads-up before it reads or edits a file a teammate is changing.

In Lanes' benchmark, two agents in separate clones collided on a renamed function in 6 of 13 runs without shared context, and in none of 10 with it.

Use both

Keep a worktree or clone per agent for isolation. Add Lanes for coordination. Lanes' hooks are committed to the repository, so every worktree picks them up, and the same local server coordinates all of them.

git worktree add ../app-api -b api-work
lanes init --agents claude
lanes team on

Questions

Should I stop using worktrees if I use Lanes?

No. Keep a worktree or clone per agent. It keeps each agent's builds, tests and half-finished work separate, and Lanes coordinates the agents across those checkouts.

Does Lanes work across different machines?

Yes. Worktrees only exist on one machine. Lanes coordinates agents on teammates' laptops through one server and your shared git remote.

Is Lanes slower than plain worktrees?

The check before an edit adds 39 ms on Linux and 68 ms on Windows at the 95th percentile. A wait happens only when a teammate's agent is editing the same file, and it usually lasts about a second.