How Many Tokens Does Claude Code Use Per Session? (2026)
Claude Code token consumption varies dramatically based on what you ask it to do. A quick bug fix might burn 5,000 tokens. A full-feature implementation can consume 200,000. Without knowing your baseline, you cannot budget effectively. Use the Token Estimator to predict costs before starting a session, and avoid surprises on your monthly bill.
Understanding where tokens go – input context, output generation, and tool calls – is the first step toward controlling spend. The benchmarks below come from real-world Claude Code sessions across projects ranging from 500-line scripts to 150,000-line monorepos.
Token Usage by Session Size
Session complexity determines token consumption more than raw time spent. Here are measured ranges across 200+ real sessions:
| Session Type | Input Tokens | Output Tokens | Total Tokens | Typical Cost (Sonnet) |
|---|---|---|---|---|
| Quick fix (typo, one-liner) | 3,000 - 8,000 | 500 - 2,000 | 3,500 - 10,000 | $0.01 - $0.04 |
| Bug investigation | 10,000 - 25,000 | 3,000 - 8,000 | 13,000 - 33,000 | $0.05 - $0.13 |
| Single feature | 25,000 - 60,000 | 8,000 - 20,000 | 33,000 - 80,000 | $0.13 - $0.30 |
| Multi-file refactor | 60,000 - 150,000 | 15,000 - 40,000 | 75,000 - 190,000 | $0.30 - $0.75 |
| Architecture overhaul | 150,000 - 200,000 | 30,000 - 50,000 | 180,000 - 250,000 | $0.75 - $1.00 |
Input tokens dominate every category. They typically account for 70-80% of total consumption because Claude Code reads files, receives tool results, and accumulates conversation context.
What Drives Input Token Count
Three factors multiply your input tokens:
1. Codebase Size in Context
Every file Claude Code reads gets loaded into the context window. A 500-line Python file consumes roughly 2,000 tokens. When Claude reads 10 files to understand a feature, that is 20,000 tokens before it writes a single line.
# Check how many tokens your key files consume
# Average: 4 tokens per line of code
wc -l src/**/*.ts | tail -1
# 12,450 total lines = ~49,800 tokens if all loaded
2. Conversation Accumulation
Each message in a session includes the full conversation history. By message 10, you are resending messages 1-9 every time. A session with 15 back-and-forth exchanges can spend 60% of its tokens on repeated context.
# Use /compact to reset context mid-session
# Before: 45,000 accumulated context tokens
/compact
# After: ~8,000 tokens (summary only)
3. Tool Call Overhead
Each tool invocation (Read, Edit, Bash, Grep) adds structured tokens. A single file read adds the file content plus ~200 tokens of tool framing. Ten tool calls in a session can add 5,000-15,000 tokens of overhead alone.
Measuring Your Actual Usage
Claude Code displays token usage at the end of each session. You can also track it programmatically:
# Check your current session's token usage
# Look for the token count in the session summary
# For API-level tracking, export usage data
claude --output-format json 2>&1 | jq '.usage'
# Or check your Anthropic dashboard
# https://console.anthropic.com/settings/usage
To get precise per-task measurements, run the Token Estimator with your project details. It accounts for codebase size, task complexity, and model choice to give you a realistic range.
Reducing Tokens Without Reducing Quality
The biggest wins come from controlling what enters the context window:
# 1. Add a .claudeignore to exclude build artifacts
echo "node_modules/
dist/
.next/
coverage/
*.lock" > .claudeignore
# 2. Use focused prompts instead of open-ended ones
# Bad (loads everything): "fix the bugs in this project"
# Good (scoped): "fix the null check in src/auth/validate.ts line 42"
# 3. Start fresh sessions for unrelated tasks
# Each new session resets context to zero
A well-configured .claudeignore typically reduces input tokens by 30-40% by preventing Claude Code from reading irrelevant files. Combined with focused prompts, you can cut a medium session from 60,000 tokens down to 35,000.
Try It Yourself
Run the Token Estimator with your project parameters to get a personalized token budget. Enter your codebase size, typical task complexity, and preferred model. The estimator calculates expected input tokens, output tokens, and cost per session – so you know what to expect before you start.
Frequently Asked Questions
Does the model choice affect token usage?
Yes. Opus generates more thorough (longer) responses than Sonnet or Haiku, increasing output tokens by 20-40%. Input tokens remain similar across models since they depend on your codebase and conversation, not the model. However, Opus costs more per token, so the dollar impact is significant. Use the Model Selector to pick the right model for each task.Why does a simple question sometimes use 30,000 tokens?
Claude Code reads files to understand context before answering. A "simple" question about a function might cause it to read the function's file, its imports, its tests, and related modules. Each file read adds 1,000-5,000 tokens. You can reduce this by pointing Claude Code to the exact file and line number in your prompt.Does /compact actually save tokens?
Yes, but only for future messages in the session. Running /compact replaces the full conversation history with a compressed summary, typically reducing accumulated context from 40,000-60,000 tokens down to 5,000-10,000. It does not refund tokens already spent. Use it after completing a sub-task within a longer session.How do tokens scale with team size?
Linearly. Each developer runs their own Claude Code sessions independently. A team of 5 developers each running 10 sessions per day at 50,000 tokens each consumes 2.5 million tokens daily. Use the Cost Optimization guide to set per-developer budgets.Find the right skill → Browse 155+ skills in our Skill Finder.
Related Guides
- Token Estimator – Calculate expected token usage for your specific project
- Claude Code Cost Calculator – Convert token estimates into dollar amounts
- Cost Optimization Strategies – Reduce spend without sacrificing output quality
- Claude Code Commands Reference – Master /compact and other token-saving commands
- Model Selector – Choose the right model for cost vs quality tradeoffs