Blog

Codex vs Claude Code: features, pricing and bug data

A current comparison of OpenAI's Codex and Anthropic's Claude Code, checked against both vendors' docs, with Bug Bench data on the code each one writes.

Alex Mercer

Codex and Claude Code now cover nearly the same ground, so the choice comes down to which models you want, which safety defaults you prefer, and which subscription you already pay for. Pick Codex for OpenAI's GPT models, an OS-level sandbox that is on by default and an open-source CLI; pick Claude Code for Anthropic's Claude models, more hook types and extension points, and a wider choice of cloud providers.

Product details are from both vendors' docs as of October 13, 2026.

Feature lists don't show how the code turns out, so this comparison also uses Bug Bench, cubic's public benchmark of bugs found in AI-written code during review. In the week of October 5, Claude Code accounted for 78.1% of the AI-written code in that data and Codex for 18.8%. Inside each agent, the model with the lowest relative bug rate was GPT-5.6 Sol for Codex and Claude Fable 5.1 for Claude Code, though Fable 5.1 is statistically tied with Claude Sonnet 5.5. For more agents side by side, see our guide to the best AI coding tools and agents, with Bug Bench data.

Codex vs Claude Code at a glance


Codex (OpenAI)

Claude Code (Anthropic)

Where it runs

CLI, IDE extension, ChatGPT desktop app, Codex Cloud on web and mobile

CLI, VS Code and JetBrains, Claude desktop app, web and mobile

Models

OpenAI GPT models; GPT-6.1 Sol recommended for complex coding

Claude models; Opus 5.5 is the default on paid plans and the API

Local sandbox

On by default, network off

Available for shell commands, off by default

Approvals

Ask for approval, Approve for me, Full access

Six permission modes; auto mode is the default start in terminal and VS Code

Instruction file

AGENTS.md

CLAUDE.md, or AGENTS.md when there is no CLAUDE.md

Extensions

MCP, skills, plugins, hooks, subagents

MCP, skills, plugins, hooks, subagents, output styles

CLI license

Open source (Apache-2.0)

Not open source (all rights reserved)

Included in

ChatGPT Free through Enterprise (Free and Go limited)

All paid Claude plans

Pay per token

OpenAI API key

Claude Console API key or a cloud provider

What each one is and where it runs

Codex

Codex is OpenAI's coding agent. Its docs now live on learn.chatgpt.com.

  • Codex CLI: macOS, Linux and Windows, with codex exec for scripts and CI.

  • IDE extension: VS Code, Cursor and Windsurf. Xcode and JetBrains IDEs have their own Codex integrations.

  • ChatGPT desktop app: macOS and Windows, with a Linux install guide. A Codex chat runs locally, in a Git worktree or in the cloud.

  • Codex Cloud: tasks run in reusable cloud environments, started from the web, mobile, the desktop app or codex cloud.

  • Codex on mobile: start and approve tasks on your Mac or Windows PC from the ChatGPT iOS app, where it has rolled out.

It also has Slack and Linear integrations, a GitHub Action and SDKs.

Claude Code

Claude Code is Anthropic's coding agent, with the same engine on every surface.

  • CLI: macOS, Linux, WSL and Windows. Scripting and the Agent SDK are CLI-only.

  • IDEs: a VS Code extension (it also installs in Cursor) and a JetBrains plugin that needs the CLI.

  • Desktop app: the Code tab of the Claude app on macOS and Windows, with Linux in beta. It needs a paid plan.

  • Web and mobile: cloud sessions at claude.ai/code and in the Claude app for iOS and Android.

  • Remote Control: steer a session on your own machine from a phone or browser.

Integrations cover Chrome, Slack, GitHub Actions and GitLab CI/CD.

Models

Codex models

OpenAI's models page recommends GPT-6.1 Sol "for complex coding and agentic workflows," with near-Astra performance at a lower cost than Astra. GPT-6 Astra is its most capable model, and GPT-6 Luna is the efficient one for focused, high-volume tasks. GPT-5.6 Sol, Terra and Luna "remain available during the rollout."

Codex can also run OpenAI models through Amazon Bedrock or a Responses API-compatible gateway.

Claude Code models

Anthropic's model configuration page lists Opus 5.5 as the default on Pro, Max, Team, Enterprise and the Anthropic API. The sonnet alias points to Sonnet 5.5 on the Anthropic API, and haiku covers simple tasks.

Fable 5.1 and Fable 5 are "the most capable models in Claude Code." Neither is a default anywhere, and on some plans Fable usage bills to usage credits. Claude Code also runs on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, where the aliases can point to older versions.

Permissions and sandboxing

Codex sandboxes commands by default

