Codex vs Claude Code: we gave both the same three coding tasks
We gave Codex and Claude Code the same three programming jobs. Both did equally well. Claude Code was three times faster; Codex cost less than half as much for developers.
Many people ask which AI coding helper is better: OpenAI's Codex or Anthropic's Claude Code. So we gave both the same three programming jobs. Both did the work equally well. Claude Code was about three times faster. But for developers who pay per use, it would have cost a little more than twice as much.
Correction, 11 October 2026: our first runs also loaded the site owner's own settings for both tools: personal instructions, add-ons and extra tools. That added text to every step. We ran all twelve jobs again with a clean setup. The secret test scores stayed exactly the same, and Claude Code was still much faster. But both tools used fewer tokens, and both got faster: six Codex jobs took 10 minutes instead of 16, and cost $0.37 instead of $0.76. Claude Code took 3 minutes instead of 4, and cost $0.84 instead of $1.67, partly because Anthropic also cut its cache price on 7 October. The numbers in this article are the new ones.
What we compared
Codex and Claude Code are AI helpers for programmers. You give them a job. They read the code, try things out and change files until the job is done.
Each tool can use different AI models. We picked two models that cost exactly the same: GPT-6.1 Sol in Codex and Claude Sonnet 5.5 in Claude Code. For developers, both cost $2 per million tokens of text in and $10 per million tokens out. Tokens are the small pieces of text an AI reads and writes. You can check the prices on OpenAI's page and Anthropic's page.
Because the price per token is the same, any difference comes from the tools themselves. The Codex results are the same ones we used in our test of GPT-6.1 Sol against GPT-6 Astra.
How we tested
We made three small programming projects. Each came with a short note saying what to do:
- A. Fix a bug. A piece of code that turns "1h30m" into seconds gave wrong answers.
- B. Build something from a description. A one-page description of a Dutch invoice, with tax, discounts and rounding.
- C. Add a new feature. Due dates for a small to-do list program.
Each tool did each job twice, starting from a clean copy each time. Both used the same middle setting for how hard the AI thinks.
Then came our secret tests. These are small checks we wrote ourselves, such as "does 1h30m give 5,400 seconds?". The AI never saw them. We only ran them after it had finished. That way the AI could not aim for our checks. We also tried every secret test on our own answers first, to make sure the tests were right.
Want to see the test? One secret test checks that "1h banana" is refused, because there is junk after the time. Another checks that an invoice line of 1.005 kilos is allowed. Our test page shows all three jobs, the secret tests and the exact words we sent. You can also download them and run them on any AI yourself.
Who did the better job? Neither
Both tools passed exactly the same secret tests, in every try:
| Job | Codex | Claude Code |
|---|---|---|
| A. Fix a bug | 23 of 24, twice | 23 of 24, twice |
| B. Build from a description | 15 of 15, twice | 15 of 15, twice |
| C. Add a feature | 5 of 5, twice | 5 of 5, twice |
One test in job A failed for both tools every time. That was our mistake. It checked a rule we never wrote in the job note. So we do not count it against either tool.
Both tools also wrote their own tests, as the job notes asked. In three tries, Claude Code wanted to use a program we had not allowed. It was stopped, and it finished the job another way. That did not cost it any points.
Which one was faster? Claude Code, by a lot
Speed was the big difference:
| Job | Codex, average | Claude Code, average |
|---|---|---|
| A. Fix a bug | 82 seconds | 21 seconds |
| B. Build from a description | 99 seconds | 34 seconds |
| C. Add a feature | 124 seconds | 42 seconds |
| All six tries | about 10 minutes | about 3 minutes |
Claude Code was faster on every job, every time. The gap was biggest on job C: about 124 seconds for Codex against 42 for Claude Code.
For one small job, that hardly matters. If you do dozens of jobs a day, it adds up.
Which one costs less? Codex, for developers
Most people use these tools with a monthly subscription. Then you do not pay per job. But developers can also pay per use, through the API, the paid connection for programmers. So we worked out what our jobs would cost that way:
| Job | Codex, per try | Claude Code, per try |
|---|---|---|
| A. Fix a bug | $0.05 | $0.11 |
| B. Build from a description | $0.06 | $0.14 |
| C. Add a feature | $0.07 | $0.17 |
| All six tries | $0.37 | $0.84 |
How can that be, if the price per token is the same? It is about how the tools work. Claude Code starts every job by saving a long set of instructions, so it does not have to send them again and again. Saving costs extra: twice the normal price. Codex also reuses a lot of text, but more cheaply.
We did this sum ourselves, from the token counts each tool reported and the list prices.
What if you use a subscription?
With a ChatGPT or Claude subscription you pay a fixed amount each month. What matters then is how fast you use up your allowance.
For Codex, OpenAI publishes how much each model uses. By that measure, our six Codex tries used about 9 of the "credits" that make up a plan's allowance. We did not find a similar list for Claude Code, so we cannot compare this part.
Our advice: for clear, everyday programming jobs, both tools did the same work. If you are short on time, Claude Code was faster. If you pay per use, Codex was cheaper.
Questions people ask
How is Claude Code better than Codex?
In our test, it was faster. Claude Code needed about 3 minutes for six tries, and Codex needed about 10. The quality was the same. Both passed exactly the same secret tests: checks we wrote ourselves and only ran after the AI had finished.
What is Codex?
Codex is OpenAI's AI helper for programmers. You give it a job. It reads the code, tries things out and changes files until the job is done. Claude Code, from Anthropic, works the same way.
What are the benchmarks for Claude Code?
We did not look at official test scores. In our own clean test on 11 October 2026, Claude Code passed 23 of 24 secret tests, checks we wrote ourselves, on a bug fix. It passed 15 of 15 on an invoice job and 5 of 5 on a new feature, and the one miss was our own mistake. Codex got exactly the same scores, as our test page explains.
Is Claude Code still the best for coding?
Not on quality, in our test. Claude Code and Codex passed exactly the same secret tests, checks we wrote ourselves, in every try. Claude Code was about three times faster, but for developers who pay per use it cost a little more than twice as much. This was a small test with three jobs, so bigger projects may give other results.
Which is better for developers in 2026, Codex or Claude Code?
It depends on what you need most. In our test in October 2026, both did the work equally well. Claude Code was faster. Codex was cheaper if you pay per use: about $0.37 against $0.84 for six tries, by our estimate.
How we checked
We first ran the Codex tries on 4 October 2026 and the Claude Code tries on 5 October 2026. Those runs also loaded the site owner's own settings for both tools. On 11 October 2026 we ran all twelve jobs again on the same Windows laptop, with the owner's own subscriptions, but with a clean setup: Codex version 0.162.0 with only a ChatGPT login in an empty settings folder, and Claude Code version 2.1.280 with an empty settings folder and a login token. The Codex add-ons that come with the account were switched off. The numbers in this article come from that clean run. We used GPT-6.1 Sol in Codex and Claude Sonnet 5.5 in Claude Code. We chose Sonnet 5.5 by name, because this version of Claude Code still picked the older Sonnet 5 by default. We timed every try, wrote down how much text each tool used, and ran the same secret tests afterwards.
The costs are our own estimates. We used the token counts each tool reported and the prices on Anthropic's page from 8 October 2026 and OpenAI's page from 5 October 2026. Codex did not report one small extra charge, so its cost may be a little higher. The screenshots are our own. The charts and the record of every job were made by us from our results. None of the images was made by AI.
This was a small test: three jobs, two tries per tool. Bigger projects may give different results. Want to know more about Claude Code? Read our test of Claude Code mods.