Blog · Coding agents

How to use Claude Code and Codex together

Yes, Claude Code and Codex work well together: run each in its own git worktree of the same repository, give both the same AGENTS.md, and let one write the code while the other reviews it. For a tighter link, OpenAI publishes an official plugin that lets Claude Code call Codex for reviews and hand it tasks. This guide covers the five ways people combine the two, a step-by-step setup with commands from the official docs, how the agents can talk to each other, what to watch when both run at once, and the tools that orchestrate them. Updated November 20, 2026.

Five ways to use Claude Code and Codex together

Most setups combine two or three of these. If you're still choosing between the agents, start with Claude Code vs Codex.

WayHow it worksUse it when
1. Shared instructionsOne AGENTS.md that both agents read; CLAUDE.md imports itAlways. It's the cheapest step and stops the two agents following different rules
2. Separate worktreesEach agent works in its own git worktree and branch of the same repoBoth agents edit code at the same time
3. One writes, the other reviewsClaude Code writes, codex review checks the branch, or the other way roundYou want a second model to catch what the first one missed
4. Codex inside Claude CodeOpenAI's codex-plugin-cc adds /codex:review, /codex:rescue and more to Claude CodeYou live in Claude Code and want Codex one command away
5. An orchestratorA board or app (Claude Squad, Conductor, Orca, Vibe Kanban, Crewmark) starts and tracks bothYou run several agents every day and lose track of terminals

1. Give both agents the same instructions

Codex reads AGENTS.md: one global file in ~/.codex, then every AGENTS.md from the project root down to the folder you're in, with an AGENTS.override.md taking precedence in its directory. It stops adding files at 32 KiB by default (project_doc_max_bytes). More in our Codex AGENTS.md guide.

Claude Code can read AGENTS.md too, from v2.1.277, but by default only when there's no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder or above it. If your repo has a CLAUDE.md, put @AGENTS.md at its top so Claude reads the shared file first, then add Claude-only rules below it. A symlink (ln -s AGENTS.md CLAUDE.md) also works, but the docs recommend the import if anyone on the team uses Windows. See CLAUDE.md for the rest.

  • Put build, test and lint commands, code style and "don't touch" rules in AGENTS.md, so both agents run the same checks.
  • Keep agent-specific notes out of it: Claude-only rules go below the import in CLAUDE.md, Codex-only settings in ~/.codex/config.toml.
  • Claude Code ignores AGENTS.override.md and AGENTS.local.md, so don't put shared rules there.

2. Run them in separate worktrees

Two agents editing one checkout will overwrite each other; Claude Code's own docs warn that two agents editing the same file leads to overwrites. A git worktree is a second working directory with its own files and branch that shares the repository's history, so each agent gets its own copy to edit.

Claude Code creates one for you with claude --worktree <name> under .claude/worktrees/. The Codex CLI has a --worktree flag that starts a session or a codex exec run in a new managed worktree, and the Codex desktop app manages worktrees for its tasks. Plain git worktree add works for either agent. Our Claude Code worktree guide covers cleanup, .worktreeinclude for .env files and the base branch.

3. Let one write and the other review

This is the pattern most people mean by using the two together. A second agent from another vendor reads the diff without the first agent's assumptions, so it can catch what the author missed.

  • Codex reviewing Claude: codex review --base main reviews the branch against main; --uncommitted reviews staged, unstaged and untracked changes; --commit <SHA> reviews one commit.
  • Claude reviewing Codex: pipe the diff into claude -p, the non-interactive mode. The Claude Code docs show the same idea as a build script that runs git diff main | claude -p as a reviewer.
  • Send the findings back to the agent that wrote the code and let it fix them; don't let the reviewer edit the branch too.

4. Call Codex from inside Claude Code (official plugin)

OpenAI publishes codex-plugin-cc, an Apache-2.0 Claude Code plugin to "use Codex from Claude Code to review code or delegate tasks". It uses the codex CLI already on your machine, with the same login, config and checkout. You need a ChatGPT plan (Free counts) or an OpenAI API key, and Node.js 18.18 or later. Usage counts toward your Codex usage limits.

Install it from inside Claude Code with /plugin marketplace add openai/codex-plugin-cc, /plugin install codex@openai-codex, /reload-plugins and /codex:setup.

  • /codex:review: a read-only Codex review of uncommitted changes, or of the branch with --base main. The README says it matches running /review in Codex itself.
  • /codex:adversarial-review: a read-only review you can steer, aimed at design choices, tradeoffs and risky areas.
  • /codex:rescue: hands Codex a task, such as investigating a bug or trying a fix, through a subagent; add --background for long jobs and check them with /codex:status and /codex:result.
  • /codex:transfer: turns the current Claude Code conversation into a Codex thread and prints the codex resume command to continue it there.
  • The optional review gate (/codex:setup --enable-review-gate) runs a Codex review every time Claude tries to stop and blocks the stop if it finds issues. The README warns it can loop for a long time and drain usage limits quickly, so only turn it on while you're watching.