From OpenAI's sandbox and security pages:

  • Local commands run inside an OS-enforced sandbox: Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows.

  • The default workspace-write mode lets Codex read files, edit inside the workspace and run routine commands, with network access off.

  • The on-request approval policy asks before crossing that boundary; never doesn't ask.

  • In the app and IDE you pick Ask for approval, Approve for me (a reviewer agent answers eligible requests) or Full access.

Claude Code starts with permission modes

From Anthropic's permission modes and sandboxing pages:

  • There are six modes: Manual (default), acceptEdits, plan, auto, dontAsk and bypassPermissions.

  • Since v2.1.283, auto mode is the starting mode for interactive terminal and VS Code sessions. A second model, a classifier, reviews actions in place of you.

  • Allow, ask and deny rules sit on top, and deny rules apply in every mode.

  • The OS sandbox (Seatbelt on macOS, bubblewrap on Linux and WSL2) is off by default; /sandbox turns it on. It covers shell commands only, so file tools, MCP servers and hooks run outside it.

  • On native Windows, commands run unsandboxed unless you use WSL2.

Codex limits what a command can reach unless you open it up, while Claude Code has a model review actions and leaves the OS boundary to you. Turning on /sandbox is the closest match to Codex's default.

Project instruction files: AGENTS.md and CLAUDE.md

Codex reads AGENTS.md "before doing any work." It loads a global file from ~/.codex, then one file per directory from the repo root down to where you started, with AGENTS.override.md for overrides. The combined size is capped at 32 KiB by default.

Claude Code reads CLAUDE.md files at the organization, user, project and local (CLAUDE.local.md) levels, with @path imports. Since 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. To load both, set Project instructions to claude-md-and-agents-md, or import AGENTS.md from your CLAUDE.md.

A repo with a single AGENTS.md now works in both tools. Instruction files only state your rules, though. Checking that code follows them is a review job, covered in how to configure coding agents that follow your team's standards.

Extensions: MCP, hooks, subagents, skills and plugins

Both tools support the same building blocks, and both write skills in the open Agent Skills format (a SKILL.md file).


Codex

Claude Code

MCP servers

STDIO and streamable HTTP, in config.toml (docs)

claude mcp add or a project .mcp.json (docs)

Skills

.agents/skills, invoked with $

.claude/skills, invoked with / (docs)

Hooks

Scripts or MCP tools; you trust each hook before it runs (docs)

Shell command, HTTP request, MCP tool, prompt or subagent (docs)

Subagents

On by default; custom agents as TOML files (docs)

Custom subagents as Markdown files, plus agent teams (docs)

Plugins

Skills, MCP servers and hooks, from a catalog shared with ChatGPT or a team marketplace (docs)

Skills, agents, hooks and MCP servers, from Anthropic's marketplace or your team's (docs)

Claude Code adds more extension points, such as output styles and dynamic workflows. Switching is cheap in both directions: the Codex CLI's /import brings over a Claude Code setup, and Claude Code's /import codex brings in Codex instruction files, MCP servers, subagents and skills.

Open source status

The Codex CLI is open source under Apache-2.0 in openai/codex, which also holds the SDK. OpenAI's open source page lists the IDE extension and Codex Cloud as not open source.

Claude Code is not open source. The license file in anthropics/claude-code reads "All rights reserved," and use falls under Anthropic's terms. Claude Code's sandbox runtime is open source.

Pricing and plans

Codex. OpenAI's Codex pricing page includes Codex in ChatGPT Free, Go, Plus, Pro, Business, Edu and Enterprise. Free and Go get GPT-6 Luna in the desktop app, subject to rollout. Plus adds Codex on the web, in the CLI, in the IDE extension and on iOS, with GPT-6.1 Sol. Plus and Pro users can buy credits when they hit their limits. An OpenAI API key works for the CLI, SDK and IDE extension at API rates, but Codex Cloud needs a ChatGPT sign-in.

Claude Code. Anthropic's pricing page says Claude Code "is included in all paid plans": Pro, Max, Team and Enterprise. It shares one usage pool with the rest of your plan, and paid plans can add usage credits at standard API rates. You can also pay per token with a Claude Console API key, or through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. The desktop app, cloud sessions and mobile need a Claude subscription, per the feature availability page.

What Bug Bench shows about code from each agent

How the data works

  • Counted bug: a cubic review finding on AI-written code that a developer upvoted or an AI coding agent addressed.

  • Relative bug rate: counted bugs per AI-attributed line, divided by the rate across all AI-attributed lines in the window. 1.00 is average, and lower is better.

  • Statistically tied: the two models' 95% confidence intervals overlap.

The data is observational, not causal. Teams choose their models, so a rate reflects the code each model was used for as well as the model.

