Parallel agents · 5 min read ·
Run Claude Code and Codex at the same time
Yes, you can run Claude Code and Codex at the same time. Use separate worktrees, one shared AGENTS.md, split roles and a plan for when a usage limit hits.
Can you run Claude Code and Codex at the same time?
Yes. They are separate programs with separate sign-ins, so you can start both in the same project today. Claude Code signs in with a Claude plan or a Console account (authentication), and Codex with ChatGPT or an API key (CLI docs). Each keeps its own configuration, in ~/.claude for Claude Code (setup page) and ~/.codex for Codex (Codex docs), and its own usage meter.
Two things need care. The agents must not edit the same files, and they draw on two separate allowances. The rest of this page covers both. For several sessions of one tool, see running multiple Claude Code sessions.
How do you keep both agents out of each other’s files?
Give each agent its own git worktree and its own branch. Both tools have a command for it. Claude Code has claude --worktree <name>, documented on its worktrees page. The Codex CLI has a /worktree command, and codex exec --worktree for scripted runs, per its command reference. Plain git worktree add works for either.
The commands, the setup traps (env files, ports, dependencies) and the cleanup are in our worktree guide. Split the work by task, not by file: one agent takes the bug, the other takes the feature, and each ends with a branch you review. Merge one branch at a time, then rerun the other branch’s checks.
How do you give both the same instructions?
Put the shared rules in one AGENTS.md. Codex reads it before it does any work, per its AGENTS.md guide. Claude Code reads CLAUDE.md, and by default reads AGENTS.md only when your project has no CLAUDE.md. To use both, make a CLAUDE.md that starts with @AGENTS.md and add anything Claude-specific below it. That is the pattern in Anthropic’s memory docs. Our guide to AGENTS.md vs CLAUDE.md vs GEMINI.md has the details and the traps.
Already set up in Claude Code? Codex can bring that over. Type /import in the Codex CLI and choose Claude Code to import instruction files, skills, MCP settings, hooks, subagents and recent chats, per OpenAI’s import guide. It leaves your Claude Code setup unchanged, and OpenAI advises reviewing what it imported before you rely on it.
Do both ask for permission the same way?
No, so set each one on purpose. Codex runs inside an OS-enforced sandbox, usually limited to the current workspace, with network access off by default, plus an approval policy that decides when it must ask (approvals and security). Claude Code uses permission modes. Manual asks before most edits, shell commands and network access, while auto mode, the starting mode in interactive terminal sessions from version 2.1.283, lets a second model review actions (permission modes). The same prompt can stop at a question in one tool and run straight through in the other.
Do not fix that by switching every check off in your main checkout. If you want fewer prompts, read our guide to skipping permissions safely first.
How do you split the work between them?
The most useful split is a builder and a reviewer. One agent writes the change on its branch. The other reads only the diff, so it has not seen the first agent’s reasoning, and reports what it finds. A second reader is still a second opinion, not a guarantee, so run your own checks too.
Codex has a reviewer built in. /review starts a dedicated reviewer. It reads the diff you choose (a base branch, uncommitted changes, a commit or custom instructions) and reports prioritized findings without changing your working tree, per OpenAI’s code review docs. Claude Code’s counterpart is /code-review, with /review as an alias, which checks the current diff for correctness bugs (commands reference).
You can also run Codex from inside Claude Code. As of October 2026, OpenAI publishes a Codex plugin for Claude Code. After /plugin marketplace add openai/codex-plugin-cc and /plugin install codex@openai-codex, Claude Code gets /codex:review for a read-only Codex review, /codex:adversarial-review for one that challenges your design, and /codex:rescue to hand Codex a task. It needs a ChatGPT subscription or an OpenAI API key, and its usage counts toward your Codex limits. The README warns that its optional review gate “can create a long-running Claude/Codex loop and may drain usage limits quickly”, so leave it off unless you are watching.
A note on older guides. Anthropic’s docs say that to involve a different tool you expose it to Claude as an MCP server. OpenAI has since removed codex mcp-server and the codex-mcp-server binary, per its removal notice, so that route no longer works for Codex. Use the plugin, or run the two side by side.
What happens when one of them hits a usage limit?
The limit belongs to the account, not the project, so the other agent can pick up the work. Check where you stand first: /usage in Claude Code, and /status or the usage dashboard for Codex.
Hand off with a brief, not a hope. Commit or stash what works, then write five lines: the goal, what is done, what is left, the failing check and the files that matter. Paste that into the other agent and ask it to run the check before it edits anything.
Two shortcuts exist. From Claude Code, the plugin’s /codex:transfer creates a Codex thread from your current session and prints a codex resume command. From Codex, /import brings in up to 50 chats from the last 30 days. Our guides to a Claude Code limit and a Codex limit explain what each message means and how to wait it out.
How do you compare Codex and Claude Code on the same task?
Give both the same task, from the same starting commit, in separate worktrees, then run your own checks in each. That is a bake-off, and our guide to running one has the steps and a scorecard. For what each tool’s docs say about permissions, sandboxes and scripting, see Claude Code vs Codex vs Gemini CLI. Documentation cannot tell you which one does better on your repository. A same-task test can.
Run both in one window
SwarmPane’s Agent Grid runs Claude Code and Codex side by side in real terminals, each pane showing whether it is working, waiting for you or done. Broadcast sends one prompt to several panes and says how many took it. Agent Race gives two or three agents the same task in separate copies of the project, and your tests, typecheck and lint pick the winner. Nothing merges without your click.
When a limit hits, Limit handoff switches from Claude Code to Codex and back with a brief of the work that you edit first, and Accounts keeps several Claude Code and Codex sign-ins side by side. SwarmPane runs the CLIs and accounts you already have. Start with a 7-day trial for $1 and cancel before it ends if it is not for you.