Two agents rewrote the same file twenty minutes apart.
No error, no conflict, no warning. The file simply went back to what it was.
Running two AI agents at once on the same project looks like a matter of opening two terminals. It works for about twenty minutes. Then one of them rewrites a file the other had just changed, and the lost work shows up nowhere.
That is what makes the failure expensive: it is silent. No error message, no conflict, no alert. The file simply goes back to what it was. You find out half an hour later, when a passing test starts failing, and you spend another half hour hunting a bug that never existed.
Why two AI agents overwrite each other
An AI coding agent does not work in transactions. It reads a file, thinks, and writes the whole file back with its own version. If two agents read the same version and wrote at different moments, the second one erases the first without ever knowing the first existed.
Neither agent did anything wrong. Both did exactly what they were asked. The problem is that they were standing on the same ground.
How to isolate each AI agent in the same repository
Every serious tool in this category solves it the same way, and it is worth understanding why: each agent gets its own copy of the project, on its own line of work. Git has a name for this, a worktree, and it is a real copy of the code on disk, tied to the same repository and to a separate branch.
In practice agent A and agent B never write to the same file, because there is no same file. There are two. And when both finish, you decide what goes in, with Git showing the difference side by side. That is exactly when a collision should surface: at merge time, in full view, instead of mid-work and hidden.
How CanvasCode isolates each AI agent
In CanvasCode the isolation is built in, and the difference is in what you can see without asking.
Every AI agent that goes off to work shows which line of work it is on, right on its own panel, next to the pull request status. You look at the canvas and know who is where, without running a command.
When two fronts start touching the same file, the warning comes first, not after. And when an agent finishes and is dismissed, its copy is not left lying around on disk: the app clears what is left and tells you what was still missing.
Isolation is also your call, not a rule imposed on you. It can be on everywhere, off for one specific project, and the instructions agents receive about working in isolation are text you write, not a constant buried in the program.
I wrote the full version, with the parts that did not fit here:
https://canvascode.app/en/news/run-multiple-ai-agents-same-project-without-conflicts
Top comments (0)