Guide

How to use Claude Code and Codex together on one project

If you pay for both, you don’t have to pick one. Give each agent its own task and branch, give both the same rules, and let one check the other’s work.

Why use Claude Code and Codex on the same project?

Which model is “better” at what changes with every release, so don’t build a workflow on that. The practical reasons hold up better:

  • Two separate allowances. Claude Code on a Claude plan shares its usage limits with claude.ai. Codex on a ChatGPT plan shares its limits with some other ChatGPT features. Running out on one doesn’t touch the other.
  • A second opinion from a different model. A reviewer that didn’t write the code, from a different vendor, gives you a second, independent read of the change.
  • Independent review and tests. The agent that wrote a change is the worst judge of whether it works. A second agent writing tests against it gives you something objective to run.

How should I split work between Claude Code and Codex?

Whichever pattern you pick, the rule is the same: one task per agent, and a clear list of the files each one may touch.

PatternHow it worksGood for
Plan and buildOne agent reads the code and writes a plan with tasks and file lists, without editing. The other implements it.Features that touch several parts of the code
Split by task typeA fixed rule, such as front end to one agent and back end to the other.Steady work on a project you know well
Build and reviewOne implements. The other reviews the diff and reports problems, without editing.Any change you plan to merge
Build and testOne implements. The other may only add tests. You run the test command and the result decides.Bug fixes and logic with clear expected behaviour

Try a split for a week and note which agent needed fewer fixes for which kind of task. That beats any general ranking.

How do I run both at once without conflicts?

Two agents in one folder overwrite each other’s files and test runs. Give each a git worktree: a separate checkout of the same repository on its own branch (the repository needs at least one commit).

git worktree add ../myapp-api -b agent/api
git worktree add ../myapp-ui -b agent/ui
git worktree list

Start Codex in ../myapp-api and Claude Code in ../myapp-ui. Claude Code can also create a worktree itself with claude --worktree <name>. When a branch is merged, remove its folder with git worktree remove ../myapp-api.

  • Never give both agents the same files, even on different branches, or the time you saved goes into merge conflicts.
  • Tell each agent its write scope in the task, for example “only change files under src/api/”.
  • If task B needs task A’s result, merge A first and start B from the updated branch.

How do I give both agents the same project rules?

Keep one file, AGENTS.md, and point the other tool at it:

  • Codex reads AGENTS.md from ~/.codex, then from the project root down to the folder you are in, one file per folder. It stops adding files at 32 KiB by default (project_doc_max_bytes). Other file names can be added with project_doc_fallback_filenames in ~/.codex/config.toml.
  • Claude Code reads CLAUDE.md. Since v2.1.277 it reads AGENTS.md instead when there is no CLAUDE.md or CLAUDE.local.md in the folder or above it. If you also keep a CLAUDE.md, put @AGENTS.md at the top of it to import the shared file, then add Claude-only notes below.
# CLAUDE.md
@AGENTS.md

## Claude Code only
- Use plan mode before multi-file changes.

On Windows, use the @AGENTS.md import rather than a symlink. Anthropic’s docs note that symlinks there need Administrator rights or Developer Mode, and Git may check one out as a plain text file.

Put the exact build, test and lint commands in it, so both agents check their work the same way. Keep it short: Anthropic notes that longer files reduce adherence.

Can Claude Code call Codex directly?

Yes. OpenAI publishes an open-source Codex plugin for Claude Code (openai/codex-plugin-cc). It calls the Codex CLI on your machine with your own Codex sign-in, and its usage counts against your Codex limits.

/plugin marketplace add openai/codex-plugin-cc
/plugin install codex@openai-codex
/reload-plugins
/codex:setup

It adds commands such as /codex:review (a read-only review of your current work or a branch), /codex:adversarial-review (a review that questions design choices) and /codex:rescue (hand a task to Codex). Without the plugin, you can run a review from a terminal with codex review --base main or codex review --uncommitted.

Do I need a subscription for each?

Yes. Each tool runs on its own vendor’s plan or API key.

  • Claude Code is included in Claude’s Pro, Max and Ultra plans (Team and Enterprise are covered separately), with limits shared with claude.ai. A Claude Console account bills at API rates instead, and if ANTHROPIC_API_KEY is set, Claude Code uses that key and you pay API charges.
  • Codex is included in ChatGPT plans (OpenAI’s pricing page lists Free, Go, Plus, Pro, Business, Edu and Enterprise), or runs on an OpenAI API key at API pricing, separate from your plan’s allowance.

