r/codex • u/Seunghyeon413 • 6d ago
Showcase Claude Code asked Codex for a review, Codex found the bug, Claude fixed it. No copy-paste.
I run Claude Code and Codex side by side. tmux and herdr pass messages by typing into the other agent's terminal, so Enter lands on approval prompts and messages get stuck onto what you're typing. peer sends straight to each engine's own input path instead.
Where it's strong:
Both directions. Codex can message the Claude you have open, mid-task, not a separate
claude -prun.It lands in the live session you're watching. Queues if busy, never mixes with what you're typing.
You know right away if it was delivered, and why if it wasn't.
Works across machines by name (
peer say review@arch).peershows who's working and who's idle.No reading the other screen before and after sending: 2-3 fewer turns per message.
In the video: Claude asks Codex to review an auth change, Codex finds the bug, Claude fixes it, Codex approves. Real sessions, middle sped up.
macOS and Linux (Windows port: tandem). Start Codex with peer run codex.
To install, paste into Claude Code or Codex: Set up peer for me: curl -fsSL https://raw.githubusercontent.com/oesoll/peer/main/SETUP.md and follow it.
27
u/SphinxWar
6d ago
•
You know that both Claude and Codex can run each other through the CLI, right? You don't need to do anything to have it working from the start and it works on all systems.
2
u/offline-ant 6d ago
I've been using claude/codex in a similar method that OP has for almost a year now, and i think you're underestimating the utility.
It lets me look at what they're doing, it lets me tweak their guidance while they're working, and they can
askquestions.But an extremely valuable tweak i have - perhaps my most valuable tweak in my setup - is the following;
After they give their answer, the tool will automatically prompt the model with something like:
"Your answer has been saved, are there any other issues or noteworth things you found that you didnt include in the main answer. If there is nothing return with just OK."
and then append the result under a
## Retrospectiveheading to the caller.That alone is a superpower. The amount of speed-bumps, bugs, inconsistencies, etc i caught with that reflection stage on subagents is enormous. it's cheap, the model has it all in memory, and the payoff is every subsequent call doesnt have to trip over stuff.
1
u/Seunghyeon413 5d ago
Finally someone who gets it. I ran the same thing for about a year on smux, agents typing prompts into each other's CLI through tmux. peer is where that ended up: it hands messages to each engine natively, so each session keeps its context and whatever I'm halfway through typing stays put. Being able to watch them and step in mid-task is the whole point, not just getting an answer back. Stealing your retrospective prompt, by the way.
2
u/SphinxWar 5d ago
You can keep context even with spawning agents via CLI. The agent just has to pass a parameter with the conversation UUID and it will re-spawn a previous conversation. You can ask your AI to test it to see how that works.
1
u/Seunghyeon413 4d ago
Resume by UUID starts a second, headless process on that conversation. The Claude you have open in your terminal never sees that turn, and you can't watch it or step in. peer puts the message into the session that's already open, the one you're looking at. That's the whole point.
Makes sense it looks the same if you've never kept a few agents running side by side for hours.
0
u/SphinxWar 5d ago
Can't you do that with hooks? For example, I added a pre-compact hook to my claude config that tells the compacting agent to tell the model after compaction that it should re-load relevant skills if the compacting agent notices that the conversation was about a specific topic. Couldn't you do that for those retrospectives with a custom hook on a codex / claude CLI call?
0
6d ago
[deleted]
3
u/spigolt 6d ago
I just tell my Claude to discuss with Codex all the time in various ways, e.g. they go back and forth a few times until they agree etc etc. Most of my work involves getting the two of them to work together. This all just works without any special setup whatsoever.
1
u/mt-beefcake 6d ago
For fun I did this with astra and fable set to max effort. One of those weeks with resets on both accounts qued up for when they burned through the weekly. They made a master plan to rebuild one of my projects. They went back and forth quite a bit
1
u/Asly97 5d ago
When you get them going back and forth, how does each one know the project background? Does Claude brief Codex at the start of every exchange, or do you keep one shared AGENTS.md / CLAUDE.md that both read so neither starts cold?
1
u/SphinxWar 5d ago
If they run each other via CLI they spawn a process for each other, but some people might not know that the CLI process accepts a previous conversation ID as a parameter. This means they can spawn each other at any point from the end of any previous conversation, even after a full reboot. This means both models keep context. You just gotta tell them to do so, preferably in global CLAUDE.md / AGENTS.md files (if that's what you want for all projects) so that you don't have to repeat yourself.
1
u/Asly97 5d ago
Didn't know the CLI took a previous conversation ID, that's handy. So Claude can pick up the exact Codex session it talked to last time instead of starting a fresh one.
Does that hold up once a session has been compacted a few times? I'd guess it still has the thread but loses some of the reasons behind earlier calls. And when you do start a brand new conversation, is the global CLAUDE.md / AGENTS.md the only thing carrying the project over, or do you keep notes somewhere else too?
5
u/throwaway490215
6d ago
•
I'm endlessly fascinated by the claude and codex subs for re-inventing the wheel, spending time and effort to make a slick visual sales pitch, and presenting it like a leap forward, but never asking the models to find projects with similar utilities.
I'm not faulting you for sharing cool things you build - but i am faulting you for wanting to present it as groundbreaking.
Also, telling the models that its another model prompting offers nothing extra. If you've watched the models interact you can see they have enough experience in and from their training that they can tell if its a human or an AI written input prompt.
1
u/Seunghyeon413 4d ago
I did look. tmux and herdr type into the other terminal, exec/resume runs a separate headless copy, T3 makes you move into its app. None of them let the Claude Code and Codex you already have open talk to each other, both ways. That's the gap.
And the "from @review" tag isn't there so it knows it's an AI. It's the return address, so it knows who to answer.
Kind of a shame to call it reinventing the wheel without having run agents like this.
1
u/throwaway490215 4d ago
Oh then i misunderstood. I thought you were doing a hierarchy and communication wasnt going back and forth..
That pattern of cross communication is a complete waste of tokens. Claude code implemented it as AGENTS_TEAMS or something more than half a year ago (after various opencode/pi plugin build something similar).
Anthropic never took it out of the experimental phase - because they also tested and realized that kind of "LARPing as a team" doesn't actually improve anything.
1
u/Seunghyeon413 4d ago
They're not in stable harnesses yet because most coding doesn't need them, not because they don't work. Codex already has an agent_message_board flag in development (codex features list), and Claude Code has agent teams. Both vendors are heading this way.
On tokens it's the opposite. Split by role, each agent keeps one domain's context instead of one agent hauling everything, they run in parallel, and a message is one line. And Claude and Codex checking each other is two different models, not one model LARPing a team.
Not needing it yet doesn't make it LARP.
1
u/throwaway490215 4d ago
You do you, but from my experience the following two tools are enoug:
the ability to fork a conversation as a tool that returns the final answer.
the ability to spawn a new agent as a tool and return their question.
with an argument to set the model.
Its not about the tool call being expensive, its about both agents having to spend reasoning tokens to think through what the peer wants and why and what to tell them what they themselves want and how to tell it.
This kind of orchestration scheme is the "I build a new JavaScript framework" equivalent of AI.
A hierarchy where the parent agent just directs the subagent is more efficient. Not only is there only 1 agent dealing, but they use the tool like every other tool.
The tool responses with an answer instead of being a trigger for having to think through the situation.
The "agent plays out a role in a team to focus on their domain context" is really not a new idea - many people & projects have tried it.
Its the kind of idea you sell to people who dont actually build these things. Its so old by now that the fact that no serious project has it on by default is proof enough that it's not worth it.
But by all means, see for your self. Its what almost everybody else did as well.
2
u/Spunge14 6d ago
This is in some way becoming true about everything - people just reinventing the wheel at a thousand miles an hour, blowing through tokens like candy.
But you have to imagine the world has always had this problem. Every company around the world reinventing the same utilities, writing the same documents.
Nothing has ever been efficient. But now it's hyper efficiently not efficient.
2
u/jildos_legoplanet 6d ago
You can use herdr.ai for that
2
u/Seunghyeon413 6d ago
Different plumbing. herdr still types into the pane. peer never touches the terminal, it uses Claude Code's inbox and Codex's app-server. That's the whole point.
4
u/N_GHTMVRE 6d ago
Looks cool, but pretty sure T3 does this natively and the task can be explained via prompt too, unless you mean something else
4
u/Tommonen
6d ago
•
I tell claude to control codex all the time, no need for anything extra, just ask claude to do it and it will.
So whats the point of this?
1
u/ApicalNoon 6d ago
It looks like this uses the Codex App Server (https://learn.chatgpt.com/docs/app-server) for GPT communication?
I have a similar script, though mine is one-way - I always use Claude as my orchestrator and allow it to have two-way conversations with GPT. I don't need GPT to start Claude sessions.
How did you solve the problem of one rogue GPT session taking down the others? I initially naively spawned a single App Server for all GPT sessions, but this meant that a single GPT session that's killed by the OS (e.g. an OOM for using too much memory) could take down the whole App Server and all sessions running under it.
I had to resort to starting an ephemeral App Server per GPT session so that an OOM for one session didn't kill the others.
Then there's the whole issue of sandboxing and securing the GPT sessions - after an admittedly cursory glance at your code, I'm not seeing where you're handling this? I deal with this by running each ephemeral App Server under Bubblewrap and setting resource limits with systemd (I'm on Linux).
1
u/Seunghyeon413 5d ago
Yep, app-server. Same lesson here: peer run codex starts a private app-server per Codex TUI and kills it when that TUI exits, so one session getting OOM-killed doesn't take the others down. Sandboxing I leave to Codex itself. peer doesn't add its own, each session keeps whatever sandbox/approval mode you started it with. bwrap + systemd limits on top is nicer than what I do, honestly.
1
u/LunaProjectStudios 6d ago
“When you get paired up with the dumbest kid in class for a group project and it's his turn to present.”
1
-1
-1
u/Rare_Comfortable88 6d ago
does this will work on windows?
1
u/Seunghyeon413 5d ago
Not yet, macOS and Linux only. Someone ported it to Windows though: github.com/Lampe332/tandem
•
u/dexterthebot 6d ago
You might want to consider listing your project on the weekly Show-Us-What-You-Built post. Look out for it on Tuesday/Wednesday. Highest commented project wins a week promotion on r/Codex and gets on the Hall of Fame sidebar. See below for last week's winner.**
Light Wars AR: real-life laser tag app with no extra gear. Your phone is the gun and your room is the map. Play up to 6 friends in the same room, or fight drone waves and bosses solo. The vision models run on the phone, and camera frames never leave it. Free on iPhone and Android.
Website: https://lightwarsar.com
iPhone: https://apps.apple.com/us/app/light-wars-ar-laser-tag-party/id6508168951
Android: https://play.google.com/store/apps/details?id=com.lasertag.lightwars.
Contact: [email protected]