Skip to content

Why Does Claude Code Use More Tokens Than Codex?

Problem

When I switched from Codex to Claude Code, I noticed something odd: my token usage skyrocketed. Tasks that cost me a few thousand tokens in Codex were consuming tens of thousands in Claude Code.

I wasn’t alone. On Reddit, developers report that Claude “burns tokens like crazy” while Codex remains context-efficient. One user said they’re considering a $100/month plan for Claude when Codex Plus users rarely hit weekly limits.

I wanted to understand why this happens and whether I could do anything about it.

What I Found

The token usage gap between Claude Code and Codex comes down to fundamental architectural differences:

Claude Code’s approach:

  • Retains entire conversation history
  • No automatic context compacting
  • Tends to over-engineer solutions
  • Verbose explanations in responses

Codex’s approach:

  • Intelligently compacts older context
  • Makes minimal, targeted changes
  • Internal reasoning doesn’t always surface as output tokens
  • Better understanding of task boundaries

The key insight: Codex makes “minimal changes” after deep reasoning, while Claude tends to rewrite more than necessary.

The Token Cost Breakdown

When I compared similar tasks, here’s what I observed:

Task: Fix a bug on line 15 of a 200-line file
Codex response:
- Analyzes the file internally
- Returns only the changed line
- Total tokens: ~500-1,000
Claude Code response:
- Analyzes entire file
- Explains the bug in detail
- Refactors three related functions
- Adds comments throughout
- Provides full file rewrite
- Total tokens: ~8,000-15,000

The difference isn’t just in the code changes. Claude Code includes:

  • Detailed reasoning before the fix
  • Explanations of what went wrong
  • Preventive refactoring I didn’t ask for
  • Commentary on the codebase

Why Claude Code Works This Way

I think this behavior comes from Claude Code’s design philosophy:

1. Full context retention

Every message, code block, and decision stays in the active context window. This ensures continuity but creates exponential token growth:

Message 1: ~2,000 tokens (system prompt + response)
Message 2: ~4,000 tokens (previous + new response)
Message 3: ~6,000 tokens (all previous + new response)
Message 4: ~8,000 tokens (accumulating...)

2. Over-engineering tendency

Claude Code often refactors code I didn’t touch. When I asked to “fix the bug,” it sometimes:

  • Refactored related functions
  • Added comments to unrelated sections
  • Suggested improvements to adjacent code
  • Restructured the file organization

This thoroughness has value, but it costs tokens.

3. Verbose explanations

Claude Code defaults to explaining its reasoning. While helpful for learning, this adds tokens:

Inefficient pattern (high tokens):
User: Fix line 15
Claude: I'll analyze the entire file. First, let me explain
the architecture. The bug is caused by... [500 words of
explanation]. Here's the fix along with refactored functions
and comprehensive comments...
Efficient pattern (low tokens):
User: Fix line 15
Claude: Fixed. Changed == to === on line 15.

The Cost Impact

This token difference translates directly to money:

Usage PatternClaude CodeCodex
Daily coding (4 hours)$50-100/month$20/month
Heavy debugging session20-30% of budget5-10% of budget
Large refactoring project$100+/month possibleUsually within limits

The developers I talked to who switched from Claude Code to Codex cited cost as the primary reason. One mentioned: “I was burning through my budget in 2 weeks with Claude Code. Codex lasts me the whole month.”

Common Mistakes I Made

Mistake 1: Letting conversations grow too long

I kept using the same Claude Code session for days. Each message accumulated context, making every new request expensive.

Fix: Start fresh sessions for unrelated tasks.

Mistake 2: Not specifying minimal changes

When I said “fix the bug,” Claude Code assumed I wanted comprehensive improvements.

Fix: I now say “Only fix the bug on line 15, no refactoring.”

Mistake 3: Ignoring context buildup

I didn’t realize how quickly context accumulated until I hit token limits mid-session.

Fix: Periodically summarize and start new conversations.

How to Reduce Token Usage in Claude Code

After experimenting, I found these strategies help:

Token Optimization Strategies:
1. Start fresh conversations for unrelated tasks
- Prevents context accumulation
- Each new chat has minimal baseline tokens
2. Summarize context before continuing
- "Let me summarize our progress: [brief summary]"
- Claude can reference the summary instead of full history
3. Request minimal changes explicitly
- "Only fix the bug, no refactoring"
- "Don't explain, just show the diff"
- "Make minimal changes"
4. Use shorter prompts when context is established
- First message: "Here's my problem... [full context]"
- Follow-ups: "Fix the next error" (no need to re-explain)
5. Clear conversation history periodically
- After major milestones, start fresh
- Paste the current state as a summary

When Claude Code’s Approach Helps

Despite the token cost, Claude Code’s thoroughness isn’t always bad:

Good for:

  • Complex refactoring where you want comprehensive changes
  • Learning a new codebase with detailed explanations
  • Projects where catching related issues matters
  • Situations where over-engineering prevents future bugs

Not good for:

  • Quick bug fixes
  • Small incremental changes
  • Budget-constrained projects
  • Tasks where minimal changes are preferred

Comparison Summary

AspectClaude CodeCodex
Token usageHigherLower
Context handlingFull retentionSmart compacting
Change precisionTends to over-engineerSurgical changes
ExplanationsVerbose by defaultConcise
Best forComplex projectsDaily coding
Cost predictabilityVariableMore consistent

Summary

In this post, I explained why Claude Code uses more tokens than Codex. The main reasons are:

  • Full context retention without automatic compacting
  • Tendency to over-engineer and refactor beyond what was asked
  • Verbose explanations that add tokens
  • Architectural philosophy prioritizing thoroughness over efficiency

You can reduce token usage by starting fresh conversations, explicitly requesting minimal changes, and summarizing context periodically.

The choice between Claude Code and Codex depends on your needs. If you want comprehensive, explained changes and don’t mind the cost, Claude Code works well. If you prefer surgical precision and lower token costs, Codex may be better.

Token usage isn’t just about price—it’s about how efficiently the tool translates your intent into code changes.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments