Codex vs Claude Code in 2026: OpenAI's Coding Agent vs Anthropic's
Key factsClaude Opus 5.5 leads GPT-6 Astra 66.4% to 57.9% on Terminal-Bench 4.0
- On Anthropic's published benchmark table, Claude Opus 5.5 scored 66.4% on Terminal-Bench 4.0 versus 57.9% for GPT-6 Astra.
- Codex is included on every ChatGPT plan from Free through Enterprise, while Claude Code is bundled starting from Claude Pro.
- Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens via the API, versus $10 and $50 for GPT-6 Astra.
- Claude Code runs in the terminal, VS Code, JetBrains, a desktop app, the web and from Slack, per Anthropic's documentation.
- Codex runs in ChatGPT on the web, a desktop app, a CLI and an IDE extension, per OpenAI's documentation.
Short answer: Codex wins on availability and bundling: it is included on every ChatGPT plan, even Free, and now runs OpenAI's GPT-6 models across the web, a desktop app, a CLI and an IDE extension. Claude Code wins on the agentic coding benchmarks Anthropic publishes (66.4% on Terminal-Bench 4.0 for Claude Opus 5.5 vs 57.9% for GPT-6 Astra) and on a cheaper flagship API. Both are multi-surface agents in 2026; pick the one that matches the AI subscription you already pay for.
Note upfront: "Codex" here means OpenAI's Codex coding agent (launched in 2025), not the 2021 GPT-Codex model. It is no longer a terminal-only tool: OpenAI's Codex docs list ChatGPT on the web, the ChatGPT desktop app, the Codex CLI, the Codex IDE extension and Codex cloud as places to run it. Facts below were verified on OpenAI's and Anthropic's pages in September 2026.
Quick comparison
| Dimension | Codex | Claude Code |
|---|---|---|
| Maker | OpenAI | Anthropic |
| Where it runs | ChatGPT web, desktop app, CLI, IDE extension, cloud | Terminal, VS Code, JetBrains, desktop app, web, Slack |
| Top model | GPT-6 Astra | Claude Opus 5.5 |
| Other models | GPT-6 Sol and Luna, GPT-5.6, GPT-5.5, GPT-5.4 | Claude Sonnet 5, Haiku 4.5, Fable 5.1 (usage credits) |
| Model context (API) | 1,050,000 tokens (GPT-6 Astra) | 1M tokens (Opus 5.5, Sonnet 5) |
| Consumer pricing | Included from ChatGPT Free (limited), fuller use on Plus | Included from Claude Pro ($17 annual or $20) |
| Heavy use pricing | ChatGPT Pro $100 or $200 | Claude Max from $100 (5x or 20x) |
| Terminal-Bench 4.0 (Anthropic table) | 57.9% (GPT-6 Astra) | 66.4% (Opus 5.5) |
| FrontierCode v1.1 (Anthropic table) | 53.3% (GPT-6 Astra) | 54.4% (Opus 5.5) |
What each tool actually is
OpenAI Codex is a coding agent included with every ChatGPT plan from Free through Enterprise. It edits files, runs commands and tests, and completes multi-step development tasks in local sessions or cloud environments. The same agent is available in ChatGPT on the web, the ChatGPT desktop app, the Codex CLI and an IDE extension, all tied to your ChatGPT account. Models include GPT-6 Astra, GPT-6 Sol and Luna, GPT-5.6, GPT-5.5 and GPT-5.4.
Claude Code is Anthropic's coding agent. Per its documentation, it runs in the terminal, as a VS Code extension (which also installs in Cursor), as a JetBrains plugin, in the Claude desktop app and on the web at claude.ai/code, including from the Claude mobile app. It also takes tasks from Slack. It runs Claude Opus 5.5 and Sonnet 5, with Fable 5.1 available through usage credits.
The old framing, "Codex is terminal-only, Claude Code is IDE-native," no longer holds. Both now cover the terminal, the editor, a desktop app and the browser.
Pricing
Codex is included with every ChatGPT tier, per Codex pricing:
- ChatGPT Free and Go: limited Codex access to test it, with GPT-5.6 Terra
- ChatGPT Plus ($20/month): expanded Codex usage and the Codex app for macOS and Windows. OpenAI's usage table lists 5 to 45 GPT-6 Astra messages, 15 to 150 on GPT-6 Sol and 350 to 3,000 on GPT-6 Luna, depending on task size
- ChatGPT Pro 5x ($100/month): 5x Plus usage, for example 25 to 225 GPT-6 Astra messages
- ChatGPT Pro 20x ($200/month): 20x Plus usage, 100 to 900 on GPT-6 Astra. New sign-ups to this tier have been paused since September 10, 2026
- Credits: extra Codex usage beyond your plan; Plus users can buy credits for more GPT-6 Astra
- API direct: GPT-6 Astra at $10/M input and $50/M output; GPT-6 Sol at $2/$10
Local messages and cloud tasks share the same allowance, and weekly limits may also apply.
Claude Code is included with every paid Claude plan, per Claude pricing:
- Claude Free: no Claude Code
- Claude Pro ($17/month annual or $20 monthly): Claude Code with Pro usage, shared with chat, on a five-hour session window plus weekly limits
- Claude Max (from $100/month): 5x or 20x Pro usage per session, higher output limits, monthly billing only
- Team and Enterprise: Claude Code on team seats
- API direct: Opus 5.5 at $4/M input and $20/M output; Sonnet 5 at $2/$10
For ChatGPT subscribers, Codex costs nothing extra. For Claude subscribers, Claude Code is bundled from Pro up. The cost question matters only if you are choosing an AI ecosystem from scratch, and then the one real difference is that Codex has a free entry point and Claude Code does not.
Benchmarks
Only vendor-published numbers belong here, and the only side-by-side table comes from Anthropic's Opus 5.5 launch post:
| Benchmark (Anthropic-reported) | Claude Opus 5.5 | GPT-6 Astra | GPT-5.6 Sol |
|---|---|---|---|
| Terminal-Bench 4.0 | 66.4% | 57.9% | 37.3% |
| FrontierCode v1.1 | 54.4% | 53.3% | 47.5% |
| CursorBench 4.0 | 57.8% | Not reported | 41.7% |
OpenAI's Astra launch post calls it "the best model for software engineering to date" and reports its own coding evaluations (Terminal-Bench 4.0, FrontierCode 1.1 Extended, DeepSWE), without Opus 5.5 in the comparison. Read both sets as vendor claims.
The takeaway: on Anthropic's table, Claude Code's top model leads clearly on terminal work and narrowly on FrontierCode. For most real tasks, the gap between the two agents is smaller than any headline number, and harness quality matters as much as the model.
When Codex wins
- You already pay for ChatGPT. Codex is bundled on every plan, including Free and Go, so there is nothing new to buy.
- You want OpenAI's GPT-6 models. Astra, Sol and Luna are all available in Codex, and Luna alone gives Plus users hundreds to thousands of messages per window.
- Long sessions that outgrow the context window. With Astra, OpenAI added a way for Codex to keep notes across context windows and search earlier ones, instead of relying only on compaction.
- Computer use and browser QA. OpenAI positions Astra as its strongest computer-use model and pairs it with a faster Codex harness.
- Mixed teams. ChatGPT Business and Enterprise put Codex, Chat and Work in one workspace.
When Claude Code wins
- Agentic terminal work. Anthropic's table shows Opus 5.5 at 66.4% on Terminal-Bench 4.0, well ahead of GPT-6 Astra.
- Cheaper flagship tokens. Opus 5.5 costs 40% of Astra's API price per token, which matters when you pay per token or buy extra usage.
- Large-codebase refactoring. Opus 5.5 and Sonnet 5 both have 1M-token windows, and Claude tends to match an existing codebase's conventions closely.
- Editor choice. First-party VS Code and JetBrains integrations, plus the same extension inside Cursor.
- Session handoff.
claude --resumeand--continuerestore sessions,claude --teleportpulls a web session into your terminal, and/desktopmoves a terminal session into the desktop app. - Automation. Routines run on a schedule in the cloud, GitHub Actions and GitLab CI integrations handle reviews, and Slack mentions turn bug reports into pull requests.
Workflow differences
Codex workflow (CLI):
- Open a terminal
codexto start a session- Describe the task
- Codex plans, edits files, runs tests
- Review the diff, continue or close
The same loop runs in the ChatGPT desktop app, the IDE extension or the web, with cloud tasks for longer jobs.
Claude Code workflow (CLI):
- Open a terminal
claudeto start a session- Same agent loop
claude --continueor/resumeto pick up later
Claude Code workflow (IDE or desktop):
- Open the Claude Code panel in VS Code, JetBrains or the desktop app
- Same agent loop, with inline diffs and plan review
- Switch to the terminal mid-task if you want
In 2026, both tools work in the terminal, the editor and the browser. The deciding factors are models, limits and ecosystem, not interface.
Cost per session for heavy users
Assume a heavy coding session of 50,000 input tokens and 30,000 output tokens.
- Codex on ChatGPT Plus: no marginal cost until you hit the usage table limits; GPT-6 Astra runs out first
- Claude Code on Claude Pro: no marginal cost until the session or weekly limit
- GPT-6 Astra via API: 50K × $10 + 30K × $50 per million = $0.50 + $1.50 = $2.00
- GPT-6 Sol via API: $0.10 + $0.30 = $0.40
- Claude Opus 5.5 via API: 50K × $4 + 30K × $20 per million = $0.20 + $0.60 = $0.80
- Claude Sonnet 5 via API: $0.10 + $0.30 = $0.40
Sonnet 5 and GPT-6 Sol tie as the cheapest serious options per token. At the flagship level, a session on Opus 5.5 costs less than half of the same session on GPT-6 Astra.
The hybrid setup
A common pattern: subscribe to both ChatGPT Plus and Claude Pro, run Codex when you want OpenAI's models and Claude Code when you want Anthropic's, for $40 a month total.
The gap between the two tools is small but real, and they fail in different ways. If Claude says an approach will not work, ask GPT-6 the same question. Disagreements are where you learn the most.
See our Claude vs ChatGPT for coding for the broader comparison and Claude Code vs Cursor for the editor-first alternative.
For broader AI tool comparisons including coding alternatives, Toolradar lists 9,000+ tools with verified pricing and AI-identified alternatives.
FAQ
Is Codex better than Claude Code?
On Anthropic's published table, Claude Opus 5.5 leads GPT-6 Astra on Terminal-Bench 4.0 (66.4% vs 57.9%) and slightly on FrontierCode. Codex wins on access: it is included on every ChatGPT plan, including Free, and runs OpenAI's full GPT-6 family. For most tasks the two are close, so pick based on the subscription you already have.
Is Codex free with ChatGPT Plus?
Yes. Codex is included on every ChatGPT plan from Free through Enterprise. On Plus, OpenAI's usage table lists 5 to 45 GPT-6 Astra messages per window, 15 to 150 on GPT-6 Sol and 350 to 3,000 on GPT-6 Luna, and you can buy credits for more. Heavy users can move to ChatGPT Pro for 5x or 20x Plus usage.
Should I switch from Claude Code to Codex?
Only if you prefer OpenAI's models or already pay for ChatGPT and want to avoid a second subscription. Claude Code's cheaper flagship API, 1M-token models and editor integrations remain strong reasons to stay. Run both for a week on your own codebase before deciding.
What's the difference between OpenAI Codex (2026) and the old Codex (2021)?
The 2021 Codex was a code-completion model that powered the first GitHub Copilot and was deprecated in 2023. Today's Codex is a coding agent, launched in 2025, that edits files, runs code and completes multi-step tasks across ChatGPT, a desktop app, a CLI and an IDE extension.
Can I use Codex inside an IDE?
Yes. OpenAI ships a Codex IDE extension alongside the CLI, the ChatGPT desktop app and the web experience, all connected to your ChatGPT account. Codex is not terminal-only anymore.
Which has a bigger context window, Codex or Claude Code?
At the model level they are almost identical: GPT-6 Astra has a 1,050,000-token window in the API, and Claude Opus 5.5 and Sonnet 5 have 1M. Codex with Astra can also keep notes across context windows during long sessions. For typical single-module work, both have far more context than you need.
The right coding agent in 2026 isn't Codex or Claude Code. It's the one bundled with the AI subscription you already pay for. Start your free 14-day Dupple X trial →