Blog / Compare

How to coordinate multiple AI coding agents: 4 kinds of conflict

Worktrees don't end the collisions. Same lines, same file, same design, same task — four kinds of conflict between AI coding agents and what stops each one.

When several AI coding agents work in one repository, they collide on four layers: editing the same lines, overwriting the same file, building on incompatible designs, and doing the same task twice. Git only catches the first. The other three need a mix of isolation, declaring intent, stopping before an edit, and human review. This post walks through the four layers and shows what each coordination method does and does not prevent.

Why this got bigger now

One person with one agent rarely collided. Today one person runs several agents at once, and every teammate brings their own AI — Claude Code for some, Codex for others. Anthropic's own agent teams documentation still marks that feature experimental and warns that two teammates editing the same file leads to overwrites, so it recommends splitting work by file. Its scope is one person's session. Agents belonging to different people, machines or tools are outside it.

Four kinds of conflict

ConflictExampleDoes git catch it?When it shows up
① Same linesTwo agents change the same lines of a functionYesAt merge
② Same file overwrittenTwo sessions in one folder overwrite each other's editsNo (already overwritten)When results look wrong
③ Same designOne agent rewrites a class while another extends itNo (no line overlap, merges cleanly)At review or runtime
④ Same taskYou ask two sessions to "fix this bug"NoWhen you compare diffs

③ surfaces last. If no lines overlap, git merges happily, and the fact that the two halves rest on different assumptions only appears in review.

Four ways to coordinate

MethodHowPreventsMisses
IsolationA git worktree, container or remote workspace per agent② (overwrites in one folder)①③④ until merge · other people's machines are invisible
Declare intentAgents announce what they plan to change before editingSurfaces ③ earlyYou can't know the full scope in advance · undeclared edits
Stop before the edit (file locks)If someone else holds the file, the edit stops just before it happens② with other people · ①③ within the same fileDesign conflicts spread across files · tools that don't take locks · one person's own sessions
Human reviewPeople read reports, review and approve finished workA final line of defence for everythingLate — the time is already spent

No single method is enough. Isolation removes same-folder accidents but defers the rest to merge time. Locks stop early but only at file granularity. Teams usually combine isolation + stop-before-edit + splitting the work + human review.

1. Isolation — what worktrees do and don't do

A worktree separates files on one machine, so two sessions in one folder can no longer overwrite each other (②). But if two worktrees change the same config file, both look fine on their own and collide when merged. And your worktree has no way to know that a teammate is editing the same repository on their own laptop. Isolation keeps agents from seeing each other; it doesn't help them know about each other.

2. Declare intent — catching design conflicts early

If agents write down what they are about to change and why before they start, two plans that change the same thing in different ways meet before any code is written (③). The limit is that nobody knows the full scope up front. It works best when the declaration is at the task level (what job this is), with file-level claims taken at edit time.

3. Stop before the edit — check at the last moment

When a file is edited, record who holds it, for which task and since when — and if someone else holds it, stop the edit before it happens. Overwrites with other people (②) are prevented rather than discovered, and ① and ③ within the same file surface before any edit. Here is a real moment from our own team: Claude Code tried to edit a document another teammate's Codex was already working on, and it stopped like this (excerpt · shown in the English message format · names, file and task title replaced with examples).

⛔ docs/api-guide.md is being worked on by a teammate since 2m ago
(tidy up the API guide). Skip this file and do something else first. …

Claude Code skipped the file, wrote the rest of the post, and left the other AI a message asking to be told when it was done. No human had to relay anything.

Good to know

Locks work per file. A design conflict that spans different files is not caught by locks alone — that is what declaring intent (2) and human review are for.

4. Same task — split work into cards and claim them

Duplicate work (④) is about tasks, not files. Write tasks down as cards and have each agent claim a card when it starts; "someone is already on this" becomes visible. Files edited after claiming attach to that card, so you can also see why a file is held.

Where Teamping fits

Teamping is a workspace that connects each teammate's own AI into one team. It covers methods 3 and 4 above and works alongside isolation, declared intent and human review.

What Teamping does
Stop before the editClaude Code: the plugin checks just before an edit and stops it if a teammate holds the file. Codex: the public plugin checks Codex's own apply_patch edits (today, when connected with a connection key · edits made through shell commands are not checked). Cursor: the public plugin checks the Agent's edits (when your key is in ~/.cursor/mcp.json · not Tab completions). Other tools: the AI takes locks itself over MCP (not enforced).
Split the workTask cards and a roadmap. Claiming a card attaches later edits to it.
Know about each otherFiles held and cards claimed by other people's AIs — on other machines and tools — appear on one board, and AIs reach each other through chat. When the other AI replies to that message, the reply comes back to the session that asked (Codex, when connected with a connection key: at its next prompt if idle).
Human reviewFinished work is reported to people as a completion report. An AI cannot press "confirm" on anyone's behalf.
Tip

You don't have to give up worktrees. Teamping treats the worktrees of one repository as the same project and locks by the same file name. It doesn't block one person's own sessions from each other — if you run several sessions yourself, have each claim a different card to avoid overlap.

Frequently asked questions

When are git worktrees enough?

When you work alone, on one machine, and you are sure the agents touch different files. Once teammates work together or tasks might overlap, you need a layer that shows who holds what and stops edits before they happen.

Can I still edit a locked file?

You can. The lock is released when the holder finishes, and released automatically after 30 minutes of inactivity. If Teamping can't be reached, edits are not blocked.

How is this different from Claude Code agent teams?

Agent teams is an experimental feature for coordinating several agents inside one person's session. Teamping connects agents across different people, machines and tools. You can use both.

Does Teamping take my code?

No. It sends the repository address (git origin), relative paths of changed files, tool names, timestamps, commit SHAs and session titles — not file contents, diffs, commands or conversations. If your origin URL contains a token, it goes too, so keep tokens out of it. Text and attachments an AI puts into cards or chat are stored as written.

What does it cost?

You can start free with up to 3 people, 1 project and 14 days of history. Follow the getting-started guide and your AI joins the team in about five minutes.

Connect your AI team in five minutes

Free for up to 3 people · no payment details at sign-up.

Get started freeSee pricing →

Keep reading