r/github • • 1d ago

Showcase Running multiple AI coding agents on one repo sucks. I built a fix

The title says it but I'll explain briefly.

Like a lot of people this year I went from one coding agent to several. Claude Code in one terminal, Codex in another, Cursor on the side. Writing code got really fast. Merging it got really painful.

I thought it was just me, so I looked around. It's everyone. Worktrees everywhere, agents overwriting each other, PRs that pass on their own and break main together, and me sat in the middle rebasing all day.

So I spent the last few months trying to fix it. The main problems I kept hitting:

- two agents edit the same code and nobody knows until the merge fails

- every merge changes main, so every other branch goes stale and has to be fixed and retested

- changes that are fine alone break when combined

- the review queue fills up faster than anyone can read it

I tried to solve all of these with Switchyard.

Each agent gets its own task. If two of them touch the same code they both get warned while they're still working. When work is done it gets tested together with everything else that's ready, and it all lands on main in one push. If one change breaks the batch, that one gets sent back and the rest still merge.

It works with Claude Code, Codex, Cursor or plain Git, and GitHub stays your source of truth.

I'd love some honest feedback on this, especially from anyone running more than a couple of agents. I'll personally help anyone who signs up get it working on their repo.

switchyard.so is the site. All the best!

0 Upvotes

6 comments sorted by

1

u/Kroosn 1d ago

I’m not entirely sure you know how worktrees work. There is no agents overwriting each other. You just merge the worktree back to a development branch then do a PR from that to your main.

1

u/IntrepidResearch8448 1d ago

What they don't do is tell you two worktrees changed the same function before you merge, or test them together. Each one passes on its own and the dev branch still breaks when they combine. Fine at 2-4 sessions, painful past that or across a team.

1

u/Kroosn 1d ago

You are trying to solve a problem devs solved decades ago. The fact is you don’t have two sets of tests is the problem. That you aren’t diff’ing the tests is a problem. You need two sets of envars to direct to separate test db’s etc.

You will get agents clobber each other at some point. You will slow down because tests can’t run simultaneously and your test fixtures can’t easily be duplicated.

1

u/IntrepidResearch8448 1d ago

ok, so going through your points:

Separate envs and test dbs: every check runs in its own container with its own env, thrown away after. Two runs never share a db or fixtures, so there's no second set of env vars to manage.

Tests can't run at the same time: they do here. Each run is its own machine, so 10 can go side by side.

Agents clobbering each other: each agent gets its own copy of the repo and a key that can only push to its own task. It can't touch another agent's work or main.

Solved decades ago: yes, for people. Isolated CI and merge queues are old and I'm using both. What they don't cover is two agents changing the same function at the same time with nobody watching. Here both get warned while they're still working, and ready changes are tested together before they reach main. If the batch breaks, the bad one goes back and the rest carry on.

So nothing new in the parts. What's new is running it for 10+ agents without a person lining everything up by hand.

1

u/Kroosn 1d ago

Maybe I have been overly harsh but best of luck. But I can't imagine anyone doing this for work is going to use a closed source unknown project. But it's more poignant that all these things you are saying are struggles aren't for any experienced dev which you sure want to be if you are running 10 agents on a single repo.

I assume this is a tool for pure vibe coders but then they will probably just ask claude and he will figure out worktrees for them.

1

u/IntrepidResearch8448 1d ago

Thanks for the comments; it made me think a little more about making certain parts of the system more clear.

What I can say is GitHub stays your source of truth the whole time, so if you stop using it your repo and history are exactly where they were. Permissions and what touches your code are all written up at switchyard.so/docs/security .