Claude Code vs Codex: Anthropic's and OpenAI's coding agents, from the docs
Updated on
Claude Code vs Codex is a choice between Anthropic's coding agent and OpenAI's. This page compares them from their own docs: where each one runs, which models it uses, how plans and usage work, how they handle permissions, and how to use both. The same facts answer searches for codex vs Claude Code.
Status: Not tested yet. We have not run Claude Code and Codex on the same job, so this page has no winner and no scores of our own. Sources were checked on 2026-11-02, and both companies change these pages often.
The short version
Claude Code is Anthropic's agentic coding tool. It reads your codebase, edits files, runs commands, and can commit and open pull requests. It started in the terminal and also runs as IDE extensions, in the Claude desktop app, on the web at claude.ai/code, and on mobile. It uses Claude models and comes with paid Claude plans (or an Anthropic Console / API account).
Codex is OpenAI's coding agent. It inspects code, makes changes, runs commands, and can hand longer work to cloud environments. You use it from the Codex CLI, an IDE extension, the ChatGPT desktop app, the web, and mobile for cloud tasks. It runs OpenAI models and is included with ChatGPT plans; an API key is another sign-in path for local CLI and IDE use.
So the real split is which subscription and model family you already pay for, and which surfaces you want day to day: a Claude-tied agent with a terminal-first history, or a ChatGPT-tied agent with a first-party cloud and an open-source CLI.
At a glance
| Claude Code (Anthropic) | Codex (OpenAI) | |
|---|---|---|
| Vendor | Anthropic | OpenAI |
| What it is | An AI-powered coding assistant that understands your codebase. The terminal CLI edits files and runs commands. The overview also describes commits, pull requests, skills, MCP, and scheduled tasks. | A coding agent that helps you write, review, and ship code. The CLI, IDE extension, desktop Codex mode, and cloud environments cover local and remote work. |
| Models | Claude models only. On the Anthropic API and typical Claude plans, aliases resolve to current Opus, Sonnet, Haiku, and Fable releases (for example Opus 5.5 as a common default). Context windows reach up to 1M tokens on many current models. | OpenAI models available to your ChatGPT plan or API key. Codex docs and pricing pages list models such as GPT-6.1 Sol, Terra, and Luna; the default depends on CLI/IDE version, config, and workspace settings. |
| Where you use it | Terminal CLI, VS Code (with an Install for Cursor link), JetBrains, the desktop app Code tab, the browser at claude.ai/code, and the Claude iOS and Android apps. Slack is listed too. | Codex CLI, IDE extension (VS Code, Cursor, Windsurf, Xcode, JetBrains), ChatGPT desktop Codex mode, Codex web / cloud tasks, and mobile for cloud work. |
| Open source? | The product is a commercial Anthropic agent. Installers and docs are public; this page does not treat the whole product as an open-source CLI in the same sense as openai/codex. | The Codex CLI is published at github.com/openai/codex under Apache-2.0. Model access still needs a ChatGPT login or API key. |
| Pricing model | Included in paid Claude plans and shares their usage limits with chat. A Console account pays per API token. Not on Free. | Included across ChatGPT plans for Codex; Free and Go cover local CLI/IDE-style use, while Codex Cloud needs eligible Plus or higher. Credits and API-key billing extend usage. See OpenAI's Codex pricing page for current numbers. |
| Who it's for | Developers who want a Claude coding agent in the terminal, IDE, desktop, or cloud, on a Claude subscription or Console account. | Developers who want OpenAI's coding agent beside ChatGPT, including an open-source CLI and optional cloud environments on eligible plans. |
Prices are left out of the table on purpose where they shift quickly. Current numbers are on Anthropic's plans page and OpenAI's Codex pricing page.
Where each one runs
Claude Code. Anthropic's platforms page says the same engine runs everywhere, with each surface tuned for a different way of working. The terminal CLI is the most complete surface for terminal-native work, scripting, and the Agent SDK. VS Code adds inline diffs and editor context (with an Install for Cursor link on the VS Code docs). JetBrains uses a plugin that still needs the CLI. The desktop app's Code tab is for visual review and parallel sessions. The web at claude.ai/code runs cloud sessions that can continue after you disconnect. Mobile starts and monitors cloud work (and Remote Control / Dispatch for local sessions). Slack can route @Claude mentions into coding tasks on supported plans.
Codex. OpenAI's help article Using Codex with your ChatGPT plan lists the ChatGPT desktop app (Codex mode), the Codex CLI, the IDE extension, and Codex web. The CLI docs cover install (curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS/Linux), /init, /permissions, /model, and /review. The IDE extension works in VS Code-compatible editors plus Xcode and JetBrains integrations. Codex Cloud runs tasks in OpenAI-managed environments you publish from connected repositories; you can start and continue cloud tasks from desktop, web, or mobile, including while your computer is asleep.
Local vs cloud is the practical fork on both sides: keep a laptop session for tight steering, or start a cloud session when the job should keep going offline.
Models and context
Claude Code always uses Claude. The model configuration docs describe aliases (opus, sonnet, haiku, fable, best, opusplan) and say that on the Anthropic API the common aliases resolve to current Opus / Sonnet / Haiku lines (for example Opus 5.5 for opus). Fable is positioned for longer autonomous work and is selected explicitly rather than as the silent account default. Many current Claude models support a large context window (up to about 1M tokens on the models Anthropic lists with that window). Effort levels and auto-compaction control how deep and how long a session runs.
Codex uses OpenAI models available to your sign-in. The ChatGPT help article says the default model for the CLI or IDE depends on your client version and configuration, and that workspace admins can set starting model, reasoning, and Fast Mode defaults. The Codex pricing page discusses models such as GPT-6.1 Sol, Terra, and Luna for usage estimates, and notes that local messages and cloud chats share the plan allowance. This page does not invent a single "Codex always uses X" claim beyond what those docs show on the check date.
Neither product is a thin wrapper around the other. Claude Code does not call Codex; Codex does not run Claude Code.
Plans, pricing and usage limits
This section answers the common cost question without turning the page into a price sheet that goes stale in a week.
Claude Code. Anthropic's pricing page lists Claude Code on Pro, Max, Ultra, Team, and Enterprise, and not on Free. The FAQ there says Claude Code shares the same usage limits as the rest of the plan (rolling five-hour window plus weekly limits on most accounts), across web, desktop, mobile, and Claude Code. Pro is shown around $20 per month when billed monthly (with a lower effective monthly price when billed annually); Max and Ultra are higher tiers with more usage. A Claude Console account uses API token pricing instead of the consumer plan pool. Fast mode for Opus is described on the product page with its own token rates when you use it.
Codex. OpenAI's help article says Codex is included across ChatGPT plans, including Free and Go, and that Codex Cloud is available to eligible Plus, all Pro tiers, Business, Enterprise, Healthcare, and Education accounts — not Free or Go. The Codex pricing page (checked 2026-11-02) shows Free at $0, Go at $8/month, Plus at $20/month, and Pro plans from $100/month (with higher Pro tiers listed). It also describes an API-key path for CLI, SDK, and IDE use without cloud-based features such as GitHub code review or Slack. Usage depends on model, task size, whether work is local or cloud, reasoning, and tools; OpenAI publishes estimate ranges per model for Plus and warns they are not fixed message caps. At launch, standard Codex Cloud environments have no separate VM charge; model usage still counts toward Codex limits.
How to read the cost difference. If you already pay for Claude Pro or higher, Claude Code is in that pool. If you already pay for ChatGPT Plus or higher, Codex (and on eligible plans, Codex Cloud) is in that pool; Free/Go still get local Codex without Cloud. Paying for both means two subscriptions unless you standardize on one vendor. For exact current dollars, limits, and credit packs, use the official pricing pages rather than this article.
Autonomy, sandboxing and approvals
Claude Code. The product FAQ says Claude Code asks for permission before it changes files or runs commands when you use it in the terminal. Local sessions talk to model APIs from your machine; cloud sessions run on Anthropic's infrastructure and keep going after you disconnect. Cloud permission modes and review flows are covered in the cloud docs. Hooks can run around lifecycle events; subagents and scheduled tasks extend how much work can continue without you at the keyboard.
Codex. The CLI docs highlight /permissions so you choose what Codex may do, and they describe inspecting the active sandbox and writable roots. OpenAI's ChatGPT help article describes auto-review: a separate reviewer can check eligible actions that would otherwise pause for approval; when you are signed in with ChatGPT, those safety checks are free and do not count toward plan usage limits. They do not remove workspace restrictions or replace every approval prompt. Codex Cloud runs in OpenAI-managed environments with network and secret controls you configure when you publish an environment.
Both products can keep working while you are away (Claude Code cloud sessions; Codex Cloud tasks). Both still expect you to review diffs and pull requests before you merge.
Extensibility: MCP, skills, and instructions files
Instructions. Claude Code reads CLAUDE.md at the start of a session for standing project guidance. Anthropic's overview also says that if the repository already has an AGENTS.md for other coding agents, Claude Code can read that in place of a CLAUDE.md. Codex reads AGENTS.md (and optional AGENTS.override.md) from ~/.codex and from nested project directories, merging closer files later; /init scaffolds a starter file. Default combined size for Codex project docs is capped (32 KiB by default in the AGENTS.md guide).
Skills and plugins. Claude Code packages repeatable workflows as skills (Agent Skills / SKILL.md folders) and supports hooks and custom subagents; see skills and extend Claude Code. Codex CLI docs describe skills and a plugins directory for connecting team tools, plus subagents for splitting investigations.
MCP. Both sides speak MCP. Claude Code connects outside tools through MCP servers. Codex exposes codex mcp for adding local or remote MCP servers and inspecting tools before use. OpenAI's pricing FAQ notes that every MCP server adds context and uses more of your limit — disable ones you do not need.
Shared repos can carry both CLAUDE.md and AGENTS.md. Expect to maintain two instruction styles unless you deliberately keep a single AGENTS.md that Claude Code is willing to read.
Codex vs Claude Code: how to choose
These questions follow the docs. They are not a ranking.
- Which subscription are you already on? Paid Claude plans include Claude Code. ChatGPT plans include Codex; Cloud needs eligible Plus or higher.
- Which models do you want day to day? Claude Code is Claude only. Codex is OpenAI models on your ChatGPT or API access.
- Do you need an open-source CLI client? Codex publishes openai/codex under Apache-2.0. Claude Code is installed from Anthropic's installers and docs.
- Where should long jobs run? Both offer cloud paths. Claude Code cloud sessions sit in Anthropic's product; Codex Cloud uses published OpenAI-managed environments with repo setup scripts.
- How do you want approvals? Claude Code prompts before edits and commands in the terminal. Codex centers
/permissions, sandbox modes, and optional auto-review for some approval prompts. - What instruction file does your team already use?
CLAUDE.mdvsAGENTS.md(with Claude Code able to fall back toAGENTS.md).
If the answers split evenly, try the same small bugfix in each tool on a throwaway branch and keep notes — this site has not done that comparison yet.
Using both
You can run both against one repository. Typical patterns from the docs alone:
- Use Claude Code when the work should draw on a Claude plan or Console key, and Codex when it should draw on ChatGPT or an OpenAI API key.
- Keep
CLAUDE.mdfor Claude-specific norms andAGENTS.mdfor Codex (or a sharedAGENTS.mdif you want Claude Code to read that file when noCLAUDE.mdexists). - Configure MCP and skills separately; do not assume a skill folder for one tool loads in the other unless that tool's docs say so.
- Review every pull request yourself. Neither vendor's cloud path removes code review.
For Claude Code next to an AI editor, see Claude Code vs Cursor. For Claude Code next to Anthropic's knowledge-work agent, see Claude Code vs Cowork. Product changelog pages live at /updates/claude/ and /updates/codex/.
Limits of this page
- Everything here comes from Anthropic's and OpenAI's own pages (and the public openai/codex GitHub repo metadata), checked on 2026-11-02. Default models, plan gates, and pricing change often.
- We have not run Claude Code and Codex on the same task, so nothing here says how well either one writes code. If we do, the results will go on this page with a test date, following how we test.
- Third-party benchmark blogs appear in Google results for these keywords; this page does not copy their scores.
FAQ
Is Codex better than Claude Code?
We don't know. We have not run the two on the same job, so this page does not name one. The questions under How to choose are a better guide, and so is a run on your own repository.
Does Codex use Claude Code?
No. Codex is OpenAI's coding agent and runs OpenAI models through ChatGPT plans or an API key. Claude Code is Anthropic's coding agent and runs Claude models. They are separate products from separate vendors.
Is Codex or Claude Code more popular?
There is no reliable public count of active users for either product. As a rough, incomplete signal, on 2026-11-02 the GitHub repos showed about 154,183 stars for anthropics/claude-code and about 132,756 stars for openai/codex (Apache-2.0). Stars are not usage, and both numbers change.
What is the difference in cost between Claude Code and Codex?
Both are usually billed through a subscription that also covers chat, with usage that depends on the model, task size, and whether work runs locally or in the cloud. Claude Code is included in paid Claude plans (Pro, Max, Ultra, Team, Enterprise) and is not on Free; a Console account pays API rates instead. Codex is included across ChatGPT plans including Free and Go for local CLI and IDE use; Codex Cloud starts on eligible Plus and higher plans. Exact dollar amounts and message estimates change — check Anthropic's and OpenAI's pricing pages.
Is Codex CLI open source?
Yes. OpenAI publishes the Codex CLI at github.com/openai/codex under the Apache-2.0 license. You still sign in with a ChatGPT account or an API key to use the models; the open-source repo is the client, not unlimited model access.
Can I use Claude Code and Codex together?
Yes. Nothing in the official docs says you must pick only one. Many teams keep Claude Code for Claude-plan work and Codex for ChatGPT-plan work in the same repository. Instruction files differ (CLAUDE.md vs AGENTS.md), though Claude Code can read AGENTS.md when no CLAUDE.md is present. Skills, MCP servers, and permissions are configured separately in each tool.
Related on bests.one
- Claude Code vs Cursor — the editor agent next to Claude Code.
- Claude Code vs Cowork — Anthropic's coding agent next to its knowledge-work agent.
- Codex updates
- Claude Code updates
- How we test
Sources: Claude Code overview, Platforms and integrations (Claude Code docs), Use Claude Code in VS Code, Model configuration (Claude Code docs), Use Claude Code in the cloud, Extend Claude Code, Extend Claude with skills, Claude Code product page, Claude plans (Anthropic), Using Codex with your ChatGPT plan (OpenAI Help), Codex overview (OpenAI developer docs), Codex CLI, Codex IDE extension, Codex Cloud, Custom instructions with AGENTS.md, Codex pricing, openai/codex on GitHub. Checked on 2026-11-02.