Short answer: Pick Claude Code if you want the strongest agent for big, multi-file changes, a 1M-token context window and cheaper API rates. Pick OpenAI Codex if you already pay for ChatGPT, want an open-source CLI or work mostly on Windows. Both start at $20 a month, and both run in your terminal, your editor, a desktop app and the cloud.
Last checked: October 2026. Prices are US list prices on each official site and can change
Codex vs Claude Code at a glance
| Feature | OpenAI Codex | Claude Code |
|---|---|---|
| Made by | OpenAI | Anthropic |
| Entry plan | ChatGPT Plus, $20/mo | Claude Pro, $20/mo ($17/mo billed yearly) |
| Free option | Limited trial on ChatGPT Free and Go | Not on Claude Free |
| Power plans | ChatGPT Pro at $100, $200 or $500/mo | Claude Max at $100 (5x) or $200 (20x)/mo |
| Team plans | ChatGPT Business, $20/user yearly or $25 monthly | Claude Team, $20/seat yearly or $25 monthly |
| Top models | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol, GPT-6 Luna | Claude Opus 5.5 (default), Sonnet 5.5, Fable 5.1 |
| Context window | Not published | 1M tokens on Opus 5.5, Sonnet 5.5 and Fable 5.1 |
| Where it runs | CLI, IDE extension, desktop app, web, mobile, Slack, GitHub | CLI, VS Code and JetBrains, desktop app, web, mobile, Slack, GitHub and GitLab |
| Open source | Yes, the CLI is Apache-2.0 | No, the repo is public but the code is proprietary |
| Project instructions file | AGENTS.md | CLAUDE.md (also reads AGENTS.md) |
| Sandbox on native Windows | Yes | No (sandbox on macOS, Linux and WSL2) |
| API price, top model | GPT-6 Astra: $10 in / $50 out per 1M tokens | Opus 5.5: $4 in / $20 out per 1M tokens |
Sources: Codex pricing, Claude pricing and Claude Code docs. For full profiles, see our OpenAI Codex review and Claude Code review.
Pricing: which costs less?
At the entry level, they cost the same: $20 a month. Claude Pro drops to $17 a month if you pay yearly, and Codex gives Free and Go users a limited trial, which Claude doesn’t.
Both use rolling 5-hour usage windows with weekly limits on top, and both share that allowance with the rest of the app. Codex shares it with ChatGPT Work. Claude Code shares it with your Claude chats. Neither company publishes exact message counts for every plan, so heavy users usually move up a tier.
- Heavy daily use: Claude Max at $100 (5x Pro) or $200 (20x Pro) versus ChatGPT Pro at $100, $200 or $500. OpenAI says Pro currently has no 5-hour limit on Codex.
- Teams: identical seat prices, $20 a seat billed yearly or $25 monthly, with Claude Code on Team Standard seats and Codex on ChatGPT Business.
- Pay as you go: both work with an API key. Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens. GPT-6 Astra costs $10 and $50. Cheaper models (Sonnet 5.5, GPT-6 Luna) cut costs a lot.
Models and coding performance
Claude Code runs on Claude Opus 5.5 by default, released September 22, 2026. You can switch to Sonnet 5.5 for speed or Fable 5.1, Anthropic’s most capable model, where your plan includes it. All three have a 1M-token context window, which helps on large codebases.
Codex lets you pick GPT-6 Astra (most capable), GPT-6.1 Sol (close to Astra at a lower cost) or GPT-6 Luna (fastest and cheapest).
| Benchmark (vendor-reported) | Claude Opus 5.5 | GPT-6 Astra |
|---|---|---|
| Terminal-Bench 4.0 | 66.4% | 57.9% |
| FrontierCode v1.1 | 54.4% | 53.3% |
These numbers come from Anthropic’s and OpenAI’s own launch pages, not independent tests. Treat them as a rough guide and try both on your own repo.
Features compared
Where Claude Code is stronger
- Bigger context: 1M tokens means it can hold much more of your codebase at once.
- Agent tools: subagents, agent teams, background agents, hooks, skills and MCP are mature and well documented.
- More places to run: GitLab CI/CD and JetBrains, plus the option to run on Amazon Bedrock or Google Cloud.
- Cheaper top model on the API: Opus 5.5 costs less than half of GPT-6 Astra per token.
Where Codex is stronger
- Open source CLI: you can read, fork and audit the code.
- Windows: Codex has a native Windows sandbox. Claude Code runs commands without a sandbox on native Windows.
- One subscription: if you already pay for ChatGPT, Codex is included with no extra bill.
- Code review included: Codex reviews GitHub pull requests within your plan. Claude Code’s GitHub Code Review is a research preview for Team and Enterprise, billed separately at about $15 to $25 a review.
Which should you choose?
| If you… | Choose |
|---|---|
| Work on large codebases or multi-file refactors | Claude Code |
| Already pay for ChatGPT Plus or Pro | Codex |
| Code mostly on native Windows | Codex |
| Want the cheapest top-model API rates | Claude Code |
| Need an open-source tool you can audit | Codex |
| Use GitLab or JetBrains | Claude Code |
| Run a team and want the same price either way | Try both on a trial, then pick |
Plenty of developers use both: Claude Code for the hard work and Codex for quick tasks inside ChatGPT. Comparing an editor instead? Read Cursor vs Claude Code. For every option, see our list of the best AI coding agents, including Cursor and GitHub Copilot.
FAQ
Is Codex or Claude Code better?
Claude Code is better for large codebases and complex multi-file work thanks to its 1M-token context and mature agent tools. Codex is better if you already pay for ChatGPT, want an open-source CLI or work on native Windows.
Is Claude Code cheaper than Codex?
On subscriptions they cost the same: $20 a month to start and $100 or $200 for heavy use. On the API, Claude Opus 5.5 is cheaper than GPT-6 Astra at $4 versus $10 per million input tokens and $20 versus $50 per million output tokens.
Can I use Codex for free?
ChatGPT Free and Go include a limited Codex trial. For regular use you need ChatGPT Plus at $20 a month or higher. Claude Code is not on Claude’s free plan.
Is Claude Code open source?
No. The Claude Code GitHub repo is public, but its license says all rights are reserved by Anthropic. The Codex CLI is open source under the Apache-2.0 license.
Which models do Codex and Claude Code use?
Codex uses OpenAI’s GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol and GPT-6 Luna. Claude Code uses Claude Opus 5.5 by default, with Sonnet 5.5 and Fable 5.1 as options.
Can I use Codex and Claude Code together?
Yes. Both read an AGENTS.md file, so you can keep one set of project instructions and switch tools by task.
