Today I broke the PM strategy repository.


I’m used to opening multiple terminal windows to work: one running Codex to research strategies/data, another running Claude to push other tasks, and another handling miscellaneous items. Gradually, I end up opening several terminal windows. I thought they each worked independently.
As a result, both were editing the same .ts file, and the git status exploded into chaos, taking two hours to fix.
Everyone’s talking about how multi-agent systems coordinate. Few discuss what it looks like at the git level.
Two agents in git’s view = two me’s. They step on each other’s toes in the same file, branch states clash.
The fix isn’t in the prompt, but in the repository structure.
I established a new ironclad rule, four points:
1. High-risk repositories are forbidden from direct edits in the main repo; the main repo should be a clean base.
2. Each task gets its own worktree, slug = strategy number + action (h12-cancel-sync / pnl-script-v8).
3. Add a worktree_path field to the active-tasks JSON, grep for duplicates before opening a second window.
4. When done, return to the main repo, delete the worktree + delete the branch.
I first tested this on a single project for a day with zero conflicts. Then gradually expanded to other projects.
The hardest part of multi-agent systems isn’t how they communicate, but making sure they don’t fight.
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pin