Why AI coding agents on one team keep stepping on each other
TL;DR Agents on one team cannot see each other's planned changes. Clearance asks each agent to declare an intent before it edits, then warns about overlap and duplicate work, and I am measuring whether those warnings save more tokens than they cost.
When one developer runs one AI coding agent, the agent only has to avoid breaking the code in front of it. When five developers on a team each run their own agent, a new problem shows up. The agents work in parallel, usually on separate branches, and none of them can see what the others are about to change.
You find out at merge time. Two agents rewrote the same function. A third rebuilt something that another agent merged an hour ago. Every token spent on the losing side of that collision is gone, and a person has to untangle the result.
I am building a service called Clearance for my final-year research project. This post covers the idea, how it works, and the question the project has to answer. Two diagrams follow: the parts of the service, then one agent session from start to finish.
Declare before you edit
The name comes from aircraft asking the tower for clearance before take-off. Before an agent starts editing, it publishes an intent manifest: a short description of the goal and the files and symbols it expects to change. The manifest is plain structured data, so the service can compare it with everyone else's.
Clearance is one team-hosted Rust service that sits between the agents and the code host. Agents never talk to each other. Every message goes through the server, which decides who needs to know.
Agents reach the server two ways. The MCP endpoint offers six tools, and the editor hooks for Claude Code and omp call a separate hook endpoint with event JSON. Both feed the same core.
Repository events reach the core through an EventSource. Experiments run on a git-native backend, and GitLab is an adapter that takes webhooks, so the core itself knows nothing about GitLab.
The core keeps its state, vectors and audit log in PostgreSQL with pgvector. A team lead can read it through a terminal dashboard.
Cheap checks first
Every warning has a token cost, because the agent has to read it. If Clearance asked an LLM to judge every pair of plans, the coordination could cost more than the collisions it prevents. So the service starts with cheap methods: static analysis, BM25 text search and local embeddings. The LLM only spends tokens on what those checks cannot settle.
A session from start to finish
A session runs in a fixed order. The agent opens it with start_session, which returns a handle, any duplicate candidates and the current digest. It then calls declare_intent with its manifest, and Clearance answers clear, advisory or hold, along with the overlaps it found.
When a manifest arrives, Clearance compares it with every live session and with recent merges. It warns about three things:
- Overlap, where two agents plan to change the same file, the same symbol or the same shared interface.
- Duplicated work, where a new task looks like one that another agent is already doing.
- Merged changes, where something that merged recently touches the scope an agent is working in.
The warnings reach agents two ways. Six small MCP tools are the main surface, and editor hooks for Claude Code and omp add a check right before an edit. The warnings ride on responses the agent already receives, which keeps them short and capped in size.
That check runs before every edit. It allows the edit and attaches any warnings. After the edit, a second hook reports what changed (path, hunk and symbol), and the next response carries a digest if the change is new and relevant to someone else.
When the default branch advances, any agent whose scope the merge touches gets a warning in its next digest. The agent ends the session with an outcome and its token usage, and Clearance records how accurate the declared scope was and releases the session's leases.
Advisory and fail-open
Clearance warns and never rewrites anyone's code. If the service is down, the agents carry on and the outage is logged. The only hard stop is an edit to a file that another live session holds exclusively.
The question the project has to answer
Plenty of tools already offer file claims or messaging between agents, so the interesting question is whether any of this pays for itself. Do the tokens saved on superseded work, conflicts and rework outweigh the tokens spent on coordination? My main measure is net tokens per merged work item, and I want to find the overlap rate at which coordination breaks even.
To test it, I built a set of 1,044 labelled scenarios, covering pairs of agents, groups of three or four, file-disjoint controls and reworded duplicates. The first tier replays all of them through the real service with scripted agents, which costs no tokens. The second tier runs live multi-agent sessions on a smaller sample, with and without Clearance, so I can count the tokens.
One limit applies to the whole evaluation. Constructed scenarios show what Clearance does when overlap exists. They say nothing about how often overlap happens in real teams, which is why the break-even rate matters: a reader can plug in their own team's rate.
Where it stands
The proposal is submitted and the evaluation set is built. Implementation runs through March 2027. If the warnings do not save more tokens than they cost, that is a finding too, and I will report it as one.
The project page is at /projects/clearance.