Step by step: worktrees, shared instructions and a review loop

This is the most common setup: Claude Code and Codex each build in their own worktree from the same AGENTS.md, then review each other's branch before you merge. Every command is from the Claude Code docs, the Codex CLI reference or the plugin README; the review prompt is an example.

  1. Write one AGENTS.md and import it from CLAUDE.md

    Put the shared rules in AGENTS.md at the repo root. Codex reads it directly. If you also have a CLAUDE.md, start it with the import so Claude Code reads the same file.

    # CLAUDE.md: Claude Code reads AGENTS.md first, then the rest
    @AGENTS.md
    
    ## Claude Code
    Use plan mode for changes under src/billing/.
  2. Start Claude Code in its own worktree

    Claude Code creates the worktree and a branch for it. Install dependencies inside the worktree, since it's a fresh checkout.

    # Claude Code in its own worktree: .claude/worktrees/feature-auth, branch worktree-feature-auth
    claude --worktree feature-auth
    
    # keep worktrees out of git status
    echo ".claude/worktrees/" >> .gitignore
  3. Start Codex in a second worktree

    Create a worktree with git and point Codex at it with --cd, or let Codex make a managed worktree with --worktree.

    # Codex in a second worktree on its own branch
    git worktree add ../project-feature-a -b feature-a
    codex --cd ../project-feature-a
    
    # or let Codex create a managed worktree for a one-shot task
    codex exec --worktree "implement the next step"
  4. Have Codex review Claude's branch

    When Claude Code finishes, run a Codex review against main from Claude's worktree, or from inside Claude Code if you installed the plugin. Paste the findings back to Claude Code to fix.

    # Codex reviews Claude's branch (run inside Claude's worktree)
    codex review --base main
    
    # or, from inside Claude Code, with OpenAI's plugin
    /codex:review --base main
  5. Have Claude Code review Codex's branch

    Pipe Codex's diff into Claude Code's non-interactive mode and hand the findings back to Codex.

    # Claude Code reviews Codex's branch (run inside Codex's worktree)
    git diff main | claude -p "Review this diff for bugs and missing tests. List each issue with file:line."
  6. Merge, then remove the worktrees

    Merge each branch as usual (or open a PR), then remove the worktrees you no longer need. Claude Code offers to clean up its own worktree when you exit the session.

    git worktree list
    git worktree remove ../project-feature-a

Can Claude Code and Codex talk to each other?

Not directly in a chat-like sense. Neither agent has a built-in channel to the other vendor's agent, so they talk through something both can reach: the files and git history in the repo, a command one runs in the other's CLI, or a board that both read.

  • Through the CLI: Claude Code can run codex exec or codex review as a shell command, and Codex can run claude -p. Each gets the other's answer as command output.
  • Through the plugin: in Claude Code, /codex:rescue and /codex:review send work to Codex and bring the result back into the conversation. OpenAI maintains the plugin.
  • Through MCP: this route has mostly closed. Codex used to run as an MCP server with codex mcp-server; OpenAI removed it in Codex rust-v0.154.0 and points integrators to the experimental Codex app server, which speaks its own JSON-RPC protocol. Going the other way, claude mcp serve turns Claude Code into an MCP server, but it exposes Claude Code's tools (read, edit, shell), not a second Claude agent.
  • Through a shared board: an orchestrator or an issue board holds the task, the comments and the status, and each agent reads and writes there.
  • What doesn't cross vendors: Claude Code's agent teams and its cross-session messaging connect Claude Code sessions only. A Codex session can't be a teammate.

Can you run Claude Code and Codex at the same time?

