- Published on
Why Claude Code can seem to use more tokens than Codex
- Authors
- Name
- Cristian Pique
Introduction
When people compare coding agents, they often say something like:
Claude Code feels great, but it burns tokens faster.
That can be true in practice, but it is worth being precise. Most of the time this is not because one tool is "wasting" tokens in a simple way. It is because coding agents spend tokens on different things: context, tool results, summaries, instructions, and the actual answer.
Claude Code, Codex, Cursor, and similar tools are not just chat boxes. They are agents operating over a codebase. That changes the token profile completely.
What usually consumes the tokens
A normal chat message is mostly your prompt and the model response. A coding agent has more moving parts:
- System and developer instructions
- Project memory files
- File contents
- Search results
- Terminal output
- Tool schemas
- Intermediate reasoning and planning
- Conversation history
- Context summaries
Even if your prompt is small, the model may need a lot of surrounding context to make a safe edit.
For example, "fix the tests" might require reading the test file, the production code, package scripts, recent errors, and maybe configuration. The actual user request is tiny. The working context is not.
Why Claude Code can feel heavier
Claude Code is very context-oriented. It tends to keep a rich picture of the current session and the project. That is part of why it can feel good at long, messy coding work.
The tradeoff is that context has a cost. If the conversation gets long, if several files are read, or if terminal output is large, the input side grows quickly.
Anthropic's own Claude Code docs mention several token drivers: codebase size, query complexity, number of files searched or modified, conversation history, compaction frequency, and background processes such as summarization. That matches what many developers observe day to day.
A simple example
Imagine this task:
Add validation to the signup form and update the tests.
A lightweight assistant might ask for the relevant files or edit only the obvious component.
An agentic tool might:
- Search for the signup form.
- Read the form component.
- Read validation helpers.
- Read test setup.
- Run tests.
- Read failing output.
- Patch code.
- Run tests again.
- Summarize what changed.
That workflow is often better engineering, but every search result, file, command output, and follow-up step can become tokens.
Why Codex may look cheaper
Depending on configuration, Codex-style workflows can feel more scoped. If the agent reads fewer files, keeps a shorter active context, or relies on a different compaction strategy, token usage may look lower.
That does not automatically mean it is better or worse. Sometimes lower token usage means the tool was more focused. Sometimes it means it did not inspect enough context.
The question I care about is not "which tool used fewer tokens?" It is:
- Did it understand the code?
- Did it avoid breaking unrelated behavior?
- Did it run the right checks?
- Did it explain the result clearly?
Tokens are part of the cost, but they are not the whole value.
How to reduce token burn
The best way to reduce token usage is to reduce ambiguity.
Instead of:
Can you improve this area?
Try:
In the signup form, add required validation for email and password.
Keep the existing UI. Run the existing form tests only.
Other useful habits:
- Start new sessions for unrelated work.
- Avoid dumping huge logs unless they are needed.
- Point the agent to likely files.
- Ask for a plan before broad refactors.
- Use compaction when the session becomes large.
- Clear context when switching tasks.
Final thought
Claude Code may use more tokens because it is doing more context management and tool-driven work. Sometimes that is exactly what you want. Sometimes it is overkill.
For small, well-scoped edits, a leaner workflow is often enough. For larger work where missing context is expensive, spending more tokens can be a reasonable trade.