Skip to content

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

Token Distribution Across 1,289 Requests
+------------------+----------+------------+
| 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 cached

99.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:

  1. Conversation history - The full back-and-forth of your session
  2. File contents - Any files being analyzed or edited
  3. System instructions - Claude’s operating parameters
  4. Tool definitions - Available capabilities and their schemas
How Claude Code Processes Each Request
+-------------------+
| 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 efficiencyMarginal gains (0.6% of tokens)
Context selectionMajor 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.

Cost Comparison: With vs Without Caching
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:

FindingImplication
~78K tokens/requestPlan for large context windows
99.4% input tokensFocus optimization on context, not output
84% cache hit ratePrompt caching saves ~74% on costs
166:1 input-to-output ratioThe 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