Claude Code Learning Hub
中文 Mingyu's Library

Hub / Tips / D · Cost & context

Where did this month's quota go?

You barely got anything done, yet the plan's usage bar is nearly empty — don't guess. Run /usage and read the attribution first; the biggest line item is usually not the one you suspect.

Quota burn has little to do with how much you type, and everything to do with how much context each message carries and whether the cache is hitting. This page: locate the leak first, then stop the bleeding.

One-line answer

Bottom line Run /usage and read the attribution breakdown first (share by skill/subagent/plugin/MCP server, plus long context and cache-miss flags), then check the five usual suspects: long sessions at full context, cache-expiry recompute, scheduled tasks, agent teammates, and /compact itself. Our takeFor most people, the quota is quietly burned by a long session that never gets /clear'd.

Steps

  1. Run /usage — attribution before totals.OfficialThe Session block at the top shows the current session's token stats and a locally estimated dollar amount (for subscribers this figure is not your bill — just watch the plan usage bar below it). Pro/Max/Team/Enterprise plans also get a breakdown: recent usage split into percentages by skills, subagents, plugins, and each MCP server, with any behavior above 10% of recent usage (such as long context or cache misses) individually flagged with saving suggestions; press d/w to switch between the last 24 hours and 7 days. Note that this data comes from local session history — it excludes other devices and claude.ai usage.
  2. Check the official list of ways long sessions burn money, and see which apply to you.Official
    • Long context: every message resends the entire history; ask a single question in a session that's been open all day and you're billed for the whole conversation (cache hits at the cached rate — but still burning).
    • Cache miss: step away past the cache lifetime (1 hour on subscriptions; 5 minutes default for API keys and cloud providers) and the first message recomputes the entire context. Mechanics in Which actions invalidate the prompt cache?.
    • Scheduled tasks: fire on their cycle even while the session is idle, each run carrying the full context.
    • Agent teammates: each active teammate occupies its own context window and keeps consuming tokens until it exits; the official figure is that with teammates running plan mode, agent teams use about 7x the tokens of a regular session.
    • /compact itself: compaction has to read the full conversation first, so compacting a large context is itself one large request; when what you want is a clean restart, /clear is free.
  3. Change habits to stop the bleed — highest payoff first.Official
    • /clear between tasks: clear whenever you switch to unrelated work; /rename it first so /resume can find it later.
    • Match the model to the task: Sonnet for everyday work, Opus reserved for hard architecture decisions; give simple subagent tasks model: haiku in their config.
    • Delegate long outputs to subagents: running tests, reading logs, fetching docs — put big-output work in a child context that returns only a summary (see D10 · Subagents).
    • Keep only the MCP servers you use: toggle idle servers off in /mcp; CLIs like gh, aws, and gcloud are cheaper on context than MCP (see Why too many MCP servers slow you down and cost more).
    • Keep CLAUDE.md under 200 lines; move specialized procedures into skills, loaded on demand.
    • Lower effort for simple tasks (/effort) or trim the thinking budget; thinking tokens are billed as output, and the default budget can reach tens of thousands of tokens per request.
  4. Teams and API users: reconcile at the org level.OfficialOpenTelemetry exports claude_code.token.usage and claude_code.cost.usage into your own monitoring stack, sliceable by user and by model, available under any auth method; Console (API) users should treat platform.claude.com/usage as the source of truth — the local /usage dollar figure is estimated at standard list prices, with no discounts applied.

Copy-paste prompt

Run a Claude Code usage check-up for me. Goal: find what's burning quota and fix it:
1. Count the lines in the project root CLAUDE.md and ~/.claude/CLAUDE.md;
   where either exceeds 200 lines, point out which sections should move
   into skills that load on demand;
2. Read the MCP server list configured in .mcp.json and settings at every
   level, and — given what this project actually needs — flag the idle
   servers I should toggle off in /mcp;
3. Check whether scheduled tasks or agent-teams settings are configured,
   and assess their background consumption;
4. Remind me to run /usage and /context myself (user commands — you can't
   run them for me), and tell me which fields to focus on in each;
5. Finish with a quota-saving checklist in two tiers: "do now" and
   "do this week".

Sources & last verified

  • Officialcode.claude.com/docs/en/costs.md (/usage explained, long-session burn mechanics, all "Reduce token usage" strategies, agent teams 7x), fetched 2026-08-05.
  • Officialcode.claude.com/docs/en/monitoring-usage.md (OTel export, token.usage and cost.usage metrics), fetched 2026-08-05.
  • Our take"The biggest line item is usually a long session that never gets /clear'd" is our judgment based on the official mechanics; the fix-priority ordering is our arrangement.
  • Last verified: 2026-08-05 · volatility:high (the /usage UI and billing semantics change across versions; official docs at v2.1.222, needs periodic re-checking).