Claude Code vs. Codex

Comparison between Claude Code and Codex across the Artificial Analysis Coding Agent Index, including benchmark scores, cost, execution time, and token usage.

For details relating to our methodology, see our methodology page.

Explore other comparisons
vs
Artificial Analysis Coding Agent Index v1.5 · Higher is better
Average agent wall time per task · Lower is better
Average API cost per task (USD) · Lower is better

Comparison

Side-by-side comparison of Claude Code and Codex.

Coding Agent Comparison

Metric
Claude Code
Sonnet 5.5 (max)
Codex
GPT-6.1 Sol (xhigh)
Analysis
Agent Harness
Claude Code
Codex
Representative Model
Sonnet 5.5 (max)
GPT-6.1 Sol (xhigh)
Coding Agent Index
68
63
Claude Code has a higher Coding Agent Index than Codex
DeepSWE v1.1
72%
73%
Codex has a higher DeepSWE v1.1 score than Claude Code
Terminal-Bench 4.0
66%
55%
Claude Code has a higher Terminal-Bench 4.0 score than Codex
SWE-Atlas-QnA
67%
61%
Claude Code has a higher SWE-Atlas-QnA score than Codex
Cost per Task
$14.19
$1.04
Codex has a lower cost per task than Claude Code
Time per Task
1.5h
15.5m
Codex has a lower time per task than Claude Code
Turns per Task
265.9
40.1
Codex has a lower turns per task than Claude Code
Token Usage per Task
27.7M
3.2M
Codex has a lower token usage per task than Claude Code
Cache Hit Rate
95%
93%
Claude Code has a higher cache hit rate than Codex

Model Variants

Evaluated model variants for Claude Code and Codex.

Model Variants

Claude Code
Sonnet 5.5 (max)
68
72%
66%
67%
$14.19
1.5h
27.7M
Claude Code
Opus 5.5 (max)
66
68%
63%
66%
$13.04
1.1h
15.6M
Claude Code
Sonnet 5.5 (xhigh)
63
68%
58%
62%
$3.33
27.0m
7.1M
Claude Code
Fable 5.1 (max) (with fallback)
62
64%
58%
65%
$12.39
34.8m
5.7M
Claude Code
Opus 5 (max)
60
63%
55%
62%
$10.79
41.9m
11.4M
Claude Code
Sonnet 5.5 (high)
55
67%
42%
56%
$1.24
12.3m
2.7M
Claude Code
Step 5 Preview
51
62%
33%
58%
$1.66
56.4m
21.7M
Claude Code
Sonnet 5.5 (medium)
46
65%
27%
45%
$0.62
8.5m
1.3M
Claude Code
Qwen3.8 Max
43
51%
17%
62%
$3.48
1.1h
8.7M
Claude Code
Sonnet 5.5 (low)
42
62%
25%
39%
$0.48
6.3m
977.3K
Claude Code
Haiku 5.5 (xhigh)
41
49%
24%
52%
$0.61
25.9m
7.1M
Claude Code
Haiku 5.5 (max)
36
46%
30%
34%
$2.58
1.5h
13.8M
Claude Code
Haiku 5.5 (high)
35
46%
13%
46%
$0.36
18.4m
5.1M
Claude Code
Haiku 5.5 (medium)
34
47%
12%
42%
$0.23
14.0m
3.5M
Claude Code
Haiku 5.5 (low)
28
45%
6%
33%
$0.14
11.6m
2.4M
Codex
GPT-6.1 Sol (xhigh)
63
73%
55%
61%
$1.04
15.5m
3.2M
Codex
GPT-6 Astra (max)
62
68%
56%
62%
$7.47
29.4m
3.3M
Codex
GPT-6.1 Sol (medium)
61
72%
52%
61%
$0.70
10.9m
2.3M
Codex
GPT-6.1 Sol (high)
60
71%
50%
60%
$0.89
13.3m
2.8M
Codex
GPT-6.1 Sol (max)
60
70%
53%
58%
$1.55
24.4m
4M
Codex
GPT-6.1 Sol (low)
57
68%
49%
55%
$0.50
8.6m
1.7M
Codex
GPT-6 Sol (max)
57
69%
43%
58%
$2.99
22.3m
9.8M
Codex
GPT-5.6 Sol (max)
55
72%
37%
54%
$6.35
20.6m
10.2M
Codex
GPT-5.6 Luna (max)
43
66%
15%
49%
$0.44
23.5m
14.9M
Codex
DeepSeek V4 Pro 0813 (max)
43
57%
10%
62%
$0.24
40.3m
24.2M
Codex
GPT-6 Luna (max)
41
64%
15%
44%
$0.18
21.4m
10.2M
Codex
DeepSeek V4 Flash 0731 (max)
39
54%
11%
51%
$0.09
18.3m
15.4M

Performance

Performance across the Artificial Analysis Coding Agent Index.

Artificial Analysis Coding Agent Index

Artificial Analysis Coding Agent Index v1.5 incorporates 3 benchmarks: DeepSWE v1.1, Terminal-Bench 4.0, and SWE-Atlas-QnA · Higher is better

Artificial Analysis Coding Agent Index vs. Cost per Task

Artificial Analysis Coding Agent Index vs. average pay-per-token API cost per task (USD)
Most attractive quadrant
Pareto line

Token Usage

Token consumption across the Artificial Analysis Coding Agent Index.

Token Usage per Task

Average input, cache, and output tokens per task
Prompt cache hit rates can vary significantly by provider routing, which can materially change effective cost.

Artificial Analysis Coding Agent Index vs. Total Tokens

Artificial Analysis Coding Agent Index vs. average total tokens per task
Most attractive quadrant

Cost

Pay-per-token API cost across the Artificial Analysis Coding Agent Index, based on current per-token pricing.

Cost per Task

Average pay-per-token API cost per task (USD) · Lower is better

Execution Time

Active agent runtime across the Artificial Analysis Coding Agent Index.

Time per Task

Average agent wall time per task · Lower is better

Artificial Analysis Coding Agent Index vs. Execution Time

Artificial Analysis Coding Agent Index vs. average agent wall time per task
Most attractive quadrant