Anthropic’s and OpenAI’s terms both say you may not share your account or credentials with anyone else. Don’t open extra accounts to get around a usage limit either; check each vendor’s terms. When one agent runs out, move the remaining task to the other or wait for the reset.

A Claude Code and Codex workflow to try this afternoon

  1. Write the shared rulesCreate AGENTS.md with your test and lint commands and three to five project rules. Add @AGENTS.md to CLAUDE.md if you have one.
  2. Plan without editingStart claude --permission-mode plan and ask for a plan split into two tasks with no shared files, each with a file list and a test command.
  3. Make two worktreesRun the git worktree add commands above, one branch per task.
  4. Build in parallelPaste task 1 into Codex in one worktree and task 2 into Claude Code in the other. Include the write scope and ask each to run the tests before finishing.
  5. Run the checks yourselfIn each worktree, run the test command. An agent saying “done” is not a passing test.
  6. Swap for reviewReview Claude’s branch with codex review --base main. Review Codex’s branch by starting Claude Code in plan mode in that worktree and asking it to review the diff against main.
  7. Merge by handFix what matters, merge each branch, then git worktree remove both folders.

Where Pyloxa fits

Pyloxa is a free Windows desktop app that automates most of the steps above with the official CLIs, on your own subscriptions or API keys. You describe the work once; one agent, the brain, writes the plan, and you approve it.

  • Routing rules by task type. An assignment table says which agent gets each kind of work, with backups. The default Balanced template sends front end to Claude Code and back end to Codex. See the workflow.
  • One worktree per task. Each task runs in its own git worktree and branch. Pyloxa never stashes, resets or checks out your working folder.
  • Checks Pyloxa runs itself. Your approved commands (for example npm run test) run after each task, plus a check that changes stay within the plan’s write scope. How checks work.
  • Cross-testing by another agent. The tester, for example Codex on Claude Code’s work, may only add tests, and Pyloxa re-runs the commands. Free: on request. Pro: automatic, with failures sent back for a fix.
  • When quota runs out. Pyloxa proposes the fallback from your rules, and the other agent continues from the files already changed. Free: you confirm each takeover. Pro: automatic, at most two takeovers per task and never from a subscription to an API key. Quota and fallback.
  • You merge. Nothing is merged into your branch, pushed or opened as a PR until you choose.

The free edition runs one project at a time, up to two tasks at once. Pro adds several projects at once and the automatic parts, and is in a free preview now. You don’t need Pyloxa if you use one agent at a time, or if two terminals and the steps above already work for you.

FAQ

Can Claude Code and Codex work in the same folder at the same time?
They can, but they will change the same files and disturb each other’s test runs. Give each its own git worktree and branch, and give them tasks that don’t share files.
Does Claude Code read AGENTS.md?
Yes, from v2.1.277, when there is no CLAUDE.md or CLAUDE.local.md in the folder or above it. If you have a CLAUDE.md, add @AGENTS.md to it to import the shared file.
Are separate branches enough, or do I need worktrees?
Branches alone still share one folder, so only one can be checked out at a time. A worktree gives each branch its own folder, so both agents can work at once.
Whose limits does the Codex plugin for Claude Code use?
The Codex part runs on your own Codex sign-in, and the plugin’s README says its usage counts against your Codex limits.
Can I share one subscription with a teammate to run both?
No. Anthropic’s and OpenAI’s terms both say you may not share your account or credentials. Each person needs their own account for each tool.

Sources

  1. How Claude remembers your project, Anthropic (checked 2026-11-19)
  2. Common workflows, Anthropic (checked 2026-11-19)
  3. Use Claude Code with your Pro, Max, or Ultra plan, Anthropic (checked 2026-11-19)
  4. Consumer Terms of Service, Anthropic (checked 2026-11-19)
  5. Custom instructions with AGENTS.md, OpenAI (checked 2026-11-19)
  6. Pricing, OpenAI (checked 2026-11-19)
  7. Developer commands, OpenAI (checked 2026-11-19)
  8. Codex plugin for Claude Code, OpenAI on GitHub (checked 2026-11-19)
  9. Terms of Use, OpenAI (checked 2026-11-19)
  10. git-worktree documentation, Git (checked 2026-11-19)

Want this handled for you?

Pyloxa is a free Windows app that runs the Claude Code and Codex CLIs you already use: it splits the work by your rules, runs your tests itself and offers a handoff when one runs out of quota.