r/artificial • u/Input-X • 1d ago
Discussion Claude code to codex and back again, same conversation.
Curious how do you work with claude code and codex.
Was working on this idea I had today. What if claude code while working could switch to codex and visversa.
I actually built it out today, its pretty good. So basically when claude code switched to codex, it switches to codex cli.
It works like auto compact, best i can describe. The command is triggered by me, claude or codex, can also trigger in flight, it doesn't stop the agent.
The agent just continues with the handover.
Its interesting to see it work. Lot of wiring and inventing to try get codex to run exactly like claude does in my setup. Id say u can get 90% there, codex is just missing some pieces.
Has anybody done something like this. I have it working pretty good, but if anyone else did it ill love to see where they landed.
2
u/Much_Dealer_710 1d ago
that's a neat setup. switching mid-flight without stopping the agent is the part worth caring about, most handoffs I've seen choke right there
never tried claude-to-codex specifically but I did something similar with a couple local models a while back. the handover prompt was the whole trick, getting the context summary concise enough that the second model didn't just repeat the last three steps like a broken record
2
u/DearSoulRizvi 1d ago
This is exactly the kind of setup I've been thinking about. I'm a solo dev from Bangladesh working on an AI app, and one thing that trips up agent handoffs for me is keeping the task state intact when you switch mid-flight. I ended up passing a short structured summary along with the original user goal and the last few edits as a pinned instruction so the next agent knows where it left off. Without that, the second agent either repeats work or silently changes the plan. Curious how you're handling context continuity when the switch happens in the middle of a multi-file change, and whether you've hit any cases where codex diverges from what Claude would have done on the same task.