Usage limits are the loudest Claude Code complaint on X this weekend. One developer typed “hi” into a session with about a dozen skills installed and watched it read 27k tokens before answering. Another put it plainly: an agent is expensive less because of what it writes than because of what it re-reads. Several people shipped menu bar and tray apps this week just to track when their limit resets.
They’re right about the re-reading. This guide explains where Claude Code’s tokens go, using the official costs and context window docs, and the habits that make a Pro or Max plan last longer.
Which limit did you hit?
The error message tells you which ceiling you ran into, and the fix depends on it. From the error reference:
| Message | What it means | Does /model help? |
|---|---|---|
You've hit your session limit | Rolling usage window on your plan ran out | No, shared across all models |
You've hit your weekly limit | Weekly window ran out | No, shared across all models |
You've hit your Opus limit / Sonnet limit | That model family’s allowance ran out | Yes, switch to a model outside that family |
| A context or auto-compact warning | Not a usage limit. The conversation is near the auto-compact window | Not needed. Clear or compact |
On Team and Enterprise plans, the allowance resets on a rolling five-hour window and a weekly window, and it is shared with Claude chat and Cowork.
Where the tokens actually go
Everything loads before you type
Before your first prompt, Claude Code puts a lot into context: the system prompt, your global and project CLAUDE.md, auto memory (the first 200 lines or 25KB of MEMORY.md), environment info, MCP tool names, and a one-line description of every skill Claude can invoke. Your own setup can add more, like an output style or --append-system-prompt text.
This is why “hi” is never cheap. A dozen skills means a dozen descriptions. A long CLAUDE.md is read in full every session. The context window page has an interactive timeline that shows this filling up.
Every request resends the conversation
Claude Code sends your full conversation with every request, and each round of tool calls sends another request carrying those tool results. Prompt caching makes the repeated part cheaper, but it still counts. In the docs’ words, a one-line question in a session that has been open all day still draws usage for the whole conversation.
Cache misses after a break
The cache expires after a period of inactivity. On a subscription the lifetime is an hour, and it drops to five minutes once you are drawing on usage credits. Your first message after a longer break reprocesses the full context at the uncached rate.
Work that runs while you’re idle
The costs page lists things that spend tokens without you typing: scheduled tasks (/loop), messages from your other sessions, goal check-ins, subagents and workflows, and agent teammates that haven’t exited. Each of these sends your full context when it fires. Agent teams in particular use roughly 7x more tokens than a standard session when teammates run in plan mode, because each teammate has its own context window.
See your own numbers first
Don’t guess. Two commands show where your usage goes:
/usageshows plan usage bars and, on Pro, Max, Team, and Enterprise plans, a breakdown that attributes recent usage to skills, subagents, plugins, and individual MCP servers. It flags any behavior, such as long context or cache misses, that accounts for 10% or more of recent usage. Pressdorwto switch between the last 24 hours and the last 7 days. The numbers come from local session history, so usage from other devices or claude.ai isn’t included./contextshows a live breakdown of what’s in the current context window by category, including whichCLAUDE.mdand memory files loaded, with optimization suggestions.
If you want the context size visible all the time, the status line can display it. The slash commands guide covers the rest of the built-in commands.
Ten habits that cut token use
These come from the docs’ “reduce token usage” section, ordered roughly by how much they help a solo developer.
/clearbetween unrelated tasks. Stale context costs tokens on every later message. Run/renamefirst so you can/resumethe old session later./clearitself costs nothing.- Compact with instructions, not by reflex.
/compact Focus on code samples and API usagetells Claude what to keep. Remember that compacting a large context is itself a large request, so prefer/clearwhen you don’t need continuity. You can also add a “Compact instructions” section toCLAUDE.md. - Keep
CLAUDE.mdunder 200 lines. It loads every session. Move workflow-specific instructions, like how to cut a release or run a migration, into skills, which load their full content only when used. - Hide skills you only run by hand. A skill with
disable-model-invocation: truestays out of the startup skill list entirely and costs nothing until you type/name. This is the direct fix for the “dozen skills before hi” problem. - Match the model to the job. The docs say Sonnet handles most coding tasks well and costs less than Opus. Save Opus for architecture and multi-step reasoning, and set
model: haikuon simple subagents. - Lower effort on simple work. Thinking tokens bill as output. Use
/effortor/modelto turn effort down for routine edits. On models with a fixed thinking budget,MAX_THINKING_TOKENSsets a lower cap. - Trim MCP and prefer CLIs. MCP tool schemas are deferred by default, so only names load at startup, but CLIs like
ghadd no per-tool listing at all. Disable servers you aren’t using with/mcp. The MCP guide explains how servers plug in. - Send noisy work to a subagent. Test runs, log processing, and doc fetching fill context fast. A subagent keeps that output in its own context and returns a summary. Its requests still count, so give it a smaller model.
- Filter output with a hook. A
PreToolUsehook can rewrite a test command so only failures come back, which the docs say can shrink tens of thousands of tokens to hundreds. The hooks guide walks through hook setup. - Write specific prompts and stop early. “Improve this codebase” triggers broad scanning. “Add input validation to the login function in auth.ts” doesn’t. If Claude heads the wrong way, press Esc, then
/rewindinstead of arguing with it for five turns. For bigger changes, plan mode (Shift+Tab) costs less than undoing a wrong start.
For how compaction and lazy skill loading work under the hood, see Deep Dive 4 on context compaction.
When you hit the limit anyway
On Claude Code v2.1.234 or later, signed in with a claude.ai subscription, an interactive session waits when a usage limit stops it mid-task and continues on its own after the reset. You’ll see Usage limit reached · limit resets 3:45pm and Continuing automatically at 3:45pm · esc to cancel at the bottom. Keep the session open for this to work.
If you can’t wait, /usage-credits opens the settings for usage credits, which bill past your plan limit. Keep in mind the cache lifetime drops to five minutes while you draw on them, so long pauses get more expensive.
Or take the break. A forced two-hour stop is a fine time to step away from the screen, and a focus timer like Molip from the app catalog makes the next session start on purpose instead of by habit.
Sources
- Manage costs effectively: code.claude.com/docs/en/costs
- Explore the context window: code.claude.com/docs/en/context-window
- Prompt caching and cache lifetime: code.claude.com/docs/en/prompt-caching
- Usage limit errors: code.claude.com/docs/en/errors
- Waiting for a limit to reset: code.claude.com/docs/en/interactive-mode
- Status line: code.claude.com/docs/en/statusline