How to use Codex in Claude Code
There are three practical ways to use OpenAI Codex from inside a Claude Code session, depending on whether you want a fresh second opinion or want Claude Code to talk to a Codex chat that is already running:
- OpenAI’s official Codex plugin (
openai/codex-plugin-cc) for code reviews, adversarial design checks, rescue debugging and session transfer inside Claude Code. - Direct CLI calls (
codex execorcodex review) from Claude Code’s shell when you want a one-off run with no plugin setup. - pingpong when you already have a Codex session running in another terminal, worktree or computer and want Claude Code to ask it questions or ping it without starting over from a blank context.
Older tutorials often recommend adding codex mcp-server as an MCP server in
Claude Code. OpenAI deprecated codex mcp-server in August 2026 and removed it
in Codex CLI 0.154.0 in favor of the Codex App Server and codex exec.
These facts were checked against OpenAI’s openai/codex-plugin-cc README and
Codex CLI 0.172.0 on December 2, 2026.
1. OpenAI’s official Codex plugin for Claude Code
If you want Claude Code to call Codex for reviews or hand off a stuck bug on
the same computer, OpenAI’s official plugin (openai/codex-plugin-cc) is the
cleanest setup. It wraps your local codex CLI and App Server, so it uses your
existing ChatGPT sign-in or OpenAI API key and respects ~/.codex/config.toml
and .codex/config.toml. It requires Node.js 18.18 or later.
Install it from inside Claude Code:
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup
If Codex is not installed or signed in yet, /codex:setup checks for it and
can install @openai/codex, and !codex login authenticates it.
Once installed, you get slash commands and a codex:codex-rescue subagent:
/codex:reviewruns a read-only Codex code review on uncommitted changes or against a base branch (--base main), and supports--backgroundand--wait./codex:adversarial-reviewruns a steerable read-only review that challenges your design choices and risk areas — for example:/codex:adversarial-review --base main check for race conditions and rollback gaps./codex:rescuehands a bug investigation or fix to Codex through thecodex:codex-rescuesubagent, with--background,--resumeand--fresh./codex:transferimports your current Claude Code session (from~/.claude/projects) into a persistent Codex thread and prints acodex resume <session-id>command so you can keep going in Codex./codex:status,/codex:resultand/codex:cancelmanage background Codex jobs.
There is also an optional stop-hook review gate
(/codex:setup --enable-review-gate) that runs a Codex review before Claude
Code finishes a turn and blocks stopping if Codex finds issues. OpenAI’s docs
warn that it can create a loop and burn through usage limits quickly, so only
turn it on while you are watching the session.
2. Call codex exec or codex review from Claude Code’s shell
If you do not want to install a plugin, Claude Code can already invoke your
local codex CLI directly in its shell. Ask Claude Code to run a non-interactive
pass:
codex review --base main
codex exec "Check src/auth/ for edge cases in token refresh"
This needs nothing beyond an authenticated codex CLI on your PATH. By
default, codex exec checks that the working directory is inside a Git
repository; pass --skip-git-repo-check if you deliberately want to run it
outside one.
On the same computer, Codex also supports codex exec resume to continue a
prior non-interactive run and codex queue --thread <id-or-name> --message "..."
to queue a follow-up message for an existing Codex session. Neither gives you a
non-interrupting stand-in answer from a running Codex chat or routes replies
back into Claude Code, and both stay on the local machine.
3. Reach an already-running Codex session with pingpong
The plugin and codex exec focus on spinning up or resuming Codex work on the
same machine, while codex queue drops a message into a local Codex session
without returning an answer to Claude Code. When a Codex agent is already
working in another terminal, git worktree or computer — for instance, building
the API while Claude Code builds the web app, or running on a teammate’s
machine — you want two-way coordination between live sessions.
pingpong solves that side of the problem. Once set up, both your Claude Code and Codex chats share one workspace over MCP:
- Ask without interrupting. In Claude Code, ask what a running Codex agent
decided (
ask_agent). A stand-in answers from that Codex chat’s recent conversation on its machine, leaving the Codex session untouched. - Ping to act. Send a request to the Codex chat itself (
ping_agent) when it needs to update something, and get its reply back in Claude Code. - Hand off at a usage limit. If Claude Code stops at its limit mid-task, a Codex chat in the same folder can ask the paused Claude chat where it stopped. When Codex is signed in on that machine and its answer succeeds, it answers from the Claude chat’s condensed transcript without using Claude quota; if Codex is unavailable, fails or takes over two minutes, pingpong falls back to an unsaved copy of the Claude chat, which hits the same Claude limit. See how to hand a task from Claude Code to Codex for the full walkthrough and fallback details.
For the full walkthrough and setup steps, see how to make Codex and Claude Code talk to each other.
What happened to codex mcp-server?
Many guides still show claude mcp add codex -- codex mcp-server. OpenAI
deprecated that subcommand in August 2026 and removed it in Codex CLI 0.154.0,
moving integrations onto the Codex App Server (which openai/codex-plugin-cc
uses). Third-party npm wrappers around the Codex CLI still exist if you want a
generic MCP tool, but for Claude Code specifically the official plugin or
codex exec has fewer moving parts.
Which approach to pick
- Want Codex to review a diff, challenge a design or investigate a bug from
inside Claude Code: install
openai/codex-plugin-cc. - Want a quick one-off check with zero setup: run
codex revieworcodex execfrom Claude Code’s terminal. - Have live Codex, Claude Code or Antigravity CLI (
agy) chats working in parallel across worktrees, computers or teammates and want them to coordinate: connect them with pingpong. Read what is shared and the safety model before you connect.