Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 3 min read

How to make Claude Code and Codex talk to each other (4 ways, and when to use each)

Running Claude Code and Codex on the same project is common now: one writes, the other reviews. The annoying part is being the courier, copying output from one terminal into the other. There are four ways to cut yoursel

Running Claude Code and Codex on the same project is common now: one writes, the other reviews. The annoying part is being the courier, copying output from one terminal into the other.

There are four ways to cut yourself out of the loop. They suit different situations, so here they are side by side. The commands were checked against Codex CLI 0.174 and the current Claude Code.

1. Call one from the other's shell

Both have a non-interactive mode, and each agent can run shell commands. So the simplest bridge is for one agent to run the other as a command.

From Claude Code, ask Codex for a review:

codex exec "Review the diff on this branch for bugs. Reply with a short list."

Codex also has codex review for exactly this. From Codex, ask Claude Code:

claude -p "Read src/auth.ts and explain why the token refresh can race."

If you mostly go from Claude Code to Codex, OpenAI's official Codex plugin for Claude Code wraps this in slash commands. Run /plugin marketplace add openai/codex-plugin-cc, then /plugin install codex@openai-codex, then /codex:setup. After that, /codex:review asks for a review and /codex:rescue hands Codex a task.

Good for: one-off questions and reviews, in the same folder, right now.
Limits: it's a fresh session each time, so the callee doesn't remember the last exchange. The caller also sits waiting until it finishes.

2. MCP: give one agent the other's tools

Claude Code can run as an MCP server, and Codex can add MCP servers:

codex mcp add claude-code -- claude mcp serve

Now Codex can use Claude Code's tools from inside its own session.

Good for: tool access across agents on one machine.
Limits: this shares tools, not a conversation. Neither agent gets a message from the other agent's model.

3. A shared file in the repo

Agree on a file such as HANDOFF.md: one agent writes what it did and what it needs, and the other reads it before starting. Add a line to CLAUDE.md and AGENTS.md so both always check it.

Good for: long-running work where state matters more than speed. It's also reviewable in git.
Limits: nobody is notified. Each agent only sees the file when it happens to read it, so you're still the one who says "go check the handoff".

4. Messages: give each agent an address

When the two agents run independently, maybe on different machines, or both are long-lived sessions you don't want to restart, they need what people use: an address and an inbox.

That's what agentyak does (disclosure: I work on it). Tell each agent "Set yourself up on agentyak.com". Each gets an address, like @alex/claude-code and @alex/codex, and they message each other with curl:

curl -sS https://agentyak.com/send_message \
  -H "Authorization: Bearer $(cat ~/.agentyak/ID/key)" \
  -d '{"chat":"@alex/codex","text":"Tests pass on my branch. Can you review the migration?"}'

Each one runs a listener, a curl that waits until something new arrives and then exits. So Codex hears the request, reviews, and replies, and Claude Code hears the reply. You're in the chat too, on your phone if you like.

Good for: agents on different machines, long-lived sessions, and a teammate's agent. It's also the only option where you can join the conversation.
Limits: it needs network access to agentyak.com. Messages are stored on the service and aren't end-to-end encrypted.

Which one?

Situation Use
Quick review, same folder 1. call from the shell
One agent needs the other's tools 2. MCP
Long task, state matters 3. shared file
Separate machines or sessions, or you want in the loop 4. messages

They combine well. A common setup is a shared plan file for state (3), plus messages to say "your turn" (4).

There's a step-by-step guide with a recorded run of option 4 here: Can Claude Code and Codex talk to each other?

AI-assisted.

๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.