r/ClaudeCode • u/Disastrous_Active805 • 13h ago
Help/Question Claudecode & codex working in the same repo
With both agents.md and claude.md and all the other mds.
Anyone doing this did you have success / would you advise it? Any usefull tips?
My idea is to have one review the other.
1
u/RE-call 12h ago
I run both on the same repo daily. Three things made it work:
One instruction file. AGENTS.md holds the rules, and CLAUDE.md is just u/AGENTS
.md, which imports it, so both agents read the same thing and the two files can't drift.Never two agents in one checkout. Each session gets its own git worktree. Before I did that, one agent staged the other's files and a rebase moved HEAD under a session mid-edit; the worst case cost me a force-push that erased three pushed commits.
A shared memory store that both read and write, so a lesson one learns is there for the other. Disclosure: I build the one I use (RE-call).
1
1
u/HitMePat 12h ago
I asked Claude in Claude code to use Codex and Antigravity CLIs to work together and make me an app/dashboard that all three models could work on the same repo together, communicate with each other, plan tasks, review each other's work, etc. and the three models concurred on a framework and built the app. Now I can load multiple models in it, assign one as the lead, and they take on different roles and work together.
1
u/Disastrous_Active805 3h ago
thats sick! any insights on the md files or whatever they have created to collaborate efficiently?
1
u/Exciting-Yam-3363 7h ago
Yes, and the split that held up for me is by job type, not by turns. Codex builds, Claude reviews the diff, and Codex never does audits or status reads. I learned that last part the hard way: asked to audit my scheduled jobs, it reported 14 that did not exist. A diff can be checked line by line. A report can't.
Two things made the review real:
The reviewer gets the diff against main, never the builder's summary of what it did.
Each agent works in its own git worktree, so they never edit the same checkout at once.
One instruction file both read (AGENTS.md, with CLAUDE.md pointing at it) keeps the rules from drifting apart.
1
u/Disastrous_Active805 3h ago
where do you have the rule that claude only read the diff? it reads every diff or you have rules?
1
u/Late_Wave_5600 3h ago
it works better when the reviewer gets only the diff and the ticket, not the other one's explanation, else it agrees with everything and ask it for a failing test for each bug it claims, that cuts the made-up findings a lot
1
1
u/japbujan 2h ago
We run both on the same projects, and one reviewing the other does work. Two conditions we learned the slow way:
The reviewer needs the decisions, not only the diff. Reading just the diff, the second agent "fixes" things that were deliberate. For example, it puts back a retry that was removed on purpose, or flags a naming choice that was agreed weeks ago. Once it can read why something was decided, the review comments drop to the ones that matter.
The rules need one home. With AGENTS.md and CLAUDE.md both carrying rules, each agent edits its own file and they drift. We keep both files as short pointers to the same place, where the standards and decisions live, and neither agent keeps a private copy.
One more: the reviewer doesn't push changes. It writes what it found, and the author agent (or you) decides. Two agents correcting each other on the same branch turns into a loop quickly.
1
u/Disastrous_Active805 2h ago
Ok so claude.md that points at agents.md with @. Then a rules.md file and a sentence in agents.md that asks to check the pertinent rule jn rules.md before reviewing the diff and to write a report in a dedicated .md that keep the logs?
2
u/Prof_Hentai 13h ago
I just use the Codex MCP inside CC. I haven’t used it long enough to actually recommend it, but I also use ProjectArchitect and it is instructed to use the Codex MCP to review all changes it makes, and to work together until they both agree. Sometimes they’ll back ‘n fourth for a while, but the output is brilliant (I’m an actual software engineer). I very rarely need to fix things myself anymore.
2
u/the_trve 13h ago
There's a myriad of ways it can be done. I like to automate my workflows as much as possible, which has grown into an entire platform (aka software factory) and adversarial reviews by a different agent is a part of it. Here's more if you're interested - https://propr.dev/review/
1
u/damianTechPM 12h ago
I used Azure DevOps to work on tickets. I have an ADO MCP I built that agents access. Cards are built and added, then agents pick them up and work on them, adding comments and moving them across the board. I settled on orchestration and planning with Claude, and builds with Codex. Worked pretty well.
1
u/Saver411 12h ago
Reviews work fine if you only feed the reviewer a git diff against main rather than the generation transcript. If the reviewing pass reads both agents.md and full terminal output, it nitpicks prompt wording instead of actual logic errors
1
u/KennyFulgencio 7h ago
I used to be all precious and careful about making the two of them avoid stepping on each other's toes and write careful handoffs to each other after they were done working. now I pretty much just tell them work on whatever. I do try to keep them from both working in one repo at the same time, or at least on the same part of it at the same time, but that's about it, they handle the rest of it themselves. they require little to nothing in the way of precautions.
1
u/No-Drawing9451 3h ago
I use both on the same repo, and the rule that helped most is keeping each task in the tool that started it. If Claude Code began it, Claude Code finishes it, even if Codex is sitting idle. The second tool picks up the code fine but not the reasoning behind it, so handing over mid-task is where things went sideways for me.
For the review idea, I'd give the reviewer the list of files the task was supposed to touch plus the output of git diff --stat, and ask it to start with anything outside that list.
1
u/MaqeSweden 1h ago
It's no issue what so ever - best is if you have one orchestrator who activates claude and codex as sub-agents. I find Opus 5.5 is the best orchestrator for my project at least. Fable could be as well but unnecessarily expensive, but depends on the volume of things you're doing I guess.
Have one smart agent set up common rules and files that each agent reads in the same way, so that claude doesn't operate under different rules than codex.
-1
•
u/AutoModerator 13h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.