Lanes gives each coding agent on a team a lease before it edits a file, so two agents can't write the same file at once. The obvious way to build that is a lock: if the file is held, refuse the edit.
That's what I built first. This post is about why I took it out, and what coding agents actually do when you say no to them.
(Part 1 covers what Lanes is. Part 2 covers the benchmark.)
Version 1: refuse, and let the agent re-plan
In the first spike, the hook before an edit asked the Lanes server for a lease. If another agent held the file, the hook refused the edit with a message: this file is being edited by a teammate's agent, try again shortly.
On the narrow question, it worked. Across 13 refused edits (Claude Code, Haiku):
- 13 of 13 agents respected the refusal.
- 0 tried to get around it through the shell. No
sed, noecho >, no Bash commands at all. - 0 overwrote a teammate's work.
- 9 waited, retried, and succeeded once the holder finished.
- 4 stopped and told their user that another agent held the file.
Those last 4 (31%) are the problem. An agent that stops and asks "what should I do?" turns a coordination tool into an interruption. The person who asked for a feature now has to read a message about another person's agent, decide something, and send the prompt again. That's worse than no tool for most people.
There was a second, sneakier problem. In some runs the conflict I was testing for didn't happen, and it looked like a pass. In those runs the refused agent had given up. It avoided the conflict by not doing the work.
Version 2: wait in a queue instead
The next decision was to stop saying no. When a file is held, the hook waits quietly in a first-come, first-served queue on the server. Claude Code shows a status line ("Lanes: coordinating with teammates…"), and when the lease frees up, the edit goes ahead. Before it does, the hook syncs the agent's copy so it edits the latest version of the file.
The first version of the queue held a lease for a whole agent turn, and queues stretched to minutes, with a real risk of two agents each waiting on a file the other held. So a lease now lasts one edit: it's released as soon as the edit is committed and published. A typical wait is about a second.
But this version still refused in three cases:
- the wait passed 90 seconds;
- the automatic sync failed;
- the Lanes server was unreachable (fail closed: no coordination, no edit).
Each one was rare. Each one was also a refused edit, with the same effect on the person behind it.
Version 3: never refuse
ADR-0019 removed all three:
| Case | Before | Now |
|---|---|---|
| File held by a teammate's agent | wait up to 90 s, then refuse | wait up to 240 s, then go ahead |
| Sync fails | refuse, "try again shortly" | go ahead; the edit is committed locally, so it can't be lost |
| Server unreachable | block, tell the agent to ask the user to start it | go ahead with coordination paused; the team views show "offline" |
Every "go ahead" is recorded for the team views. None of it is shown in the agent's conversation.
The cost is real. While the server is down, two agents can write the same file. I accepted that because of what happens next:
- A local server that isn't running is now started by the hook itself, so "down" is rarer than it sounds.
- When two edits overlap while coordination was off, the file moves to the newer shared version, the agent's own version is kept in a backup ref (
refs/lanes/backup/…), and that agent alone is told to apply its change again.
I tested that path on purpose: the server down for everyone, four agents writing the same lines. There were 5 re-applies, all completed by the agents, 12 of 12 tasks done, and nothing lost.
The words matter as much as the mechanism
Taking refusals out wasn't enough. Agents also stop because of how a message is worded.
- Never say "stop" or "tell the user". Agent-facing text from Lanes says what happened and what to do next, never that the human needs to be involved.
-
Explain commits the agent didn't make. Lanes commits each edit automatically. In one scenario I asked agents to check
git logafter their task. Without a note, 8 of 8 told their user the commits came from "another session" or "someone else". With a one-line note at session start saying those commits are the agent's own, 0 of 8 did. - Say when nothing needs checking. One agent wrote "Please check that those edits are the ones you expect" about a teammate's change it had been synced. I changed the re-read note to say the new content is coordinated automatically and needs no checking. The rerun: 18 of 18 tasks, 0 asks.
What it adds up to
Across the benchmark, with edits queued and never refused, 1 of 216 sessions stopped to ask its user something (0.5%). With refusals it was 4 of 13 (31%). The two samples aren't the same scenarios, so read that as a direction, not a precise ratio. The runs are all in the repo.
There's one place Lanes still holds an agent back, and I want to be upfront about it. With team context on, at the end of a turn, if a file the agent read or imported changed underneath it, the agent is asked once to re-check before it stops. That's a nudge at the end of a turn, never a refused edit, and it fires at most once per turn.
If you're building tools for agents
- A refusal is a question to a human. Agents treat "no" as something to report, and the person who gets the report usually can't do anything useful with it.
- Prefer waiting, then going ahead. An agent that waits a second loses nothing. An agent that stops loses the whole turn.
- Fail open, and make it recoverable. Losing coordination for a moment is better than a stuck agent, if no work can be lost while it's off.
- Count how often agents ask their user. It's the cheapest metric to collect and the one people notice first.
Lanes is open source (Apache-2.0) on GitHub, with a live demo at trylanes.app. The decisions behind this post are in docs/design.md.
Top comments (0)