Yes. They are separate programs with separate logins, so both can run on one machine and one repo at once. Claude Code uses your Claude plan or API key; Codex uses your ChatGPT plan or an OpenAI API key. What you need to manage is files and usage.

  • Files: give each agent its own worktree. Two agents in one checkout will edit the same files and overwrite each other.
  • Usage: each agent draws on its own limits. Work you send to Codex through the Claude Code plugin counts toward your Codex usage limits.
  • Loops: an automatic review loop (like the plugin's review gate) can keep both agents busy for a long time and drain limits quickly. Run it while you're watching.
  • Claude-side parallelism costs more: Anthropic says agent teams use significantly more tokens than a single session, and the cost grows with each teammate.

Tools that orchestrate Claude Code and Codex

If you start several agents a day, a tool that creates the worktrees, opens the terminals and shows the diffs saves a lot of switching. These all run Claude Code and Codex; see Vibe Kanban alternatives for a wider comparison.

ToolWhat it doesIsolationRuns onLicence / status
Claude SquadTerminal app to manage Claude Code, Codex, OpenCode, Amp and other agents; run Codex with cs -p "codex"tmux session and git worktree per agentTerminal (installs with Homebrew)Open source, AGPL-3.0
ConductorRuns Claude Code, Codex, Cursor and OpenCode in parallel; review the diff, open a PR, mergeA workspace and branch per taskMacDesktop app
OrcaRuns a fleet of terminal agents, Claude Code and Codex included, with your own subscriptionsGit worktree per agentmacOS, Windows, LinuxOpen source, MIT
Vibe KanbanKanban board that starts a workspace per issue with Claude Code, Codex, Gemini CLI and othersGit worktree per workspaceBrowser or desktop app via npx vibe-kanbanOpen source, Apache-2.0; community maintained since bloop shut down in April 2026
CrewmarkClaude Code and Codex as long-running AI employees with roles on a shared issue boardEach employee is its own session on your machineYour own machineSee below

Crewmark: Claude Code and Codex as a team on one board

The tools above are built around one task at a time: start an agent, review the diff, merge. If you want Claude Code and Codex to keep working together over days, with each owning a role, Crewmark is another option.

In Crewmark each agent is an AI employee: a long-running session with a role, running on your own machine. Claude Code and Codex employees run natively; other agents, such as OpenCode, DeepSeek Harness and Gemini, connect through ACP (acpx). Work moves through a shared issue board, where you and the employees assign issues, comment, @mention each other and change statuses. That's how a Claude Code employee hands a review to a Codex employee: it @mentions it on the issue. Employees wake on a schedule (heartbeats) and whenever they're mentioned, so the review starts without you passing it along.

It doesn't replace worktrees or the review commands above; your employees still use them. It adds the roles, the board and the wake-ups around them. For the idea behind it, see multi-agent harness.

FAQ

Can Claude Code and Codex work together?

Yes. The common setup is one shared AGENTS.md, a separate git worktree for each agent, and a review loop where one writes and the other runs a review. OpenAI also publishes an official Claude Code plugin, codex-plugin-cc, that lets Claude Code call Codex.

What's the best way to use Claude Code and Codex together?

Let one write and the other review. Build with Claude Code in its own worktree, then run codex review --base main (or /codex:review from inside Claude Code) and send the findings back. Swap roles when Codex writes.

Can Claude Code and Codex talk to each other?

Indirectly. Each can run the other's CLI (codex exec, codex review, claude -p) and read the output, the Codex plugin passes tasks and results inside Claude Code, and a shared board can hold the conversation. Claude Code's agent teams and cross-session messaging connect Claude Code sessions only.

Can I run Claude Code and Codex at the same time?

Yes, on the same machine and repo. Give each its own worktree so they don't overwrite each other's files. Each uses its own plan or API key, and work you send to Codex through the plugin counts toward your Codex limits.

Can I use Codex as an MCP server in Claude Code?

Not anymore. codex mcp-server was removed in Codex rust-v0.154.0; OpenAI now points to the Codex app server, which isn't MCP. To use Codex from Claude Code, install OpenAI's codex-plugin-cc instead.

Do Claude Code and Codex share AGENTS.md?

They can. Codex reads AGENTS.md by default. Claude Code reads it when the repo has no CLAUDE.md (v2.1.277 and later); if you have a CLAUDE.md, start it with @AGENTS.md so both agents follow the same file.

Can Codex be a teammate in Claude Code agent teams?

No. Agent teams are made of Claude Code instances: a lead and teammates that share a task list and mailbox. To bring Codex into the same work, use the Codex plugin, a review loop, or a board that runs both.

Which tools run Claude Code and Codex side by side?

Claude Squad, Conductor, Orca and Vibe Kanban start both agents in isolated worktrees or workspaces. Crewmark runs them as long-running AI employees on a shared issue board.

Commands and features checked against the Claude Code docs, the Codex docs and CLI reference, and the codex-plugin-cc README on November 20, 2026.

Put Claude Code and Codex on the same team.

Crewmark gives each agent a role, a shared issue board and scheduled wake-ups, so they hand work to each other without you copying it between terminals.

Crewmark is open source: star us on GitHub