Guide
How to use Claude Code and Codex together
Claude Code and Codex need no integration to work on the same repository: give each its own git worktree and branch, let one write while the other reviews the diff, and keep one AGENTS.md that both read. To call Codex from inside Claude Code, use the plugin OpenAI publishes; the older codex mcp-server route has been removed from Codex. Accounts, usage limits, permissions and sandbox settings stay separate for each tool.
Let one tool write and the other review the diff
Both CLIs have a non-interactive mode, so the hand-off is one shell command. After Claude Code commits its work on a branch, run this in that checkout to have Codex review the branch against its base:
codex review --base main
codex review runs without opening the terminal UI. --base reviews your branch against the branch you name, --uncommitted reviews staged, unstaged and untracked changes, and --commit <SHA> reviews a single commit. Codex reports findings and does not modify the working tree. In an interactive Codex session, /review offers the same scopes.
In the other direction, pipe the diff of the branch Codex wrote into Claude Code:
git diff main...codex/search | claude -p "Review this diff for correctness bugs. Report each finding as file:line, then one sentence." --permission-mode dontAsk
git diff main...codex/search prints what changed on the branch since it diverged from main. -p runs Claude Code non-interactively and reads the piped diff from stdin. --permission-mode dontAsk denies any action that would need your approval, so Claude can read files for context but cannot edit them. Run the command from the checkout that holds the branch, so the files Claude opens match the diff. In an interactive Claude Code session, /code-review main...codex/search reviews the same range.
To give Codex your own review instructions, pipe the diff the same way: git diff main...claude/search | codex exec "your instructions". Codex treats the prompt as the instruction and the piped diff as context, and codex exec runs in a read-only sandbox by default. Both claude -p and codex exec print the final answer to stdout, so you can redirect it to a file for the writer to read.
Split the work, with one worktree per tool
The second pattern is running both at once on different tasks. Some people split by strength, giving each tool the kind of task they have seen it handle well in their own codebase. Others split by usage limit: each tool counts usage against its own plan, so when Claude Code reports "You've hit your session limit" you carry on in Codex, and the reverse. /usage in Claude Code and /status in Codex show what is left.
Either way, two agents now edit one repository. In a single checkout they share one working tree and one index, so each can overwrite files the other is halfway through changing, and everything lands in one uncommitted diff that you cannot split by author afterwards. A git worktree is a second working directory attached to the same repository, with its own files and branch:
git worktree add ../myapp-claude -b claude/search
git worktree add ../myapp-codex -b codex/search-tests
Each command creates a directory beside your repository and checks out a new branch there, starting from your current HEAD. Git refuses to check out one branch in two worktrees, so the tools cannot end up on the same branch. Start each tool in its own directory, in two terminals:
cd ../myapp-claude && claude
codex --cd ../myapp-codex
A new worktree contains tracked files only, so install dependencies in each one and copy gitignored files such as .env yourself. Once both branches are merged, git worktree list shows what exists and git worktree remove ../myapp-codex deletes one; git removes only a clean worktree unless you add --force.
Claude Code can also create its own: claude --worktree search makes .claude/worktrees/search/ on a new branch named worktree-search. The Codex CLI reference lists no equivalent flag; the worktrees Codex manages for you are a feature of the ChatGPT desktop app.
Keep one instructions file that both tools read
Codex reads AGENTS.md. In each directory from the project root down to where you started it, Codex looks for AGENTS.override.md, then AGENTS.md, then any filename listed in project_doc_fallback_filenames, and uses at most one file per directory. Claude Code reads CLAUDE.md, and from v2.1.277 it also reads AGENTS.md directly, but by default only when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. That default is how two files drift apart.
| Repository has | Claude Code reads | Codex reads |
|---|---|---|
Only AGENTS.md | AGENTS.md (v2.1.277 or later) | AGENTS.md |
AGENTS.md and CLAUDE.md | CLAUDE.md only, by default | AGENTS.md only |
CLAUDE.md that imports @AGENTS.md | CLAUDE.md with AGENTS.md included | AGENTS.md |
Only CLAUDE.md | CLAUDE.md | No project instructions, unless CLAUDE.md is listed in project_doc_fallback_filenames |
The simplest single source is an AGENTS.md and no CLAUDE.md. If you need Claude-only instructions, or you run Claude Code versions older than v2.1.277, keep a CLAUDE.md whose first line imports the shared file:
@AGENTS.md
## Claude Code
Use plan mode for changes under src/billing/.
Claude Code reads the imported file first, then the rest. There are two other documented options: ln -s AGENTS.md CLAUDE.md when you need no Claude-only content and nobody clones the repository on Windows, or /config with Project instructions set to claude-md-and-agents-md, which makes Claude Code load both files. Claude Code does not read AGENTS.override.md, so anything there reaches Codex only.
To confirm what loaded, run /memory in Claude Code. In Codex, run codex --ask-for-approval never "Summarize the current instructions." from the repository root.
Calling one from the other: what is supported today
Codex from Claude Code. OpenAI publishes a Claude Code plugin in its openai/codex-plugin-cc repository. Install it from a Claude Code session:
/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup
/codex:review --base main then runs a read-only Codex review of your branch, /codex:rescue followed by a task hands that task to Codex, and /codex:transfer turns the current Claude Code session into a Codex thread you can continue with codex resume. The plugin uses the Codex CLI and login already on your machine, and its usage counts against your Codex limits. Its README says it wraps the Codex app server, which the Codex documentation labels experimental.
Codex as an MCP server. This route is gone. The codex mcp-server command and the standalone codex-mcp-server binary have been removed from Codex. The app server that replaces them speaks its own JSON-RPC protocol and is not an MCP server, so an MCP entry in Claude Code that launches codex mcp-server stops working once you upgrade Codex.
Claude Code from Codex. Claude Code can run as a stdio MCP server with claude mcp serve, and Codex registers stdio servers with codex mcp add <name> -- <command>. Anthropic's documentation says this server only exposes Claude Code's tools to the client and leaves confirmation of each tool call to the client. It does not describe the server as a way to hand Claude a task, and neither vendor documents Codex as the client.
As a subprocess. claude -p and codex exec are documented for scripts, so either agent can run the other as an ordinary shell command. Neither vendor documents that pairing, so treat it as scripting, not as a supported integration. Each side's own rules still apply: Claude Code's permission rules decide whether it may run codex exec, and Codex's sandbox covers the commands it spawns and keeps network access off by default, so claude -p called from inside Codex cannot reach Anthropic's API until you approve it or enable network access.
Accounts, limits and permissions stay separate
None of these patterns merges the two products. A permission you grant in one, an MCP server you add to one, or a limit you reach in one has no effect on the other.
| Setting | Claude Code | Codex |
|---|---|---|
| Sign-in | Claude Pro, Max, Team or Enterprise account, the Claude Console, or a cloud provider | ChatGPT account or OpenAI API key, through codex login |
| Usage | Counts against your Claude plan or API billing; /usage shows it | Counts against your ChatGPT plan or API billing; /status shows remaining plan limits |
| Settings files | ~/.claude/settings.json and .claude/settings.json | ~/.codex/config.toml and .codex/config.toml (trusted projects only) |
| Approvals | Permission modes plus allow, ask and deny rules | approval_policy: on-request or never |
| Sandbox | Bash sandbox, off by default; turn it on with /sandbox | On by default; workspace-write keeps network access off |
| MCP servers | claude mcp add | codex mcp add, stored in config.toml |
Both tools have an /import command that copies the other's configuration across once. It is a migration, not a sync.
How Armadai connects the two
Everything above works in two terminal windows and leaves the bookkeeping to you: creating worktrees, carrying messages between the agents, and noticing which one is waiting.
Armadai is a native macOS app that runs your installed Claude Code and Codex side by side, with a workspace for each project on one canvas. Its Coordinate feature gives the two a shared goal inside a project and lets them exchange plans, implementation and reviews. You can review and edit each message before it is delivered or choose Auto, set a message budget, inspect the transcript, and stop the connection at any time. Hand-off on a task board runs a task with Claude or with Codex, gives the run its own Git worktree, and brings successful work back as a draft pull request for you to review. A master agent, which can be Claude Code or Codex, opens workspaces, launches and messages agents and reads their replies from one sidebar conversation, and the sidebar shows which sessions are working, idle or waiting for approval.
Both tools still use your own accounts and their own usage limits. Armadai costs $20 a month after a 7-day free trial that requires a payment method, has no free plan, and runs on macOS only. Plans and requirements are on the homepage.
Questions
Can Claude Code and Codex run in the same folder at the same time?
Both will start, but they share one working tree, so each can overwrite the other's uncommitted edits and their changes end up in a single diff. Give each tool its own git worktree and branch with git worktree add, then merge the branches.
Does Codex read CLAUDE.md?
Not by default. Codex looks for AGENTS.override.md, then AGENTS.md, then any filenames listed in project_doc_fallback_filenames in its config.toml. Adding CLAUDE.md to that list makes Codex read it in directories that have no AGENTS.md, but keeping the shared content in AGENTS.md is simpler.
Does Claude Code read AGENTS.md?
Yes, from v2.1.277, but by default only when there is no CLAUDE.md or CLAUDE.local.md in the working directory or above it. If you keep a CLAUDE.md, put @AGENTS.md on its first line, or set Project instructions to claude-md-and-agents-md in /config.
Can I still add Codex to Claude Code as an MCP server?
No. The codex mcp-server command and the codex-mcp-server binary have been removed from Codex, and the app server that replaces them is not an MCP server. To use Codex from inside Claude Code, install the plugin OpenAI publishes in its openai/codex-plugin-cc repository, or run codex exec as a shell command.
Do I need separate accounts for Claude Code and Codex?
Yes. Claude Code signs in with a Claude Pro, Max, Team or Enterprise account, the Claude Console, or a cloud provider. Codex signs in with a ChatGPT account or an OpenAI API key. Each vendor counts usage against its own plan, so check each pricing page for what your plan includes.
Sources
Details about other products come from their own pages, checked on the dates shown. If something has changed, tell us at support@armadai.sh and we will correct it.
- claude -p runs Claude Code non-interactively, reads piped stdin and prints plain text by default. code.claude.com, checked October 4, 2026.
- In dontAsk mode Claude Code denies every tool call that would otherwise prompt, while file reads inside the working directory still run. code.claude.com, checked October 4, 2026.
- /code-review in Claude Code accepts a branch name or a ref range such as main...my-feature as its target. code.claude.com, checked October 4, 2026.
- claude --worktree <name> creates a worktree under .claude/worktrees/<name>/ on a new branch named worktree-<name>, and a new worktree does not contain untracked files such as .env. code.claude.com, checked October 4, 2026.
- Claude Code v2.1.277 or later reads AGENTS.md directly, by default only when no CLAUDE.md or CLAUDE.local.md exists in the working directory or above it; an @AGENTS.md import, a symlink, or the claude-md-and-agents-md setting shares one file; AGENTS.override.md is not read; /memory lists loaded files. code.claude.com, checked October 4, 2026.
- claude mcp serve starts Claude Code as a stdio MCP server that only exposes Claude Code's tools, leaving confirmation of tool calls to the client. code.claude.com, checked October 4, 2026.
- Claude Code plugins are installed with /plugin marketplace add owner/repo followed by /plugin install plugin@marketplace. code.claude.com, checked October 4, 2026.
- /import in Claude Code brings Codex configuration across as a one-time copy. code.claude.com, checked October 4, 2026.
- Claude Code uses allow, ask and deny permission rules, and shell commands need approval in Manual mode. code.claude.com, checked October 4, 2026.
- Claude Code settings live in ~/.claude/settings.json and the project's .claude/settings.json. code.claude.com, checked October 4, 2026.
- Claude Code's Bash sandbox is off by default and is turned on with /sandbox. code.claude.com, checked October 4, 2026.
- /usage shows Claude plan usage, and subscription plans report "You've hit your session limit" when a usage window is used up. code.claude.com, checked October 4, 2026.
- Claude Code signs in with a Claude Pro, Max, Team or Enterprise account, the Claude Console, or a cloud provider. code.claude.com, checked October 4, 2026.
- codex exec runs Codex non-interactively in a read-only sandbox by default, treats piped stdin as context when a prompt is given, and prints only the final message to stdout. learn.chatgpt.com, checked October 4, 2026.
- codex review is a non-interactive review that accepts --base, --uncommitted and --commit; --cd sets Codex's working directory; codex mcp add registers a stdio server given after --; codex mcp-server has been removed; /import migrates Claude Code setup into Codex. learn.chatgpt.com, checked October 4, 2026.
- Codex reviews report findings without modifying the working tree, and /review offers base-branch, uncommitted, commit and custom scopes. learn.chatgpt.com, checked October 4, 2026.
- Codex reads AGENTS.override.md, then AGENTS.md, then names in project_doc_fallback_filenames, at most one file per directory from the project root down. learn.chatgpt.com, checked October 4, 2026.
- The codex mcp-server command and the codex-mcp-server binary have been removed; the app server uses its own JSON-RPC protocol, is not an MCP server and is experimental. learn.chatgpt.com, checked October 4, 2026.
- Codex stores MCP servers in config.toml and adds stdio servers with codex mcp add <name> -- <command>. learn.chatgpt.com, checked October 4, 2026.
- Codex's sandbox applies to the commands it spawns and is on by default; approval policies are on-request and never. learn.chatgpt.com, checked October 4, 2026.
- Codex's default workspace-write sandbox keeps network access off unless sandbox_workspace_write.network_access is enabled, and Codex asks for approval to run commands that need the network. learn.chatgpt.com, checked October 4, 2026.
- Codex configuration lives in ~/.codex/config.toml and in a project's .codex/config.toml, which loads only for trusted projects. learn.chatgpt.com, checked October 4, 2026.
- Codex signs in with a ChatGPT account or an API key, using codex login. learn.chatgpt.com, checked October 4, 2026.
- Codex usage counts against ChatGPT plan limits, and /status shows remaining limits during a Codex CLI session. learn.chatgpt.com, checked October 4, 2026.
- The worktrees Codex creates and manages for you are a feature of the ChatGPT desktop app. learn.chatgpt.com, checked October 4, 2026.
- OpenAI publishes a Codex plugin for Claude Code with /codex:review, /codex:rescue and /codex:transfer; it uses the local Codex CLI login, counts against Codex usage limits and wraps the Codex app server. github.com, checked October 4, 2026.
- git worktree add -b <new-branch> <path> creates a worktree on a new branch starting at HEAD, refuses a branch already checked out in another worktree, and git worktree remove only removes a clean worktree unless --force is given. git-scm.com, checked October 4, 2026.
- git diff A...B shows the changes on B since the common ancestor of A and B. git-scm.com, checked October 4, 2026.