Choose Claude Code for long, complex agentic tasks and large refactors, where its Opus 5.5 default model leads Anthropic's published agentic coding benchmark and independent reviewers favor its depth. Choose Codex if you want an open-source CLI, already pay for ChatGPT, or need lower cost per task at high volume, where OpenAI's GPT-6.1 Sol is positioned. Both start at $20 per month, so many developers try both.
What They Are
Claude Code is Anthropic's agentic coding tool. It reads your codebase, edits files, runs commands, and integrates with your development tools. It runs in the terminal, in VS Code (including Cursor) and JetBrains IDEs, in a desktop app, on the web at claude.ai/code and in the Claude mobile apps, and in Slack, with GitHub Actions, GitLab CI/CD, and code review integrations. Anthropic says every surface connects to the same underlying engine.
OpenAI Codex is described by OpenAI as ChatGPT's coding and work agent. It runs in the ChatGPT desktop, web, and mobile apps, as the Codex CLI, as an IDE extension, as Codex Cloud for background tasks, in GitHub code review, and in Slack, with an SDK for building your own integrations.
Both have grown well beyond the terminal, so the choice is less about where they run and more about models, cost, and workflow.
Models
| Claude Code | OpenAI Codex | |
|---|---|---|
| Default / recommended | Opus 5.5 (default on Pro, Max, Team, Enterprise, and API) | GPT-6.1 Sol (recommended where available) |
| Most capable | Opus 5.5; Fable 5.1 also available | GPT-6 Astra |
| Fast / efficient | Sonnet 5.5, Haiku 5.5 | GPT-6 Luna |
Anthropic released Opus 5.5 on September 22, 2026, and OpenAI followed with GPT-6.1 Sol shortly after. OpenAI pitches Sol as near-Astra performance at a lower cost, which matters for heavy daily use. Claude Code also offers an opusplan setting that uses Opus for planning and Sonnet to carry out the work.
Benchmarks: Handle With Care
There's no clean head-to-head score. The two companies emphasize different benchmarks, and results depend heavily on the test harness:
- On Terminal-Bench 4.0, Anthropic reports Opus 5.5 at 66.4% using a Claude Code harness, ahead of GPT-6 Astra's 57.9% as reported by OpenAI. On Artificial Analysis's independent Terminal-Bench 4.0 run, Opus 5.5 scored 59.6% and tied for first, according to DeepLearning.AI's The Batch.
- OpenAI says GPT-6.1 Sol matches GPT-6 Astra on its DeepSWE coding benchmark at about one-fifth of the cost, and scores 2.2 points above Opus 5.5 on AutomationBench.
- Neither launch page reports a SWE-bench Verified score for these models.
Our reading: Claude Code with Opus 5.5 holds the edge on published agentic coding results, while Codex with Sol competes hard on cost efficiency. Your own repository is the only benchmark that really counts. For more on how frontier models compare, see our AI reasoning race article.
Pricing and Usage Limits
| Tier | Claude Code (Claude plans) | Codex (ChatGPT plans) |
|---|---|---|
| Free | Not included | Quick tasks with GPT-6 Luna in the desktop app |
| Entry | Pro: $20/mo ($17/mo billed annually) | Go: $8/mo (lightweight tasks); Plus: $20/mo |
| Power user | Max 5x: $100/mo; Max 20x: $200/mo | Pro: $100, $200, or $500/mo |
| Teams | Team Standard $25/seat ($20 annual); Premium $125/seat ($100 annual) | Business: $25/user ($20 annual) |
| Enterprise | Seat fee plus usage at API rates | Contact sales (credit-based) |
- Claude limits: Max 5x and Max 20x offer five and twenty times the Pro plan's per-session usage.
- Codex limits: OpenAI publishes ranges per five-hour window on Plus. For example, 15 to 160 local messages with GPT-6.1 Sol, or 5 to 45 with GPT-6 Astra. Pro plans currently have no five-hour limit, though weekly limits may apply.
- API pricing: both can run on pay-as-you-go API keys. Opus 5.5 costs $4 per million input tokens and $20 per million output tokens; Sonnet 5.5 costs $2 and $10. GPT-6.1 Sol costs $2 and $10, GPT-6 Astra $10 and $50.
At the $20 entry level the tools are evenly matched on price. Codex has a cheaper on-ramp through ChatGPT Free and Go, while heavy users should compare Claude Max with ChatGPT Pro based on how many hours a day they run agents. Our guide to the real cost of AI tools covers how these subscriptions add up.
Open Source and Extensibility
Codex has a clear advantage on openness: the Codex CLI, SDK, App Server, and its cloud environment image are open source, with the main repository under the Apache-2.0 license. The IDE extension and Codex Cloud are not.
Claude Code is not open source, but it is highly extensible. It supports project instructions in CLAUDE.md (and can read an existing AGENTS.md), skills, hooks that run your own scripts on agent events, subagents for specialized tasks, MCP servers for connecting external tools and data, and plugins that bundle all of these for sharing through marketplaces.
Codex offers comparable building blocks: AGENTS.md project instructions, MCP support configured in its config file, skills, and plugins. Both tools can reach live web data through MCP servers such as Context.dev, a web data API for AI agents that names Claude Code and Codex as supported clients and offers 1,000 free API credits a month.
Safety and Control
Letting an agent run commands on your machine needs guardrails, and both tools take this seriously in different ways:
- Codex runs commands inside an operating-system sandbox (Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native Windows sandbox) with modes from read-only to workspace-write (the default) to full access, plus approval policies.
- Claude Code uses permission modes, including a default mode that asks before acting, an accept-edits mode, plan mode for read-only planning, and an auto mode in which a classifier reviews actions before they run.
For sensitive codebases, start both tools in their most restrictive modes and loosen them as you build trust. Our local vs cloud AI guide covers the data questions to ask first.
What Developers Actually Use
JetBrains' 2026 Developer Ecosystem research, which surveyed more than 15,000 professional developers between May and July 2026, found Claude Code used at work by about 39% of respondents, up from 18% in January, making it the most-adopted AI coding agent. Codex usage grew from 3% to 16%, making it the fastest-growing. Independent comparisons echo the split: DataCamp's September 2026 review favored Opus 5.5 for long agentic coding and GPT-6 Sol for high-volume or budget-conscious work.
Which Should You Choose?
- Large refactors and multi-step features: Claude Code with Opus 5.5.
- High-volume, cost-sensitive tasks: Codex with GPT-6.1 Sol.
- You want to inspect or modify the agent itself: Codex, for its open-source CLI.
- You already pay for ChatGPT: try Codex first; it's included in your plan.
- You want a heavily customizable agent with hooks, subagents, and plugins: Claude Code.
- Teams: both cost about the same per standard seat, so run a two-week pilot on real tickets.
If you're weighing IDE-first tools as well, our Cursor vs GitHub Copilot vs Claude Code showdown and best AI coding assistants ranking cover the wider field.
Claude Code vs Codex is the closest contest in AI coding right now. Claude Code wins on published agentic coding results, adoption, and depth of customization, making it our pick for complex, long-running engineering work. Codex wins on openness, flexible entry pricing through ChatGPT, and cost per task with GPT-6.1 Sol, making it the better value for high-volume work and teams already on ChatGPT. Since both start at $20 a month, the smart move is to run both on the same real tasks for a week and let your codebase decide.
Frequently Asked Questions
Is Claude Code better than Codex?
For complex agentic coding, Claude Code with Opus 5.5 leads on Anthropic's published Terminal-Bench 4.0 results and in developer adoption. Codex with GPT-6.1 Sol is positioned as more cost-efficient. The better choice depends on your tasks and budget.
How much does Claude Code cost?
Claude Code is included with Claude Pro at $20 per month ($17 billed annually), Max at $100 or $200 per month, and Team and Enterprise plans. It can also run on pay-as-you-go API pricing.
How much does OpenAI Codex cost?
Codex is included with ChatGPT plans: limited use on Free and Go ($8), Plus at $20 per month, Pro at $100, $200, or $500, and Business at $25 per user per month or $20 billed annually.
Is Codex open source?
The Codex CLI, SDK, and App Server are open source, with the main repository under the Apache-2.0 license. The IDE extension and Codex Cloud are not open source.
Which models do Claude Code and Codex use?
Claude Code defaults to Opus 5.5, with Sonnet 5.5, Haiku 5.5, and Fable 5.1 available. Codex recommends GPT-6.1 Sol, with GPT-6 Astra as its most capable model and GPT-6 Luna as its most efficient.
Can I use Claude Code and Codex together?
Yes. Many developers use both. Claude Code can read an AGENTS.md file, which Codex also uses for project instructions, making it easier to share context between the two.