Claude Code Usage Limits: Why You Hit Them and How to Use Fewer Tokens
If you use Claude Code on a subscription, you have probably seen "You've hit your session limit" sooner than your output seemed to justify. The short explanation, straight from Anthropic's documentation, is that most of your usage is Claude re-reading what the session already knows, not the words you type or the code it writes.
This guide explains where the tokens go and lists habits that help, each tied to the official docs. It was checked against Anthropic's Manage costs effectively and environment variables pages on 2026-10-17. Claude Code changes quickly, so re-check the docs if something behaves differently. We are independent and not affiliated with Anthropic.
Why a quiet session can use a lot
Claude Code sends your full conversation with every request, and each time Claude uses a tool it sends another request carrying that batch of tool results. Prompt caching makes the re-reading cheaper, but a one-line question in a session that has been open all day still draws on your limits for the whole conversation. A long session costs more than the same work split into a few short ones, because turn 40 also re-reads turns 1 to 39.
The docs list the usual culprits:
| Cause | What happens |
|---|---|
| Long context | Every request carries the whole history |
| Cache misses | After a break longer than the cache lifetime (one hour on a subscription, five minutes on an API key or when drawing on usage credits) the next message re-processes everything |
| Scheduled tasks and loops | A /loop fires on its interval even when the session is idle, sending your full context each time |
| Goal check-ins | While background work keeps a goal waiting, Claude Code can start idle turns that re-send your context (capped at three per goal between your prompts on recent versions) |
| Subagents and agent teams | Each one sends its own requests; agent teams use roughly 7 times more tokens than standard sessions when teammates run in plan mode |
| Compaction | /compact reads the whole conversation it summarizes, so compacting a large context is itself a large request. /clear costs nothing |
| Extended thinking | Thinking tokens are billed as output, and the default budget can be tens of thousands of tokens per request |
First, look: three commands
/usageshows plan usage bars and, on Pro, Max, Team and Enterprise plans, a breakdown of recent usage by skills, subagents, plugins and individual MCP servers. It flags behaviors that account for 10% or more of recent usage, such as long context or cache misses, and lists the heaviest loops. Pressdorwfor the last 24 hours or 7 days. The docs note the figures are approximate and cover this machine only./contextshows what is filling the context window. Run it at the start of a fresh session to see what is loaded before you type anything./mcplists your MCP servers. Disable the ones you did not use this week.
Twelve habits that help
/clearbetween unrelated tasks. Run/renamefirst if you may come back, then/resumelater. The docs say stale context wastes tokens on every subsequent message.- Match the model to the job. Sonnet handles most coding tasks well and costs less than Opus; keep Opus for hard architectural decisions. A switch to Opus also applies to subagents that inherit your model.
/compactbefore a break, not after. Summarizing is cheaper while the old conversation is still cached. You can steer it:/compact Focus on failing tests and the files changed./rewindinstead of compacting when the last turns went wrong. Rewinding cuts turns off the end, so everything before them stays cached.- Lower the effort for simple tasks with
/effort. On models with a fixed thinking budget you can also setMAX_THINKING_TOKENS; adaptive models use effort levels. - Disable unused MCP servers and prefer CLI tools such as
ghoraws, which add no per-tool listing. - Ask specific questions. "Add input validation to the login function in auth.ts" reads a few lines; "improve this codebase" triggers broad scanning.
- Use plan mode (
Shift+Tab) for complex work, and press Esc early when a turn heads the wrong way. - Send noisy work to a subagent (test suites, log reads, doc fetches) so only a summary returns, and pick a smaller model for routine subagents with
model: haikuin the agent definition. - Filter output before Claude sees it. A PreToolUse hook can cut a 10,000-line log to the error lines; Anthropic's cost page includes an example that filters test output to failures.
- Keep CLAUDE.md under about 200 lines and move workflow-specific instructions into skills, which load only when used. Our free 12 agent skills and the AGENTS.md vs CLAUDE.md guide help here.
- Do not leave loops and idle goals running in a huge session. Run them in a small fresh session, or turn goal check-ins off with
CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0.
A few settings worth knowing
Variables go in the env block of ~/.claude/settings.json (all projects) or .claude/settings.json (one project):
{
"env": {
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "200000",
"CLAUDE_CODE_GOAL_CHECKIN_MINUTES": "0"
}
}
CLAUDE_CODE_AUTO_COMPACT_WINDOW sets the auto-compact window in tokens (100000 to 1000000, plain integers only: 200k would be misread). CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0 turns idle goal check-ins off on v2.1.234 or later. Both have trade-offs: earlier compaction loses detail sooner on very long tasks. Many variables list a minimum Claude Code version on the env-vars page, so check claude --version if one does nothing.
See where your own usage went
Claude Code keeps session transcripts on your machine. We wrote a small read-only script that summarizes them: which sessions are long, how much volume comes from very large contexts, and how much from subagents. It is free, standard-library Python, tested on sample data, and the output explains volume, not the exact percentage on your plan meter (use /usage for that).
Download the free usage audit script and cheat sheet. If you want the whole workflow (a 13-page guide, lean settings, a test-output hook, two small-model subagents and a context-budget skill), that is our Claude Code Usage Saver Kit, a paid product from us. Everything in this guide works without it.
What not to expect
No habit here promises a specific saving. How much you save depends on how you work, your plan, and which model you use. The biggest and cheapest win for most people is the first one: shorter, fresher sessions.
AI Coding Agent Config Kit
Instruction-file templates for 12 stacks and 12 prompts that write and audit them. 34-page PDF, $14.
Not ready to buy? Start with the free PDF.
Get 10 of our most-used prompts as a free PDF from Gumroad. You will be asked for your email so Gumroad can deliver it.