Codex vs Claude Code: which coding agent should you use?
Claude Code and Codex are close rivals: both are agents that read your project, edit files and run commands, and both read AGENTS.md. Claude Code is Anthropic's, runs on Claude models and starts at USD 20 a month on Pro. Codex is OpenAI's, has an open-source CLI, and also starts at USD 20 a month on ChatGPT Plus. Pick by the models and ecosystem you prefer, then test both on one small task.
What is the difference between Codex and Claude Code?
Both products do the same basic job. You describe a task, the agent reads your repository, edits files, runs commands such as your tests, and shows you the result for review. The differences are in who makes them, which models they run, where they run, what they cost and how they handle safety and extension. This page uses facts from each vendor's own documentation and pricing pages, read on October 30, 2026. It deliberately leaves out benchmark scores and speed claims. Each vendor tests on its own setup, models change within weeks, and a number copied from a blog post is out of date by the time you read it.
| Claude Code | Codex | |
|---|---|---|
| Made by | Anthropic | OpenAI |
| Models | Claude models, through Anthropic or a cloud provider | OpenAI models; custom model providers can be configured |
| Where it runs | Terminal, VS Code, JetBrains, desktop app, web, mobile | CLI, IDE extension, desktop app, cloud, mobile |
| Entry price with the agent | Pro, USD 20 a month billed monthly (USD 17 on annual billing) | ChatGPT Plus, USD 20 a month; a smaller Go plan at USD 8 a month has limited Codex access |
| Higher tiers | Max USD 100, Ultra USD 200 | Pro from USD 100, with plans at USD 100, USD 200 and USD 500 |
| Pay by API usage | Yes, via Anthropic Console | Yes, sign in with an API key (local use; cloud features unavailable) |
| Source | Repository declares no open-source license | CLI is open source under Apache-2.0 |
| Instruction file | CLAUDE.md; also reads AGENTS.md when no CLAUDE.md exists | AGENTS.md |
How do Claude Code and Codex compare in detail?
The two entries below give each tool's facts. The order is alphabetical by vendor and is not a ranking.
01 Claude Code
Anthropic's agentic coding tool that understands your codebase, edits files and runs commands from the terminal, editors, a desktop app and the web.
- Surfaces
- Terminal CLI, VS Code, JetBrains, desktop app, web and mobile. The docs say they share one engine, so CLAUDE.md, settings and MCP servers carry across.
- Plans
- Included in Pro (USD 20 a month billed monthly), Max (USD 100) and Ultra (USD 200), as of October 2026. Not in the Free plan. Also available by API token billing through a Console account.
- Safety model
- Permission modes from asking before most actions to auto mode with a classifier, plus an optional OS-level sandbox for shell commands (macOS, Linux, WSL2; off by default).
- Undo
- Checkpoints before each turn and a /rewind command.
- Extend
- Hooks, skills, subagents, MCP servers, plugins, GitHub Actions, and an Agent SDK for Python and TypeScript.
Claude Code runs Claude models. You sign in with a Claude subscription or a Console account, and enterprise users can route it through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. Its strengths are the depth of its configuration (hooks that run on events, skills, subagents) and the checkpoint-and-rewind workflow. The cost is a usage limit that applies every five hours and each week, and no free tier. See the Claude Code tutorial, Claude Code pricing and the honest review.
02 Codex
OpenAI's coding agent, available as an open-source CLI, an IDE extension, a desktop app and a cloud service that runs tasks in your connected GitHub repositories.
- Surfaces
- Codex CLI, IDE extension (VS Code, Cursor, Windsurf, Xcode, JetBrains), the ChatGPT desktop app, Codex cloud on the web, and mobile.
- Plans
- Free (USD 0) and Go (USD 8) have lightweight desktop-app access. Plus (USD 20) adds the web, CLI, IDE extension and iOS. Pro starts at USD 100. An API key option bills at API rates, as of October 2026.
- Safety model
- OS-enforced sandbox with network access off by default and writes limited to the active workspace, plus an approval policy that decides when it must ask you.
- Undo
- The docs advise creating Git checkpoints before and after a task so you can revert changes.
- Extend
- AGENTS.md, skills, plugins, MCP, hooks, subagents, a TypeScript SDK (@openai/codex-sdk) and a Python SDK (openai-codex).
Codex's CLI installs with a curl script, npm install -g @openai/codex or Homebrew, and the source is public on GitHub under the Apache-2.0 license. Cloud tasks run in an environment you set up for your repositories, can keep working while your computer is asleep, and end in a diff or pull request for review. Cloud work requires signing in with ChatGPT rather than an API key. Usage is shared with ChatGPT Work and is measured against your plan's limits. For a first-run walkthrough, see the Codex CLI guide and what OpenAI Codex is.
Which one has the features you need?
| Feature | Claude Code | Codex |
|---|---|---|
| Terminal agent | Yes | Yes |
| Editor integration | VS Code and JetBrains | VS Code, Cursor, Windsurf, Xcode and JetBrains |
| Run tasks in the cloud | Yes, on the web, started from the terminal with claude --cloud | Yes, Codex cloud environments for GitHub repositories |
| Reads AGENTS.md | Yes, when no CLAUDE.md is present (v2.1.277 or later) | Yes, natively, with global, project and override files |
| Own instruction file | CLAUDE.md, plus rules and auto memory | AGENTS.md and AGENTS.override.md |
| Hooks | Yes | Yes |
| Subagents | Yes | Yes, enabled by default in current releases |
| MCP servers | Yes | Yes |
| Skills and plugins | Yes | Yes |
| Automated pull request review | Code Review on Team and Enterprise plans; /code-review on any plan | Code review in GitHub, customized with a Code Review Rules section in AGENTS.md |
| Library for your own agents | Agent SDK (Python, TypeScript) | Codex SDK (TypeScript, Python) |
| Undoing a bad attempt | Automatic checkpoints before each turn and a /rewind command | Docs advise Git checkpoints before and after a task |
| Choose the model provider | Claude models via Anthropic, Bedrock, Google Cloud or Foundry | Configurable providers in config, including local runtimes such as Ollama and LM Studio |
The tables show a lot of overlap, which is the main finding. The big gaps are the model family, the open-source CLI and how each sells its plans. Beyond that the two have converged: both run in terminals and editors, both support the same extension ideas, and both read the shared AGENTS.md file. Anything that looks like a missing feature on one side may exist under a different name, so check the docs before you rule a tool out.
How do the prices and limits compare?
The entry points match: USD 20 a month for Claude Pro or ChatGPT Plus, as of October 2026, before tax. Anthropic discounts Pro to USD 17 a month if you pay USD 200 up front for the year. At the top, both vendors have a USD 100 tier, and both have tiers above it.
| Step | Claude | ChatGPT with Codex |
|---|---|---|
| Free | USD 0, no Claude Code | USD 0, limited desktop-app access |
| Light | None | Go, USD 8 a month |
| Standard | Pro, USD 20 a month billed monthly | Plus, USD 20 a month |
| Heavy | Max, USD 100 a month (5x Pro usage) | Pro from USD 100 a month |
| Heaviest | Ultra, USD 200 a month (10x Pro weekly usage) | Pro at USD 200 or USD 500 a month |
| Pay by usage | Console API token billing | API key, billed at API rates |
Neither vendor sells unlimited use. Anthropic limits usage every five hours and each week, and says how quickly you reach a limit depends on the model, chat length and file size. OpenAI says Codex usage depends on the model, the size and complexity of the task, and whether you run locally or in the cloud, and that tasks that look alike can consume different amounts. It also states that Pro plans currently have no five-hour limit. Because both are metered by what you ask, the cheapest tool is the one that finishes your kind of task in fewer attempts, and only your own test shows that.
For Anthropic's pay-as-you-go benchmark, its cost documentation reports an enterprise average of around USD 13 per developer per active day. OpenAI's pricing page instead gives estimated local messages per five-hour period for each model on Plus and Business plans, so the two vendors' figures are not directly comparable.
Which should you pick for your situation?
| If you... | Lean toward | Why |
|---|---|---|
| Already pay for ChatGPT Plus | Codex | The CLI, IDE extension and cloud come with the plan you have; try it before adding a second subscription |
| Already pay for Claude Pro | Claude Code | It is included, so you can try it at no extra cost |
| Want an open-source CLI you can read and fork | Codex | The CLI is Apache-2.0 on GitHub; Claude Code's repository declares no open-source license |
| Want automatic checkpoints and a built-in /rewind command | Claude Code | Checkpointing before each turn is a documented Claude Code feature; with Codex you rely on Git |
| Work mostly from an editor | Either | Both integrate with VS Code; Codex also lists Cursor, Windsurf, Xcode and JetBrains, Claude Code lists JetBrains |
| Want tasks to keep running in the cloud while you are away | Either | Codex cloud works from GitHub repositories; Claude Code has web sessions, started with claude --cloud |
| Need to use non-vendor or local models | Codex | Custom providers, including Ollama and LM Studio, are configurable; see also opencode |
| Run in a company that uses AWS, Google Cloud or Azure for model access | Claude Code | The docs describe Bedrock, Google Cloud's Agent Platform and Foundry routes |
| Are new to coding agents and cost-sensitive | Try the cheaper plan of either | Both have a USD 20 entry; Codex also has a USD 8 Go plan for light use |
If none of these rows decides it, the tie-breaker is how each tool feels to you across one real task. Anthropic's own best-practices page and OpenAI's CLI page both advise the same working habits: give the agent something to check its work against, and keep a way to revert. That advice is the same in either tool, so you lose little by trying both.
Can you use both on the same project?
Yes, and the shared file makes it easy. Both read AGENTS.md. Codex reads it natively. Claude Code reads it when there is no CLAUDE.md, or you can create a CLAUDE.md that starts with @AGENTS.md and add Claude-only lines below it. One set of build commands and rules then serves both agents. Keep tool-specific settings (Claude hooks, Codex config.toml) in their own files.
Running both on the same branch at the same time invites conflicts, so give each its own git branch or worktree, and merge after you read both diffs. That is also the cleanest way to compare them.
How do you test Codex against Claude Code fairly?
Give both the same brief on the same starting commit, on separate branches, and score the results with the same checks. Pick a task with an objective finish line, such as tests that pass. If you have no project, take an idea from the developer tools category on the board, where every idea has a generated build prompt, and use that as the brief.
Task: [one sentence describing the feature or fix] Context: - Read AGENTS.md first. - The test command is: [command] Do this: 1. Propose a short plan and wait for my approval. 2. Implement it on this branch only. 3. Run the tests and fix failures. 4. Stop when the tests pass and tell me which files you changed and why. Do not: add dependencies, change unrelated files, or edit migrations.
- Create two branches from the same commit and run one agent on each.
- Use the same approval level for both, such as asking before shell commands.
- Record time to passing tests, number of corrections you made, and plan usage afterward.
- Read both diffs. The one you could explain and maintain is usually the better result, even if it was slower.
- Repeat on a second, different task before you decide. One task is an anecdote.
Frequently asked questions
Is Codex better than Claude Code?
Neither is better in every case. They overlap heavily: both edit files, run commands, read AGENTS.md and support hooks, subagents, MCP and skills. The differences are the model family, price structure and an open-source CLI on the Codex side. Benchmarks come from each vendor's own setup, so test both on your task.
Which is cheaper, Claude Code or Codex?
At the entry level they cost the same: USD 20 a month for Claude Pro or ChatGPT Plus, as of October 2026. Codex also has an USD 8 Go plan for light use, and both have USD 100 tiers and higher. Real cost depends on usage limits and how many attempts a task needs, so measure it on a project of your own.
Can Claude Code and Codex read the same instruction file?
Yes, through AGENTS.md. Codex reads it natively. Claude Code reads AGENTS.md when your project has no CLAUDE.md, or you can put @AGENTS.md at the top of a CLAUDE.md so both load the same rules. Keep shared build commands and conventions there, and tool-specific settings in each tool's own files.
Is Codex open source?
The Codex CLI is open source: the openai/codex repository on GitHub carries the Apache-2.0 license. The cloud service and the models behind it are not. Anthropic's claude-code repository on GitHub does not declare an open-source license, so Claude Code is not distributed as open source.
Do I need a subscription for either one?
Not strictly. Claude Code can be billed by API tokens through an Anthropic Console account, and Codex accepts an OpenAI API key for local use through the CLI, SDK and IDE extension. Cloud features in Codex need a ChatGPT sign-in, and Claude Code is not included in the free Claude plan.
Which should a beginner start with?
Start with whichever subscription you already have, since the agent comes with it. If you have neither, pick the one whose documentation you find easier to follow and use a single month of the USD 20 plan on one small project. If you want a hosted app without reading code, consider a browser app builder instead.
Post your build ideas publishes this comparison and lists itself first. Facts about other products were checked on their own websites on the date shown above; prices and features change, so confirm on their sites before you decide. About the publisher.