Guide8 min read

Codex vs Claude Code: A Reproducible 2026 Benchmark

Codex vs Claude Code, benchmarked on the same repos and the same model. See the winner by workload, cost per successful task, and a downloadable rerun.

Fast Inference

Codex vs Claude Code: harness first, model second

Codex (OpenAI) and Claude Code (Anthropic) are terminal-first coding agents that run a near-identical loop, so "codex vs claude code" usually collapses into "whose default model is better," and model names change almost every month. The question that actually lasts is which harness wins for your workload. The real differences are harness engineering (context management, tool-output handling, delegation) and the default model each one runs. Most public tests grade harness and model as a single bundle, which makes a fair openai codex vs claude code comparison hard to pull off. This guide splits them apart with a one-screen verdict by workload and a benchmark you can rerun yourself.


The verdict in one screen (by workload)

The right pick in claude code vs codex comes down to your workload and plan tier. For a lot of teams, the answer is to keep both installed and route by task.

WorkloadRecommended harnessWhy
Quick edits / everyday codingEither defaultFast, cheap defaults; pick by preference
Long autonomous tasks & large refactorsClaude CodeSaves large tool outputs to a file
Debugging & hard multi-app tasksCodexSame pass rate, lower cost per success
Plan-constrained heavy use ($20 tier)CodexCheaper per success; reserve Opus
Large tool-output / long sessionsClaude CodeKeeps full output; Codex drops the middle

*Defaults: Claude Code on Sonnet, Codex on gpt-5.6-sol; signals from Composio, August 2026. On the $20 tier, save Opus for when you need it, since it drains a Claude allowance roughly 5–10x faster than Sonnet. *


Harness vs model: what "codex vs claude" actually compares

Every codex vs claude comparison stacks two things: the harness (the CLI that plans, runs tools, compacts context, and enforces permissions) and the model it calls. Benchmarks that test "the package" blur the two together. That is why cost per successful task survives model churn while tokens per second misleads you: a faster-streaming model can still need more retries and tool calls, so it finishes later and costs more per success.

The fix is isolation: hold the model fixed across both harnesses, run the identical suite, and pin any leftover difference on harness engineering. Fast Inference makes this practical. fast claude on and fast codex on keep each native harness but route model traffic to one selected catalog model. That is Lane 2.

Rendering diagram…

Figure 1: Harness vs model isolation


How we tested it (methodology you can rerun)

You can rerun this codex vs claude code benchmark. The controlled setup:

  1. Fix the public repos and their starting commits.
  2. Pick five representative tasks with automated acceptance tests.
  3. Give both harnesses identical permissions and sandbox settings.
  4. Run each configuration at least three times.
  5. Report medians and failure counts, never a single run.

Cost per successful task is total spend divided by tasks that passed acceptance tests; also record wall-clock time, tool calls, retries, and interventions, since those explain cost gaps at equal pass rates. Every routing change is reversible with fast <agent> off. Lane 1 measures native defaults; Lane 2 isolates the harness by running the same model in both.


Dual benchmark: native defaults, then the same model in both

Lane 1 — native defaults (Sonnet vs gpt-5.6-sol)

Lane 1 compares what buyers receive: Claude Code on Sonnet against Codex on gpt-5.6-sol. Record completion rate, time, tool calls, interventions, tokens, and spend. It mixes harness and default model on purpose, so it cannot isolate which side caused a difference.

Lane 2 — the same Fast model in both harnesses

Route both harnesses to one selected, separately billed catalog model, run the identical suite, and attribute any remaining difference to the harness. Set up the Codex and Claude Code adapters, pick a catalog model, then run:

bash
#!/usr/bin/env bash
set -euo pipefail

# 1. Install the Fast CLI and sign in.
npm install -g @inference/fast
fast login

# Confirm the account, project, machine key, and agent states.
fast status

# 2. Hold the model constant: route BOTH harnesses to one catalog model.
#    Pick any callable ID from https://fast.inference.net/models
#    (glm-5.2 is the adapter default).
MODEL="glm-5.2"

# Claude Code: points all six model slots at the selected model.
fast claude on --model "$MODEL"

# Codex: writes the inference-net Responses-API provider at the selected model.
fast codex on --model "$MODEL"

# 3. Run your identical task suite in each harness with the same repos,
#    starting commits, permissions, and sandbox settings. Record pass rate,
#    wall-clock time, tool calls, interventions, tokens, and spend.
#    ... run the Claude Code session ...
#    ... run the Codex session ...

# 4. Verify both harnesses actually hit the selected model before trusting
#    numbers: https://fast.inference.net/dashboard/usage
fast claude status
fast codex status

# 5. Restore each native config when done. `off` reverts the saved snapshot
#    and does not change any native subscription quota.
fast claude off
fast codex off

Fast keeps each native harness intact and swaps only the model route; it does not raise any native subscription quota, and fast <agent> off restores the original config. Before trusting numbers, verify in your usage dashboard that both harnesses hit the selected model.


