Claude Code Token Usage: Real Data From 100M Tokens Tracked
How many tokens does Claude Code use per request?
I tracked 1,289 requests over multiple coding sessions to find out. The total came to 100.9M tokens.
The answer: ~78,000 tokens per request on average.
But the more interesting finding wasn’t the total. It was the distribution.
The Numbers
+------------------+----------+------------+| Metric | Value | Percentage |+------------------+----------+------------+| Total Requests | 1,289 | - || Total Tokens | 100.9M | 100% || Input Tokens | 100.3M | 99.4% || Cached Tokens | 84.2M | 84%* || Output Tokens | 616K | 0.6% || Avg Per Request | ~78,277 | - |+------------------+----------+------------+
* Percentage of input tokens that were cached99.4% of all tokens were input. Only 0.6% were output.
For every 1 token of code generated, approximately 166 tokens of context were read.
Why Input Dominates
Claude Code works by re-reading context on every request. Each request includes:
- Conversation history - The full back-and-forth of your session
- File contents - Any files being analyzed or edited
- System instructions - Claude’s operating parameters
- Tool definitions - Available capabilities and their schemas
+-------------------+| Your Request |+-------------------+ | v+-------------------+ +-------------------+| System Prompt | --> | Context Window |+-------------------+ | (200K tokens) | | |+-------------------+ | - Conversation || File Contents | --> | - Files |+-------------------+ | - Instructions | | - Tools |+-------------------+ | || History | --> | |+-------------------+ +-------------------+ | v +-------------------+ | Response | | (~500 tokens avg) | +-------------------+This “re-reading loop” is the bottleneck. Not inference speed. Not output generation. The cost comes from repeatedly loading context.
The 166:1 Ratio
The input-to-output ratio of 166:1 has practical implications:
| If You Focus On… | Impact |
|---|---|
| Output efficiency | Marginal gains (0.6% of tokens) |
| Context selection | Major gains (99.4% of tokens) |
A 10% reduction in context per request saves more tokens than completely eliminating all output.
Prompt Caching: The 74% Savings
Here’s where it gets interesting. Of the 100.3M input tokens, 84.2M (84%) were served from Anthropic’s prompt cache.
WITHOUT PROMPT CACHING:+-------------------+------------+----------+--------+| Type | Tokens | Rate | Cost |+-------------------+------------+----------+--------+| Input | 100.3M | $3/M | $301 || Output | 616K | $15/M | $9 |+-------------------+------------+----------+--------+| TOTAL | ~$310 |+-------------------+------------+----------+--------+
WITH PROMPT CACHING (84% hit rate):+-------------------+------------+----------+--------+| Type | Tokens | Rate | Cost |+-------------------+------------+----------+--------+| Cached Input | 84.2M | $0.30/M | $25 || Uncached Input | 16.1M | $3/M | $48 || Output | 616K | $15/M | $9 |+-------------------+------------+----------+--------+| TOTAL | ~$82 |+-------------------+------------+----------+--------+
SAVINGS: $310 - $82 = $228 (74% reduction)Prompt caching works because Claude Code frequently re-reads the same context. Files don’t change between requests. System prompts are static. Conversation history grows incrementally.
The cache captures all of this.
What This Means For Your Workflow
1. Context Selection Matters More Than Output
When Claude Code reads 100K tokens of your codebase to make a small fix, that’s not wasteful. That’s the nature of the system.
But if it’s reading irrelevant files, that’s where you lose.
2. Sessions Have Fixed Overhead
Each new session loads:
- System instructions (~10K tokens)
- Tool definitions (~5K tokens)
- Initial context
This overhead is amortized over the session’s requests. Longer sessions = better token efficiency per request.
3. Caching Is Automatic
You don’t need to configure anything. Anthropic’s prompt caching activates automatically for repeated context.
The 84% cache hit rate in my data suggests most context is reused across requests.
Summary
Based on tracking 100M tokens across 1,289 requests:
| Finding | Implication |
|---|---|
| ~78K tokens/request | Plan for large context windows |
| 99.4% input tokens | Focus optimization on context, not output |
| 84% cache hit rate | Prompt caching saves ~74% on costs |
| 166:1 input-to-output ratio | The bottleneck is re-reading, not generating |
Claude Code is a read-heavy system. Understanding this pattern helps you make better decisions about session length, context management, and cost expectations.
The data is clear: if you want to reduce token usage, start with what Claude reads, not what it writes.
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