Share of AI-written code, June to October

Coding agent

Week of June 22

Week of October 5

Claude Code

64.8%

78.1%

Codex

21.4%

18.8%

Codex reached 38.4% in the week of August 24 before falling back, and Claude Code dipped to 50.2% in the week of August 17. These shares describe the code in Bug Bench's review data, not the whole market. Cursor's share is covered in Cursor vs Claude Code and Cursor vs Codex.

Models ranked inside each agent

Each rate compares one model's code, written through one agent, against the all-model average. Bug Bench doesn't publish a single bug rate per agent, so this data doesn't say which agent writes fewer bugs.

Agent

Model

Relative bug rate

Statistically tied with

Codex

GPT-5.6 Sol

0.62

none

Codex

GPT-6 Astra

1.13

GPT-6.1 Sol

Codex

GPT-6.1 Sol

1.22

GPT-6 Astra

Claude Code

Claude Fable 5.1

1.09

Claude Sonnet 5.5

Claude Code

Claude Sonnet 5.5

1.24

Claude Fable 5.1, Claude Opus 5

Claude Code

Claude Opus 5

1.33

Claude Sonnet 5.5

Claude Code

Claude Opus 5.5

1.49

none

In Codex, GPT-5.6 Sol had 38% fewer counted bugs than the all-model average, with no tie. It is also first of seven models across all agents, at 0.65. In Claude Code, Claude Fable 5.1 had 9% more and is statistically tied with Claude Sonnet 5.5, so neither is clearly ahead. Sonnet 5.5 and GPT-6.1 Sol first appeared in the data in the week of September 28, and Opus 5.5 a week earlier, so their rates cover only two or three weeks. The other models in the table have five weeks or more.

What this means for model choice

So far, neither vendor's suggested model has the lowest rate inside its own agent, but both have short records. Claude Code defaults to Opus 5.5, at 1.49 inside Claude Code on three weeks of data. OpenAI recommends GPT-6.1 Sol, at 1.22 inside Codex on two weeks of data, statistically tied with GPT-6 Astra. Across all agents, GPT-6.1 Sol had 18% fewer counted bugs per line than Opus 5.5 (1.23 vs 1.50), and GPT-5.6 Sol had 40% fewer than Claude Fable 5.1 (0.65 vs 1.09). And because teams choose their models, each rate also reflects the work that model was given.

Which one to use, by situation

  • You already pay for ChatGPT: start with Codex, which comes with every ChatGPT plan.

  • You already pay for Claude: start with Claude Code, which shares your plan's usage pool.

  • You want a sandbox on by default, or you're on native Windows: Codex. Claude Code's sandbox is opt-in and needs WSL2 on Windows.

  • You need a CLI you can audit or fork: the Codex CLI is Apache-2.0.

  • Your company buys models through a cloud provider: Claude Code runs on Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry. Codex documents Amazon Bedrock and gateways.

  • You want hooks that do more than run a script: Claude Code hooks can also POST to a URL or ask a model to decide. Codex runs command and MCP tool hooks.

  • Your team uses both: keep one AGENTS.md, and use /import to copy setup across.

Whichever you pick, choose the model on purpose and review what it writes before it merges. On GitHub, cubic reviews each pull request against your codebase and your team's rules. The AI code review guide explains how, and how successful teams ship AI-generated code to production covers the process around it.

FAQ

Is Codex taking over Claude Code?

Not in Bug Bench's data. Claude Code's share of AI-written code rose from 64.8% in the week of June 22 to 78.1% in the week of October 5, while Codex's fell from 21.4% to 18.8%. Weekly shares swing, and this covers reviewed code only, not the whole market.

Which is better, ChatGPT Plus for Codex or Claude Pro for Claude Code?

Both plans include the agent. ChatGPT Plus covers Codex in the CLI, IDE extension, web and iOS with GPT-6.1 Sol and GPT-6 Luna, while Claude Pro includes Claude Code, defaulting to Opus 5.5, from the same usage pool as chat. Limits depend on the model and task, so compare both pricing pages.

Is Codex good for coding?

By Bug Bench's measure, its best model did well. GPT-5.6 Sol had a relative bug rate of 0.62 inside Codex and ranks first of seven models overall, while the newer GPT-6 Astra and GPT-6.1 Sol came in at 1.13 and 1.22, statistically tied, with GPT-6.1 Sol on two weeks of data. The data is observational, so each rate also reflects the work teams gave that model.

Can I use Codex and Claude Code on the same repo?

Yes. Codex reads AGENTS.md, and so does Claude Code when the repo has no CLAUDE.md, or alongside one if you change its Project instructions setting. Each CLI's /import command copies setup from the other.

Table of contents