How to use Claude Code and Codex together

To use Claude Code and Codex together, run each CLI in its own terminal on the same project, give each a clear role (for example, Claude Code writes and Codex reviews), and pass work between them. You can relay by hand, by files, or, in BRIX, by linking the two terminals so they send each other prompts with medmaestri ask and send.

Updated · by the BRIX team

Why use Claude Code and Codex on the same project?

Two different models catch different mistakes. An agent reviewing its own work tends to agree with itself; a second agent from another vendor, trained differently, reads the same diff with fresh eyes. Many developers already pay for both — a Claude plan and a ChatGPT plan — and use only one at a time.

Common ways to split the work:

PatternClaude CodeCodex
Writer / reviewerImplements the changeReviews the diff and reports findings
Reviewer / writerReviews and challenges the planImplements the change
Split by areaBackendFrontend (in a separate worktree)
Second opinionProposes a fix for a bugInvestigates the same bug independently, then the answers are compared

Which model should write and which should review is a judgment call that changes with every model release. Try both orders on your codebase instead of trusting anyone's ranking.

Can Claude Code and Codex work in the same folder?

Yes, as long as only one of them is editing at a time. The safe default for the writer/reviewer pattern is one checkout: the writer edits, the reviewer only reads (git diff, the files, the tests). Codex has a built-in review flow for exactly this — /review runs against uncommitted changes, a commit or a base branch and reports prioritized findings without modifying your working tree (per the Codex CLI docs, checked October 2026).

If both agents will write code at the same time, give each its own git worktree so their edits only meet when you merge.

  • Keep shared instructions in a file both agents read. Claude Code reads CLAUDE.md and Codex reads AGENTS.md; a common approach is to keep the rules in AGENTS.md and reference it from CLAUDE.md.
  • Decide who is allowed to commit. Two agents committing to the same branch is how history gets messy.
  • Make the reviewer's output concrete: file, line, what breaks, how to reproduce.

How do I make one agent review the other without copy-paste?

There are three levels, from manual to connected:

  • By hand. Two terminals side by side; you copy the summary from one into the other. Works, but you become the message bus and the bottleneck.
  • By files. The writer leaves its plan in PLAN.md, the reviewer writes REVIEW.md, and you tell each one to read the other's file. Better, but still you nudging each step.
  • By shelling out. One agent calls the other non-interactively, for example Claude Code running codex exec "review the uncommitted changes". Useful for one-shot reviews; each call starts a fresh Codex session, so there is no running conversation to follow up in.

What none of these gives you is two live sessions that can talk to each other while you watch both. That is the gap BRIX fills.

How do Claude Code and Codex talk to each other in BRIX?

In BRIX, each agent is a real terminal running the CLI you already have — claude in one, codex in another — on your own Claude and ChatGPT logins. When you draw an edge between two terminals on the canvas, that edge is the permission: the two can now reach each other through the medmaestri command, which BRIX puts on the PATH of every terminal.

CommandWhat it does
medmaestri listLists the terminals linked to this one
medmaestri ask "Codex" "..."Sends a prompt to the Codex terminal and waits until it goes quiet, then returns its output
medmaestri send "Codex" "..."Types the text plus Enter into the other terminal and returns immediately
medmaestri check "Codex" --cleanReads what is on the other terminal's screen right now, without ANSI codes
medmaestri spawn --cli codex --name "Codex"Starts a new Codex terminal already linked to the current one

Because the agents run these commands themselves, you can tell Claude Code "when you finish, ask Codex to review the diff and fix what it finds", and the round trip happens between the terminals. You see both sessions in full, and you can type into either one at any time.

How do I set up a Claude Code writer and a Codex reviewer?

  1. 1

    Install BRIX and both CLIs

    Download BRIX for macOS (Apple Silicon) or Windows. Have Claude Code and Codex installed and logged in; BRIX uses them as they are and doesn't charge for the models.

  2. 2

    Open the project and start Claude Code

    Open a terminal in your repository and run claude. This one writes the code.

  3. 3

    Recruit Codex as the reviewer

    From the Claude Code terminal (or ask Claude to do it): medmaestri spawn --name "Codex" --cli codex --prompt "You are the reviewer. Do not edit files. When asked, review git diff and report findings with file and line.". The new terminal is born linked to Claude Code. Alternatively, open a Codex terminal yourself and draw the edge on the canvas.

  4. 4

    Give Claude Code the loop

    Tell it: "Implement the change. Then run medmaestri ask Codex "Review the uncommitted changes", fix what is valid, and tell me what you rejected and why."

  5. 5

    Watch, intervene, commit

    Both terminals stay visible on the grid or canvas, and the Scene view shows which one is working or waiting for you. When the loop settles, review the diff yourself and commit.

Want the roles pre-drawn? The blindagem squad creates a security auditor, a diff reviewer and a cleanup agent already connected: medmaestri squad blindagem.

Does this work for more than two agents?

Yes. A lead agent can recruit up to five workers, one level deep, and each can run a different CLI — Claude Code, Codex, Antigravity or OpenCode. The canvas also holds notes and task lists the agents can read and update, so the plan lives in one place instead of in each chat. See Orchestrate a team of AI agents.

And the same pair can keep going after the merge: with BRIX PRO, the studios for copy, ads, carousels and video read the same local product base, so the launch material is written by agents that know what was just built. See the plans.

Frequently asked questions

Do I need both a Claude and a ChatGPT subscription?

Yes, to run both CLIs you need access to each one, through a subscription or API key. BRIX uses those logins as they are and does not charge for tokens.

Can Codex review code written by Claude Code?

Yes. Codex can read the same working tree, and its /review command reports findings on uncommitted changes, a commit or a branch without modifying files.

Will Claude Code and Codex overwrite each other's changes?

They can if both edit the same files at once. Keep one as a read-only reviewer, or give each its own git worktree when both need to write.

What is medmaestri?

It is the command-line tool BRIX installs in every terminal it opens. Agents use it to list linked terminals, send prompts with ask and send, read another terminal with check, and recruit new agents with spawn.

Can two terminals in BRIX talk without an edge between them?

No. A terminal can only reach terminals it is linked to; drawing the edge on the canvas, or recruiting with spawn, is what grants access.

Keep reading