Run two AI agents against the same project folder and the failure mode is almost never a bad answer, it is one agent quietly overwriting the file another just wrote. Orchestrating multiple AI agents on a shared filesystem is really a coordination problem, not an intelligence problem. The agents are capable. What they lack, by default, is any awareness that a peer is editing the same bytes at the same moment.
Quick Answer
Give each agent a write domain it alone owns, let the others read but not write outside their lane, and route all merging through a single orchestrator. Directory ownership, file locks, and a shared task list solve the overwrite problem far more reliably than hoping agents avoid each other by luck.
Why shared-filesystem agents collide
A sub-agent setup like Claude Cowork lets several agents read and write the same files in one workspace. That shared visibility is the whole point, it is how agents build on each other's output, but it is also the source of three distinct failures.
The first is the lost write. Agent A reads a file, spends thirty seconds reasoning, and writes it back. Meanwhile Agent B edited and saved the same file. A's write lands last and silently erases B's change. The second is the half-read. An agent opens a file mid-write and parses a truncated, broken version, then reasons confidently from corrupted input. The third is the race, where two agents create or rename the same path and leave the project in a state neither intended.
None of these throw an error you will notice immediately. The work looks done. The damage surfaces later, which is exactly why prevention beats detection here.
Step 1: Assign write domains before any agent starts
The cleanest fix is directory ownership. Decide, up front, that one agent is the sole writer for a given area and the rest treat it as read-only.
- Map the project into non-overlapping zones, for example one agent owns
/api, another owns/frontend, a third owns/docs. - Write those boundaries into each agent's instructions explicitly, including the rule that it may read anywhere but write only inside its own zone.
- Keep tasks file-level where you can. Two agents editing genuinely separate files almost never conflict, so the more you split work along file lines, the less coordination you need.
This single discipline removes the majority of overwrites, because most collisions happen when two agents assume shared responsibility for the same file.
If your local machine is going to host this kind of parallel agent work, the hardware matters, and the AI-ready desktops at Evetech are specced for the memory and core counts that keep several models responsive simultaneously.
Step 2: Add file locks for the unavoidable shared files
Some files cannot be cleanly owned by one agent, a shared config or a central index, for instance. For those, use a lock.
- Before an agent writes the shared file, it requests a lock from the orchestration layer.
- If another agent already holds that lock, the requester queues and waits rather than charging ahead.
- The lock releases the moment the write completes, so the next agent in line proceeds against the updated file, not a stale copy.
Locks add a little latency, since agents sometimes wait, but they convert a silent data-loss bug into an orderly queue. For the handful of files everyone touches, that trade is almost always worth it.
Step 3: Coordinate through a shared task list, not chatter
Direct agent-to-agent messaging gets noisy fast and still does not stop two agents claiming the same job. A shared task list scales better. An orchestrator breaks the goal into subtasks, each agent claims an unclaimed task, executes it, and marks it complete. Dependency tracking means a task that needs another's output simply waits until that output exists.
This pattern keeps coordination centralised. Agents synchronise through the list's state rather than trying to negotiate with each other, which removes a whole category of "who is doing what" confusion.
When to reach for git worktrees instead
For longer-running or larger jobs, give each agent its own git worktree. Every agent gets an isolated checkout on its own branch, works without touching anyone else's files, and the branches merge at the end through normal version control. This trades a bit of setup and merge effort for near-total write isolation during the work itself, and it is the safest option when agents will run for hours rather than minutes.
Putting the pieces together
A robust setup usually layers these. Directory ownership handles the bulk of the files, locks protect the few genuinely shared ones, a task list coordinates who does what, and worktrees isolate the long jobs. You rarely need all four for a small task, but knowing which to reach for keeps a multi-agent run from quietly corrupting itself. A machine with headroom helps too, and the top-selling desktops at Evetech show the spec range buyers choose for parallel agent workloads.
Frequently Asked Questions
What is the single most common multi-agent failure?
File conflicts, by a wide margin. Several agents on one repository overwrite each other, read half-written files, or race to create the same path, and none of it announces itself loudly. Coordination primitives, not smarter prompts, are what fix it.
Do I need locks if I already use directory ownership?
Often no. Directory ownership handles files that belong to one agent, which is most of them. Locks are for the small set of shared files that genuinely need multiple writers, so use them surgically rather than everywhere.
Are git worktrees overkill for a quick task?
For a short job, yes. Worktrees shine on longer runs where agents work for extended stretches and you want full isolation before a single merge. For a few minutes of work on separate files, directory ownership alone is usually enough.
How does a shared task list prevent duplicate work?
Each task is claimed before it is executed, so once an agent takes a subtask, no other agent can pick it up. Dependency tracking also makes tasks that rely on earlier output wait until that output is actually present.
Can agents safely read files outside their write domain?
Yes, reading is the safe operation. The discipline is on writing, agents read widely to build context and write narrowly to avoid clobbering each other. Trouble only starts when an agent writes outside its lane.
Multi-agent orchestration rewards clear boundaries far more than clever prompts, so define your write domains first and add locks and worktrees only where the work demands them. If you are building a rig to run agents in parallel locally, explore the AI PC lineup at https://www.evetech.co.za/PC-Components/ai-pcs-445 and spec it for memory headroom.