How to use Claude Code and Codex together
By Nicolás Pinzón Aparicio · Updated
To use Claude Code and Codex together, give each agent its own git worktree and keep your shared rules in AGENTS.md (both read it); to have one call the other, OpenAI's official Codex plugin for Claude Code adds /codex:review and /codex:rescue, and codex exec and claude -p let either agent run the other from a script, while Agents Keeper is a free desktop app that shows both agents' sessions in one list.
Plenty of developers pay for both, or use Codex on the free ChatGPT plan next to a Claude plan. The hard part isn't installing them, it's keeping them from editing the same files and keeping track of two sets of sessions. Here are the three setups that work, the manual way first, with commands from Anthropic's and OpenAI's own docs, checked on November 12, 2026.
Three ways to combine Claude Code and Codex
| What it looks like | Good for | |
|---|---|---|
| Side by side | Each agent in its own terminal and its own git worktree | Two tasks at once, or the same task tried twice |
| Codex inside Claude Code | OpenAI's plugin: /codex:review, /codex:rescue and more | A second opinion on Claude's changes without leaving Claude Code |
| Scripts | codex exec "…" and claude -p "…" | Reviews in CI, hand-offs in a shell script |
1. Side by side, each in its own worktree
Two agents editing the same checkout will overwrite each other. A git worktree is a second folder on its own branch that shares the same repository, so each agent gets a clean place to work:
- Create a worktree for Codex:
git worktree add ../myapp-codex -b codex/taskand startcodexin that folder. - Start Claude Code in its own worktree:
claude --worktree taskcreates one under.claude/worktrees/on a new branch. - Put the project's rules in
AGENTS.md. Codex reads it; Claude Code readsAGENTS.mdwhen the folder has noCLAUDE.md(since version 2.1.277), or you can import it from yourCLAUDE.md. - Review each branch and merge the one you want, or both. Remove a worktree with
git worktree remove ../myapp-codex.
Each worktree needs its own dependencies (npm install, uv sync…). More options, .env files and cleanup in Claude Code worktrees.
2. Codex inside Claude Code: OpenAI's plugin
OpenAI publishes a Codex plugin for Claude Code (openai/codex-plugin-cc, Apache-2.0). It uses the codex installed on your computer and your ChatGPT plan (Free included) or an OpenAI API key, and needs Node.js 18.18 or later. In Claude Code, run:
/plugin marketplace add openai/codex-plugin-cc/plugin install codex@openai-codex/reload-plugins/codex:setup, which checks that Codex is installed and signed in (sign in with!codex loginif not).
- /codex:review
- A read-only Codex review of your current changes, or of a branch with
--base <ref>. - /codex:adversarial-review
- A review that questions design choices, trade-offs and assumptions; you can add what to focus on.
- /codex:rescue
- Hands a task to Codex: investigate, fix, or continue earlier work.
- /codex:status, /codex:result, /codex:cancel
- Follow, read or stop Codex jobs running in the background.
- /codex:transfer
- Turns the current Claude Code session into a Codex thread and prints the
codex resume <session-id>command to open it.
Everything the plugin does counts toward your Codex usage limits. OpenAI warns that its optional review gate (/codex:setup --enable-review-gate) can start a long Claude/Codex loop that drains limits quickly; turn it on only when you're watching.
3. From a script: codex exec and claude -p
Both agents have a non-interactive mode, so either can run the other, or a script can run both one after the other.
- Codex
codex exec "summarize the repository structure and list the top 5 risky areas". It runs in a read-only sandbox by default; add--sandbox workspace-writeto let it edit.codex exec resume --last "…"continues the last run.- Claude Code
claude -p "Find and fix the bug in auth.py" --allowedTools "Read,Edit,Bash". Add--output-format jsonto get the result and the session ID, and--resume <session-id>to continue it.
A common split: one agent writes the change on its branch, then the other reviews the diff. Keep the reviewer read-only, as codex exec is by default.
Keeping track of both: where Agents Keeper helps
Any of the three setups leaves you with two sets of terminals, two session lists and two usage meters. Agents Keeper is a free desktop app for macOS, Windows (native, no WSL) and Linux that runs the official Claude Code and Codex with your own login, in one place.
- One list
- Every Claude Code and Codex session in one Inbox, grouped by status, with the ones that need you on top and one notification when an agent needs you or finishes.
- Both limits
- The Usage page shows your 5-hour and weekly windows with the reset time, and an approximate cost across Claude and Codex, worked out on your computer.
- Ask both
- Council puts one question to two to five members, each with its own agent and model, so Claude Code and Codex answer side by side, review each other anonymously, and a chair writes the verdict. Council's agents can't change your files.
- Running in the background
- Sessions of both agents keep running in its background service when you close the window.

Choosing between them instead? See Claude Code vs Codex, and Agents Keeper for Codex users.
Questions about using Claude Code and Codex together
- Can Claude Code and Codex work on the same project at the same time?
- Yes, as long as they don't edit the same checkout. Give each its own git worktree and branch, then merge what you keep.
- Do they share project instructions?
- They can. Codex reads
AGENTS.md. Claude Code readsCLAUDE.md, and readsAGENTS.mdwhen there's noCLAUDE.md(version 2.1.277 or later), so oneAGENTS.mdcan serve both. - Is there an official way to call Codex from Claude Code?
- Yes. OpenAI's Codex plugin for Claude Code (openai/codex-plugin-cc) adds
/codex:review,/codex:rescueand other commands that run your local Codex. - Do I need two paid plans?
- No. Codex is included in every ChatGPT plan, the Free plan too, per OpenAI's pricing page. Claude Code needs a paid Claude plan (Pro, $20 a month, or higher) or an API account.
- Is Agents Keeper free?
- Yes. Agents Keeper is a free beta with no account. Claude Code and Codex use your own Claude or ChatGPT plan, or an API key.
Sources
Checked on
- OpenAI: Codex plugin for Claude Code (openai/codex-plugin-cc, Apache-2.0)
- OpenAI: Non-interactive mode (codex exec)
- Anthropic: Run Claude Code programmatically (claude -p)
- Anthropic: How Claude remembers your project (CLAUDE.md and AGENTS.md)
- OpenAI: Custom instructions with AGENTS.md (Codex)
- Anthropic: Run parallel sessions with worktrees (--worktree, .worktreeinclude, cleanup)
- OpenAI: Worktrees in Codex
- Git documentation: git-worktree
- OpenAI: Codex pricing
- Anthropic: Claude plans and pricing