Claude Code vs Codex CLI comes down to token math, not vibes. Codex bills GPT-5.6 Sol at $5/$30 per million tokens. Claude Opus 5 runs $5/$25 — but Anthropic’s own docs warn its newer tokenizer emits roughly 30% more tokens for the same text. That erases the discount. Codex wins on cost per solved task. Claude Code wins on agent orchestration.
Both agents shipped meaningful releases this month, and both are now close enough on quality that price is the deciding variable. Here is the full breakdown, with every figure sourced.
What changed for Claude Code vs Codex CLI in the last week?
Anthropic shipped four Claude Code builds between August 13 and August 18, 2026. The headline change is subagent forking on by default. OpenAI’s Codex CLI moved earlier in the month, adding a one-command importer that pulls your Claude Code setup straight into Codex.
Claude Code v2.1.232 made subagent_type: "fork" the default, so spawned agents inherit the full conversation and prompt cache. It also added cross-session @ mentions, letting one session message another by name.
v2.1.233 added GitLab merge request support on August 15. v2.1.234, first seen August 18, added automatic session continuation when you hit a usage limit — a direct answer to the biggest complaint about subscription-metered agents.
Codex CLI v0.147.0, dated August 4, 2026, added --approve-for-me for auto-reviewed approvals, opt-in support for the MCP 2026-07-28 protocol, and /import, which pulls supported setup and recent chats from Claude Code and Cursor. OpenAI is openly courting defectors.
Which is better for coding, Claude Code or Codex CLI?
On raw capability the two are inside each other’s error bars. The official Terminal-Bench harness leaderboard puts Claude Code first by 0.7 points. Artificial Analysis, running the same benchmark against models rather than harnesses, puts OpenAI first by 0.4 points. Neither gap is decisive.
The harness leaderboard gives Claude Code the edge
On the official Terminal-Bench 2.1 leaderboard, Claude Code running Fable 5 sits at 83.8% (±1.2), submitted June 7, 2026. Codex with GPT-5.5 follows at 83.1% (±1.1).
Below that, Cursor CLI on Grok 4.5 scores 79.3%, Claude Code on Opus 4.8 hits 78.9%, and Codex on GPT-5.6 Terra lands at 78.4%. Gemini CLI on Gemini 3.1 Pro trails at 65.8%.
Read that spread carefully: the harness matters less than the model inside it. Swapping Fable 5 for Opus 4.8 inside the same Claude Code wrapper costs 4.9 points.
The model leaderboard gives OpenAI the edge
Artificial Analysis runs Terminal-Bench v2.1 across 89 curated tasks spanning software engineering, sysadmin, data processing, model training and security. GPT-5.6 Sol at xhigh effort tops it at 89.5%.
Claude Opus 5 at max effort scores 89.1%. Grok 4.6 at high effort takes third with 88.4%. A 0.4-point gap on an 89-task benchmark is roughly one third of a task. Call it a tie.
How much do Claude Code and Codex CLI cost in 2026?
Anthropic prices Claude Opus 5 at $5 input and $25 output per million tokens. OpenAI prices GPT-5.6 Sol at $5 and $30. On the sticker, Anthropic is 17% cheaper on output. Subscription tiers land within $20 of each other at every level.
Token prices, side by side
| Model | Input / 1M | Output / 1M | Cached input | Context |
|---|---|---|---|---|
| Claude Opus 5 | $5 | $25 | $0.50 | 200K (1M available) |
| Claude Sonnet 5 | $2 | $10 | $0.20 | 200K |
| Claude Fable 5 | $10 | $50 | $1 | 200K |
| GPT-5.6 Sol | $5 | $30 | $0.50 | 1.05M |
| GPT-5.6 Terra | $2 | $12 | $0.20 | 1.05M |
| GPT-5.6 Luna | $0.20 | $1.20 | $0.02 | 1.05M |
The tier structures mirror each other almost exactly. Sonnet 5 and Terra both cost $2 input. Anthropic has no answer to Luna’s $0.20/$1.20, which OpenAI claims beats Fable 5 on Agents’ Last Exam at an estimated cost per task nearly 99% lower.
Subscription plans and what they actually buy
- Claude Free — $0. Claude Code included, limits reset on a rolling five-hour window.
- Claude Pro — $20/month, or $17/month billed annually. At least 5x Free usage per session.
- Claude Max — from $100/month, in 5x and 20x tiers above Pro.
- Codex Go — $8/month, web and CLI access only.
- Codex Plus — $20/month, adds IDE and iOS.
- Codex Pro — $100/month (5x) and $200/month (20x).
One structural difference matters. Anthropic pools your usage: web, desktop, mobile and Claude Code all draw from the same bucket. Chat with Claude all afternoon and your coding agent gets less runway.
OpenAI meters Codex in credits. Its published rate card charges 125 credits per million Sol input tokens and 750 per million output. At the standard $0.04 per credit, that is exactly the $5/$30 API rate — no subscription markup, no discount. OpenAI’s own guidance puts real-world spend at roughly $100 to $200 per developer per month.
What is the real cost per solved task?
Price per token is the wrong metric. What you pay is price per token multiplied by tokens consumed, and on that measure Codex currently wins by a wide margin. Two multipliers work against Claude: a heavier tokenizer and a chattier agent loop.
The tokenizer tax nobody prices in
Anthropic’s own pricing documentation carries a warning most buyers skip: Claude 4.7 and later use a newer tokenizer that produces about 30% more tokens for the same text than earlier models.
Run the arithmetic. Opus 5 output at $25 per million, inflated 30%, is an effective $32.50 for the text volume that Sol bills at $30. Anthropic’s 17% headline discount becomes an 8% premium.
The token-efficiency gap is the bigger number
Independent head-to-head testing published by Morph puts the consumption gap at 3.2x to 4.2x. On a Figma plugin build, Codex burned 1,499,455 tokens against Claude Code’s 6,232,242. On a scheduler app, 72,579 against 234,772.
Combine the two effects and the verdict is brutal. A 17% per-token discount against a 4.2x volume gap leaves Claude Code roughly 3.5x more expensive per completed task in that test set.
That gap is a workflow choice, not a defect. Claude Code explores more, forks more subagents, and reads more of your repo. You are paying for breadth. Whether breadth is worth 3.5x depends entirely on whether your tasks are ambiguous or well specified.
Which coding agent should you buy in 2026?
Pick Codex if your work is well-specified and high-volume. Pick Claude Code if your work is exploratory, multi-repo, or heavy on parallel agents. Pick Luna or Sonnet 5 for anything routine — the flagship tier is wasted on boilerplate, and that is where most teams overspend.
| Your situation | Buy | Monthly | Why |
|---|---|---|---|
| Solo dev, tight budget | Codex Go | $8 | Cheapest real CLI agent; token efficiency stretches it furthest |
| Solo dev, daily driver | Claude Pro (annual) | $17 | Pooled usage across chat and code; cheapest flagship access |
| High-volume refactors | Codex Plus or Pro | $20–$200 | 3–4x fewer tokens per task at near-identical benchmark scores |
| Parallel agent swarms | Claude Max 20x | $200 | Fork-by-default subagents, no published parallel-agent cap |
| Large-context monorepo | Codex on Sol | Usage-based | 1.05M-token context at flat pricing under the long-context threshold |
| Routine boilerplate | Codex on Luna | Usage-based | $0.20/$1.20 per million; 96% cheaper output than Sol |
Is Claude Code worth $200 a month in 2026?
Yes, if you run agents in parallel. Max 20x buys 20x the per-session allowance of Pro, and Claude Code’s fork-by-default subagents inherit the prompt cache, so parallelism is cheap in wall-clock terms. Codex reportedly caps developers at eight parallel agents.
No, if you are a single developer running one session at a time. At that duty cycle you will not exhaust Pro’s $17 annual tier, and the extra $183 buys headroom you never touch.
The August 18 addition of automatic session continuation at usage limits changes the calculus slightly. Hitting a cap now costs you a pause rather than a lost session, which makes the cheaper tiers more tolerable.
For the model layer underneath these harnesses, our breakdowns of Muse Spark vs Claude Opus 5 and Gemini 3.7 Flash vs Claude Sonnet 5 cover the cost-per-coding-point math in detail.
Frequently asked questions
Can I switch from Claude Code to Codex CLI without redoing my setup?
Yes. Codex CLI v0.147.0, released August 4, 2026, added /import, which pulls supported setup files and recent chats from both Claude Code and Cursor.
Which has the larger context window?
Codex. All three GPT-5.6 tiers carry a 1.05M-token window. Anthropic’s pricing page lists 200K as standard, noting that 4.5+ models include a 1M-token window at standard pricing.
Does Claude Code cost extra on top of a Claude subscription?
No. Claude Code is included on Free, Pro and Max, and shares the same usage pool as web, desktop and mobile. You can enable pay-as-you-go credits on paid plans once you hit a limit.
Is the cheapest model good enough for coding?
For routine work, often yes. OpenAI states Luna outperforms Fable 5 on Agents’ Last Exam at an estimated cost per task nearly 99% lower. On Terminal-Bench 2.1, Codex on Luna still scored 75.7%.
Which agent tops the Terminal-Bench leaderboard right now?
Claude Code with Fable 5, at 83.8%, leads the official harness leaderboard. On Artificial Analysis’s model-level run of the same benchmark, GPT-5.6 Sol leads at 89.5%.
Do open-weight models beat either of these on cost?
On price per token, easily. On benchmark parity, not yet at the top tier. We compared the leading options in GLM-5.3 vs DeepSeek V4 Pro.
Will these prices hold?
Assume not. The DeepSeek price increase showed how fast the floor can move. OpenAI cut Luna’s rate on July 30 and raised long-context rates at the same time.
The bottom line
Buy Codex if you are optimizing spend. The benchmark gap between the two is smaller than the measurement error, and Codex delivers that parity at roughly a third to a quarter of the token consumption. That is not a rounding difference — on a $200/month budget it is the gap between running out on day 20 and finishing the month.
Buy Claude Code if you are optimizing throughput on ambiguous work. Fork-by-default subagents, cross-session mentions and an uncapped parallel-agent model make it the better orchestrator, and orchestration is where the next year of agent productivity gets won.
What it depends on, precisely: if your average task ships with a clear spec and acceptance criteria, Codex is cheaper for identical output. If your average task starts with “figure out why this breaks,” Claude Code’s extra tokens are buying you something real.
The move most teams should make is neither: run Luna or Sonnet 5 for 80% of tasks and reserve the flagship tier for the 20% that need it. That single routing decision saves more money than picking the right vendor.
Sources
- Terminal-Bench 2.1 official leaderboard
- Artificial Analysis — Terminal-Bench v2.1 evaluation
- Claude Platform — model pricing documentation
- Claude — plans and pricing
- OpenAI Help Center — Codex rate card
- OpenAI — Advancing the price-performance frontier with GPT-5.6
- Anthropic — Claude Code v2.1.232 release notes
Leave a Reply