Stop Your AI Agents from Brawling Over Code

blaizedsouza · x · 2026-07-16

When two AI agents modify the same codebase simultaneously, they tend to overwrite or rollback each other's changes, eventually turning into 'debugging the agents rather than debugging the code.'

The solution in the post is straightforward: instead of heavily relying on worktrees or orchestration frameworks, put a notes.md file in the repo that both agents can write to, and include a set of collaboration rules in each agent's prompt: if you see file changes that weren't made by you, assume it's the other agent's work; use notes.md to leave messages about what you're changing; don't block the other agent; resolve conflicts together; delete your notes when done. This way, multiple agents can coordinate without fighting.

Original post →

More from coding & agent

coding & agent channel →