Claude Lessons / Guides
Claude Code Token Usage and Costs: See Where It Goes and Cut It
Most advice about Claude Code costs is written for engineering directors buying dashboards. This guide
is for the person actually hitting the limit: why usage climbs faster than your activity suggests, the
built-in commands that show exactly where it's going (/usage, /context,
/insights), and twelve habits that cut the burn — none of which involve using the tool
less. The punchline up front: tokens scale with context, so almost everything here is context hygiene
wearing a different hat.
The two ways you pay
Everything about managing Claude Code spend starts with knowing which meter you're on, because they fail differently:
| Billing | What you pay | What runs out |
|---|---|---|
| Pro plan | $20/month flat | Usage windows: a 5-hour rolling session window plus a weekly cap |
| Max plans | $100 or $200/month flat | Same windows, roughly 5x / 20x Pro's allowance |
| Team / Enterprise | Per seat | Per-seat allowance (same window structure), optional usage credits beyond it |
| API / Console (and Bedrock, Vertex, Foundry) | Per token | Your budget — nothing stops you but spend limits you set |
Three things about subscription limits that surprise almost everyone:
- Usage is shared across surfaces. claude.ai chat, Claude Desktop, and Claude Code draw from one pool. A morning of heavy chat use shortens your afternoon of coding.
-
Windows are shared across models. Switching to a cheaper model with
/modelstretches the allowance (cheaper tokens drain it slower) but doesn't reset a limit you've already hit. -
The dollar figure in
/usageisn't your bill. On a subscription, the session cost readout is computed locally at API list rates for information — you pay the flat fee regardless. It's a useful relative gauge of how heavy a session was, nothing more.
On API billing, the anchors: current list rates run about $5 input / $25 output per million tokens for the Opus tier, $3 / $15 for Sonnet, and $1 / $5 for Haiku (mid-2026 rates; cache reads are far cheaper). Anthropic reports an average of around $13 per developer per active day — roughly $150–250 per month — with 90% of users under $30 per active day. If your numbers are wildly above that, the causes are almost always in the next section.
Why usage climbs faster than you expect
The core mechanic most people miss: Claude Code re-sends the conversation with every request. Each message you send — and each batch of tool results Claude processes — carries the accumulated history with it. Prompt caching makes those re-reads cheap (cached tokens bill at a fraction of the input rate), but cheap times every-single-turn still adds up, and it means a one-line question in a session that's been open all day draws usage for the whole day's context.
Four multipliers on top of that:
- Cache expiry. The prompt cache lasts about an hour on a subscription — and only five minutes on API billing or while drawing on usage credits. Your first message after a long break misses the cache and reprocesses the entire context at full input price. This is why usage "spikes" after lunch.
- Idle isn't always idle. Scheduled tasks fire on their interval, messages from your other sessions arrive as new turns, and agent teammates keep consuming until they exit — each of these sends full context while you're not even looking.
-
Compaction is itself a big request.
/compacthas to read everything it summarizes, so compacting a huge context is one more huge request. When you don't need continuity,/clearcosts nothing. - Thinking is billed as output. Extended thinking is on by default because it makes planning and debugging genuinely better — but thinking tokens are output tokens (the expensive kind), and the default budget can be tens of thousands of tokens per request on hard tasks.
See where it goes: /usage, /context, /insights
Before optimizing anything, look at the data — Claude Code ships three views of it:
| Command | What it shows | Use it when |
|---|---|---|
/usage | Session token totals and local cost estimate, plan usage bars, and an attribution breakdown: which skills, subagents, plugins, and MCP servers consumed recent usage, plus flags for behaviors like long context or cache misses when one drives 10%+ of usage | You want to know what's eating the allowance (toggle between 24h and 7 days) |
/context | What's occupying the context window right now — tool definitions, CLAUDE.md, MCP servers, conversation history | Deciding whether to /clear, /compact, or disable something before continuing |
/insights | An HTML report on how you work: what you work on, friction points, and suggestions — written to ~/.claude/usage-data/report.html | Periodic review of your habits, not day-to-day monitoring |
Two additions worth setting up once: configure your status line to display context usage continuously, so you feel the window filling instead of discovering it at the auto-compact warning; and if you're the one accountable for a team's spend, the Console dashboard, org spend reports, and OpenTelemetry export cover per-user reporting — that side is covered in our Claude Code for teams guide.
The attribution breakdown in /usage deserves special mention because it ends arguments.
Before blaming the model, check whether one MCP server, one over-eager skill, or one subagent pattern is
quietly consuming a third of your usage — it's common, and it's a config fix, not a discipline problem.
Token management is context management
Claude Lessons has a free interactive lesson on managing the context window — practice the clear/compact/delegate decisions that keep sessions sharp and cheap, in a simulated Claude Code workspace.
Start the free interactive lessonsWhat actually burns tokens, ranked
Roughly in order of how often each one is the real culprit:
- 1. Long-lived sessions carrying stale context. Six unrelated tasks in one session means task seven pays rent on the previous six — on every single turn.
- 2. Rework. The most expensive token is the one spent executing the wrong approach. A wrong direction implemented, reviewed, and redone costs three times the tokens of getting the direction right first.
- 3. Opus as the everything model. Opus is worth it for architecture and gnarly debugging. Left as the default for routine edits, it drains allowances (and budgets) several times faster than Sonnet for little visible gain.
- 4. Verbose tool output in the main session. A full test log or build output read into context doesn't just cost once — it rides along in history for the rest of the session.
- 5. MCP server sprawl. Tool definitions are deferred by default now (only names load until used), which helped a lot — but active servers still add overhead, and their tool results count against whichever request consumed them.
- 6. A fat CLAUDE.md. Loaded at session start, present on every turn, whether or not today's work needs the 300 lines of PR-review instructions.
- 7. Default thinking on trivial work. Deep reasoning on "rename this variable" is pure overhead.
- 8. Parallel agents left running. Every teammate is a separate Claude instance with its own context. Multi-agent setups can run around 7x the tokens of a solo session — fine when you're getting 7x the work, expensive when one teammate idles.
12 ways to cut usage without getting worse results
-
1. Clear at task boundaries.
/clearwhen switching to unrelated work — stale context taxes every subsequent message. Run/renamefirst so/resumecan find the session later if you need it back. -
2. Compact deliberately, with instructions. Don't wait for auto-compact mid-task.
/compact focus on the failing tests and the migration planat a clean boundary keeps what matters and drops the noise. The full compact-vs-clear decision is in our context management guide. -
3. Right-size the model. Sonnet for the daily loop, Opus reserved for the problems
that earn it, and
model: haikuin the frontmatter of simple subagents that just fetch, format, or filter. Switch mid-session with/model. -
4. Plan before big changes. One read-only planning pass that catches a wrong
assumption is the cheapest insurance in the tool. Press
Shift+Tabto plan mode for anything multi-file — see our plan mode guide for when it pays and when it's ceremony. -
5. Stop early, rewind instead of arguing. The moment direction looks wrong, press
Escape— then/rewindto a checkpoint. Ten more turns of "no, not like that" costs more than starting the step over from a clean state. - 6. Delegate verbose operations to subagents. Test runs, log trawls, doc fetches, big searches: a subagent's reading stays in its context and only the summary returns to yours.
-
7. Pre-filter noise with hooks. A PreToolUse hook can rewrite
npm testto pipe through a failure filter, turning 10,000 lines of output into the 40 that matter — before any of it touches context. Copy-paste examples are in the hooks guide. - 8. Move workflow docs from CLAUDE.md into skills. CLAUDE.md loads every session; skills load on demand. Keep CLAUDE.md under ~200 lines of always-true essentials and let specialized instructions (release process, migration playbooks) live as skills.
-
9. Prefer CLI tools over equivalent MCP servers.
gh,aws,gcloud,sentry-cli— Claude runs them directly with zero per-tool listing overhead. Run/mcpand disable servers you're not actively using. -
10. Turn thinking down for routine work. Lower the effort level with
/effort(or in/model) when the work is mechanical; save deep reasoning budgets for planning and debugging. -
11. Write specific prompts. "Add input validation to
login()inauth.ts" reads one file. "Improve validation across the codebase" reads forty. Precision in, fewer tokens out. - 12. Give verification targets. A test to make pass, expected output, a screenshot to match. When Claude can check its own work, you skip the most expensive loop of all: you spotting the miss and paying full context for each round of fixes.
If you keep hitting plan limits
In rough order of what to try:
-
Diagnose before upgrading. Check
/usageattribution for a dominant MCP server or skill, and the behavior flags for long context or cache misses. A config fix is free; a plan upgrade is $80/month. - Fix the two habits with the biggest limit impact. Clearing between tasks (habit #1 above) and matching the model to the job (#3) are, per Anthropic's own guidance, where unexpectedly high usage usually traces back to.
-
Use usage credits for occasional overflow.
/usage-creditslets you keep working past a limit on a one-off basis — sensible for a deadline week, expensive as a lifestyle. - Upgrade when it's chronic. Hitting windows more than once or twice a week on Pro is the standard signal for Max 5x; grinding against Max 5x weekly caps is the signal for Max 20x. Whether the spend is justified is a productivity question — our honest breakdown covers that math.
- Put automation on API billing. CI jobs, scheduled tasks, and batch runs on your personal subscription eat the same windows your interactive work needs. Metered API billing fits machines; subscriptions fit humans.
Common mistakes
- Optimizing tokens by skipping verification. Dropping tests or review to save usage is the one economy that reliably costs more than it saves — bugs are the most expensive tokens of all.
-
Keeping a session open all day "to preserve context." Durable state belongs in files
(a plan doc, a progress checklist), which survive
/clearfor free — not in a conversation you're paying to re-send every turn. - Compacting the same session five times. Each compaction is lossy and each one is a large request. If you've compacted twice and the task isn't done, the task probably wants splitting.
- Reading the local cost estimate as a bill. On a subscription it's an informational figure at list rates. What actually constrains you is the usage windows — watch those bars instead.
- Blaming the model for a configuration problem. Attribution data ends the mystery: check it before deciding you need a smaller model, a bigger plan, or a lecture for your team.
FAQ
How much does Claude Code cost per developer?
On API billing, Anthropic reports an average of around $13 per developer per active day — roughly $150–250 per developer per month — with 90% of users staying under $30 per active day. Individuals on Pro ($20/mo) or Max ($100 or $200/mo) plans pay a flat subscription instead and manage usage limits rather than dollars, with optional usage credits to keep working past a limit.
Does Claude Code use tokens when I'm not typing?
A little, and sometimes a lot. Background housekeeping (like summarizing conversations for
--resume) typically costs under $0.04 per session. The bigger surprises are scheduled tasks
firing on their interval, cross-session messages arriving as new turns, and agent teammates left running
— each of those sends your full context and draws real usage while you're away from the keyboard.
Do Claude Code limits reset if I switch models?
No. The 5-hour session window and the weekly window are shared across models, so switching with
/model doesn't restore access once you've hit them. The one nuance: a model-specific Opus
limit can stop Opus while cheaper models keep working. Usage is also shared across surfaces — claude.ai
chat, Claude Desktop, and Claude Code all draw from the same pool.
What's the difference between /usage and /context?
/usage looks backward: session token totals, plan usage bars, and an attribution breakdown
showing which skills, subagents, plugins, and MCP servers consumed your recent usage.
/context looks at right now: what's occupying the context window this moment — tool
definitions, CLAUDE.md, conversation history — which is what you check before deciding to
/clear or /compact.
Is the Pro plan enough for Claude Code?
For evaluation and part-time use, usually yes — a few focused sessions a day fit inside Pro's windows, especially on Sonnet with good context hygiene. Daily heavy use, Opus-heavy work, or parallel agents will hit Pro's 5-hour and weekly windows regularly; that's what the Max tiers (roughly 5x and 20x Pro's usage) exist for. Hitting limits more than once or twice a week is the practical upgrade signal.
Why did my usage spike after a break?
Cache expiry. Claude Code re-sends the whole conversation with every request, normally at cheap cached rates. The cache lasts about an hour on a subscription (five minutes on API billing or while drawing on usage credits) — so your first message after lunch reprocesses the entire accumulated context at full price. Long-lived sessions make this worse; clearing between tasks makes it irrelevant.
Cheap sessions are a skill, not a plan tier
Claude Lessons has 38 free interactive lessons — managing the context window, delegating to subagents, planning before code — the exact habits that cut token burn, practiced hands-on in a simulated Claude Code workspace.
Practice hands-on in the free interactive lessons