All posts

Claude Code Usage Limits: How to Use Fewer Tokens

claude-codeusage-limitstokenscontext-windowindie-dev

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:

MessageWhat it meansDoes /model help?
You've hit your session limitRolling usage window on your plan ran outNo, shared across all models
You've hit your weekly limitWeekly window ran outNo, shared across all models
You've hit your Opus limit / Sonnet limitThat model family’s allowance ran outYes, switch to a model outside that family
A context or auto-compact warningNot a usage limit. The conversation is near the auto-compact windowNot 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:

  • /usage shows 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. Press d or w to 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.
  • /context shows a live breakdown of what’s in the current context window by category, including which CLAUDE.md and 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.

  1. /clear between unrelated tasks. Stale context costs tokens on every later message. Run /rename first so you can /resume the old session later. /clear itself costs nothing.
  2. Compact with instructions, not by reflex. /compact Focus on code samples and API usage tells Claude what to keep. Remember that compacting a large context is itself a large request, so prefer /clear when you don’t need continuity. You can also add a “Compact instructions” section to CLAUDE.md.
  3. Keep CLAUDE.md under 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.
  4. Hide skills you only run by hand. A skill with disable-model-invocation: true stays 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.
  5. 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: haiku on simple subagents.
  6. Lower effort on simple work. Thinking tokens bill as output. Use /effort or /model to turn effort down for routine edits. On models with a fixed thinking budget, MAX_THINKING_TOKENS sets a lower cap.
  7. Trim MCP and prefer CLIs. MCP tool schemas are deferred by default, so only names load at startup, but CLIs like gh add no per-tool listing at all. Disable servers you aren’t using with /mcp. The MCP guide explains how servers plug in.
  8. 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.
  9. Filter output with a hook. A PreToolUse hook 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.
  10. 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 /rewind instead 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

Frequently asked questions

Does switching models help when I hit the Claude Code weekly limit?

No. The session limit and the weekly limit on subscription plans are shared across all models, so /model does not restore access. Switching only helps after a model-specific message such as "You've hit your Opus limit", where moving to a model outside that family keeps you working.

How do I see what is using my Claude Code tokens?

Run /usage. On Pro, Max, Team, and Enterprise plans it shows plan usage bars plus a breakdown that attributes recent usage to skills, subagents, plugins, and individual MCP servers, and flags behaviors like long context or cache misses. Run /context to see what is filling the current context window.

Is /compact or /clear cheaper?

/clear costs nothing. /compact has to read the whole conversation to summarize it, so compacting a large context is itself a large request. Use /clear when you are switching to unrelated work, and /compact when you need to keep going on the same task.

Why does my first message after a break use so much?

The prompt cache expires after a period of inactivity. On a subscription the lifetime is an hour, dropping to five minutes once you draw on usage credits. After the cache expires, the next request reprocesses your full context instead of reading it from cache.

What happens when I hit the limit in the middle of a task?

On Claude Code v2.1.234 or later, signed in with a claude.ai subscription, an interactive session waits and continues the task on its own after the limit resets, as long as you keep the session open. Press Esc to cancel the wait.

More from the studio.

The apps this workflow ships live on the ZenoLab apps page, with every release in the shiplog.