Why do my agents keep overwriting each other’s files?

Because they share one working directory. Two agents in the same checkout read and write the same files, and neither git nor the agents themselves arbitrate: the later write silently replaces the earlier one, and the first agent keeps reasoning about a file that no longer says what it thinks. Prompting them to stay in their lane does not hold, because agents refactor across file boundaries.

The symptom to look for is an agent citing a version of a file that no longer exists, or a change you watched land reappearing undone a few minutes later. Check git status and git diff while both agents are running: if the working tree is moving under one agent’s feet, that is the collision. Full breakdown of the failure modes: why your AI agents keep overwriting each other’s files. For the setup that prevents it, see how do I stop agents stepping on each other in one repo.