TokenSave Data · Dataset
Claude Code vs Codex: how many tokens they use before and during work
Before doing anything, Claude Code sends 35,771 input tokens and Codex 14,678. On the same browser-game task Codex used 52% fewer input tokens and 59% fewer output tokens than Claude Code. Adding 30 MCP tools barely changed either.
Measured 2026-10-18 · Claude Code 2.1 and Codex CLI 0.162 · 2 runs each · License CC BY 4.0 · Related: Claude effort levels
DOI 10.5281/zenodo.23448342 · Also on Hugging Face · Kaggle · GitHub
Key findings
- Claude Code starts 144% heavier. A one-word reply costs 35,771 input tokens in Claude Code and 14,678 in Codex. That fixed amount is sent again with every request, so it adds up over a session even though most of it is cached.
- Adding MCP tools barely changed startup tokens. The full definitions of our 30 test tools are 4,541 tokens, but adding them raised Claude Code by only 394 tokens (about 13 per tool) and Codex by 0. Both now load a tool’s details only when it is needed.
- Using the tools is what costs. Asked to list the 10 tracker tools and call one, Codex used 47,876 input tokens, 226% more than its plain startup.
- Same task, about half the tokens on Codex. The browser game took Claude Code 101,440 input and 8,204 output tokens on average (68 s, $0.41 at API prices) and Codex 48,384 input and 3,338 output tokens (37 s). All four games worked.
- Claude Code wrote more code. Its games averaged 507 lines against 83 for Codex, which wrote denser code with fewer line breaks; both had every requested feature.
Startup tokens and MCP tools
Input tokens for the prompt “Reply with the single word OK.”, average of two runs; in brackets, the increase over no MCP server.
| Setup | Claude Code (Opus 5.5) | Codex (gpt-6-luna) |
|---|---|---|
| 0 MCP tools | 35,771 | 14,678 |
| 1 MCP tool | 35,790 (+19) | 14,678 (+0) |
| 10 MCP tools | 35,913 (+142) | 14,678 (+0) |
| 30 MCP tools | 36,165 (+394) | 14,678 (+0) |
The same coding task
Prompt, word for word: “Make a brick-breaker game that runs in the browser as a single file named index.html in the current folder. It needs 2 levels, a score display and 3 lives, and it must be playable with the keyboard and the mouse. Write the file and finish.”
| Run | Input tokens | Output tokens | Time | Lines in index.html | API cost |
|---|---|---|---|---|---|
| Claude Code (Opus 5.5) · run 1 | 123,666 | 8,537 | 73 s | 487 | $0.42 |
| Claude Code (Opus 5.5) · run 2 | 79,213 | 7,870 | 63 s | 527 | $0.39 |
| Codex (gpt-6-luna) · run 1 | 47,954 | 2,872 | 33 s | 49 | – |
| Codex (gpt-6-luna) · run 2 | 48,815 | 3,803 | 41 s | 117 | – |
Method
- Both tools on the same Windows laptop, each run in its own empty folder.
- Claude Code 2.1.295 with its default model (Opus 5.5) on a Max plan:
claude -p --output-format json, MCP servers only from--mcp-configwith--strict-mcp-config; the task at--effort mediumwith--permission-mode acceptEdits. Input tokens are input + cache creation + cache read; the cost is Claude Code’s own API-price figure. - Codex CLI 0.162 with its default model (gpt-6-luna) on a ChatGPT plan:
codex exec --json, reasoning effort low for the startup test and medium for the task; the MCP server added with-c mcp_servers.…. Input tokens include cached tokens. No price is shown because Codex reports none on a ChatGPT plan. - MCP test server: a small stdio server we wrote that exposes 1, 10 or 30 tracker tools (create, update, list issue and so on), each with a one-sentence description and a five-field input schema.
- Each finished game was opened in a headless browser: no errors, and two levels, a score and three lives on screen.
Limitations
- Two runs per setting and one task. Claude Code’s two task runs differed by 56% in input tokens.
- Default models differ (Opus 5.5 vs gpt-6-luna), and the price per token differs too, so fewer tokens does not automatically mean cheaper.
- Startup tokens include each tool’s installed skills and plugins on this machine; a fresh install may start lower.
- Cursor will be added when its free-plan limit resets.
How to cite
Free to use, quote and republish with attribution under CC BY 4.0. Please link to this page.
TokenSave (2026). Claude Code vs Codex: startup tokens, MCP tools and the same coding task [Data set]. Zenodo. https://doi.org/10.5281/zenodo.23448342
Embed the chart
Related
- Claude effort levels: tokens, time and cost
- PDF token cost, including Codex and Cursor
- Check your own Claude Code and Codex usage
Questions or corrections: contact@jonhisking.com