Results: speed and quality normalized to cost per task

Running one model through both harnesses on 30 hard multi-app tasks, both hit the same pass rate, 16 of 30, yet Claude Code finished about 2x faster while Codex cost roughly 58% less per successful task.

ConfigurationPass rateMedian timeTool callsCost / success
Claude Code · V4 Flash16/30122.7s358$0.195
Codex · V4 Flash16/30245.0s448$0.081
Claude Code · Golden Eval47/4784.4s
Codex · Golden Eval45/4779.6s
Claude Code · DeepSwe69%$9.18
Codex · DeepSwe69%$3.47

Source: Composio, August 2026. Isolation lane: DeepSeek V4 Flash through both harnesses (30 hard tasks). Golden Eval: Fable 5 vs GPT-5.6 Sol High, 47 workflows. DeepSwe: cost per task (Fable High vs Sol High).

Cost per successful task (same model, both harnesses)
Cost per successful task (same model, both harnesses) — DeepSeek V4 Flash, both 16/30
Median completion time (same model, both harnesses)
Median completion time (same model, both harnesses) — DeepSeek V4 Flash

Two other Composio runs back this up. On the 47-workflow Golden Eval, Claude Code edged Codex on pass rate while using about 19% fewer tokens; on DeepSwe the two tied, yet Codex cost far less per task. Every figure here is Composio's, so rerun your own.


Feature and instruction-file comparison

DimensionClaude CodeCodex
Instruction fileCLAUDE.md, walked up treeAGENTS.md, layered from root
Large tool outputSaved to fileHead/tail, drops middle
DelegationHeadless/background, opusplancodex cloud --attempts, @codex PR
In-loop reviewRead-only /review
SkillsAgent Skills (authored)Agent Skills (adopted)
MCP
Default modelSonnetgpt-5.6-sol

CLAUDE.md reloads after compaction; deeper AGENTS.md files override shallower ones.

The two differences that matter most, large tool-output handling and delegation, are in the table above. For the Claude-side choice, pick the best Claude model for coding.

Does Claude Code read AGENTS.md? No. It reads CLAUDE.md (reloaded after compaction), while Codex reads AGENTS.md from the repo root down. Both speak MCP and Agent Skills.


Decision matrix and downloadable benchmark

Turn the verdict into a decision: pick your dominant workload, read its verdict row, then run Lane 2 on your own repo. The "downloadable benchmark" is this rerunnable method itself, meaning the task spec, acceptance-test structure, and command block above, not a fabricated results file.

Where Cursor fits

The codex vs claude code vs cursor question fits the same test: route Cursor through Fast with the same model and compare on your repo. Treat it as a variant to fold in, not a co-equal subject.


Last verified: models, plans, and limits (dated)

Last verified: 2026-08-23. These facts turn over roughly monthly; treat Claude's /model command and OpenAI's Codex models page as the sources of truth, not this table.

HarnessDefault modelNotable current modelsDeprecations / dates
Codexgpt-5.6-solgpt-5.6-terra, gpt-5.6-luna, gpt-5.3-codex-sparkgpt-5.2 & gpt-5.3-codex deprecated; gpt-5.4/gpt-5.4-mini retire Aug 31 2026
Claude CodeSonnetOpus, HaikuVersion-agnostic; /model is source of truth

On the Codex side, gpt-5.2 and gpt-5.3-codex are already deprecated with ChatGPT sign-in, and gpt-5.4/gpt-5.4-mini retire on August 31, 2026, so pinned model IDs will break. Sign-in also decides metering: a subscription seat draws from a pooled, rolling-window allowance while an API key is pay-as-you-go, and a stray ANTHROPIC_API_KEY silently bills Claude Code at API rates. Exact tiers, limits, and prices belong to their owners: check Codex usage and limits, break down Codex pricing, and understand Claude usage limits.


Conclusion

Codex vs claude code is a harness question, not a model question. The differences that survive next month's release are all engineering: tool-output handling, delegation, context management. The metric that survives is cost per successful task. Name your workload, then run the same model through both harnesses on your own repo and let cost per successful task decide. If they land close, keep both and route by task.


References

  1. OpenAI — Codex models. https://developers.openai.com/codex/models — verified 2026-08-23. [C-010][C-011][C-012]
  2. Anthropic — Models, usage, and limits in Claude Code. https://support.claude.com/en/articles/14552983-models-usage-and-limits-in-claude-code — verified 2026-08-23. [C-013][C-014]
  3. Composio — Claude Code vs OpenAI Codex. https://composio.dev/content/claude-code-vs-openai-codex — verified 2026-08-23. [C-015][C-016][C-017][C-018][C-019]
  4. Fast Inference docs — Codex, Claude Code, and CLI adapters. inference/apps/fast-web/src/content/docs/ — verified 2026-08-23. [C-001][C-002][C-003][C-004][C-006][C-009]
npm install openaibaseURL: "https://api.inference.net/v1"ship it