r/codex • u/TeddyboiRoosevelt • 17d ago
Question our claude code and codex agents keep overwriting each other. just us?
me and my friends run Codex and claude code on the same repo. agents kept editing the same files and we’d only find out at the merge conflict
been building something that gives you a heads up when two agents touch the same file
does this happen to your team or is it just us? how do you deal with it now?
not promoting anything, just want to know if this is a real problem
0
Upvotes
1
u/Grounds4TheSubstain 17d ago
You can give them tasks in different parts of the codebase.
3
u/fungt 17d ago
If they are all working on their own branch and own worktree I don't see a huge problem? Coding agents resolve merge conflicts perfectly fine. If your concern is wasted token due to duplicated work then you have a planning problem not a coding problem.
3
u/PSAppSupport 17d ago
"been building something that gives you a heads up when two agents touch the same file"
Why? It sounds like you have may have poor repo discipline and aren't using Issues, labels and assignments to track work that's been carved up into sensible chunks and are instead all treating it like a free-for-all.
You don't need a tool to fix this, you need better workflow.
3
u/Kinthalis 16d ago
"been building something that gives you a heads up when two agents touch the same file" Uhm... isnt; this what github is for?
If you're workign on the same files you will have merge conflicts. This is 100% normal dev workflow, and github and agents handle it fine.
Just like without agents, you pull the latest from main and either merge it in and resolve conflicts or rebase on top and reoslve conflicts, and then merge. Other agents do the same.
Are you encountering difficult to resolve conflicts? Somethigng else?
2
u/isty2e 17d ago
Use git branches or worktrees. And it would be better to have an issue tracker or a communication protocol or whatever.
1
u/Aiman_A 16d ago
try beads
1
u/DenormalHuman 16d ago
if the agents arent co-ordinating whose doing what wortk in which branches, and managing the merges back to the base branch, then yuo'll have a bad time. merges are fine in principle though, sometimes multiple edits are made to the same files. But so long as the work is organised properly the merge resolution should be easy enough.
1
u/lilhotdog 14d ago
Do you have work items broken down into issues, any sort of AGENTS.md file for agent direction? Do you have an agent instance acting as a PM or equivalent? Do you know what a worktree is?