Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 4 min read

Why your Claude Code usage climbs while you're at lunch (and 7 fixes that aren't 'buy a bigger plan')

A familiar story: you open Claude Code at 9 am, do some light work, go to lunch, ask one small question at 2 pm, and the weekly bar jumps. You did almost nothing. Where did the tokens go? Anthropic's cost documentation

A familiar story: you open Claude Code at 9 am, do some light work, go to lunch, ask one small question at 2 pm, and the weekly bar jumps. You did almost nothing. Where did the tokens go?

Anthropic's cost documentation has a section titled, more or less, "why usage climbs in a long session". Here's the short version, plus the fixes that make the biggest difference.

First, the mental model

Claude Code is stateless between requests. Every request sends the whole conversation. Every time Claude uses a tool, the results go back in another request that carries that history again.

Prompt caching makes re-reading that history much cheaper than reading it fresh, but "cheaper" is not "free". A session that's been open all day turns a one-line question into a request the size of your whole day.

Keep that model in mind and almost every surprise below makes sense.

The seven usual suspects

1. The session is simply long

The most common one. Long context is paid on every turn.

Fix: /clear when you switch to unrelated work. It costs nothing. If you might come back, /rename the session first, then /resume it later. When you do want continuity, /compact with a focus helps: /compact Focus on the failing auth tests and the files we changed. Note that compacting a huge context is itself a big request, so compact earlier rather than later.

2. You came back after the cache went cold

Cached context has a lifetime. Your first message after a break longer than that lifetime misses the cache and reprocesses the full context at the normal rate.

Fix: before a long break, either /clear (if you're done) or /compact (if you'll continue), so what you come back to is small. /usage now shows a "Prompt cache (main)" line with misses and whether the cache is warm, which makes this visible.

3. A loop kept running

A session-scoped scheduled task (/loop) fires on its interval even while the session is idle, and each run sends your full context.

Fix: /usage lists the heaviest loops with their runs and tokens. Stop the ones you forgot.

4. A background command kept getting check-ins

On some accounts, Claude checks on a background command that has stopped producing output while you're away. Each check-in is a turn with the full context.

Fix: stop stale commands from /tasks. If the docs' "still running" notice appears, sending any message ends the check-ins while keeping the command alive.

5. Subagents, workflows and teammates

Every subagent sends its own requests on top of yours. Agent teams are heavier still: the docs put them at roughly 7x a standard session when teammates run in plan mode, because each teammate holds its own context.

Fix: keep teams small, give teammates focused spawn prompts, shut them down when done, and set model: haiku (or Sonnet) on subagents that do simple work. The /usage attribution shows the subagent share.

6. Verbose tool output fills the context

A test run that prints 3,000 lines lands in context and then rides along on every following request.

Fix: a PreToolUse hook can rewrite test commands to keep only the tail. The docs include a working example that appends 2>&1 | tail -n 100 to npm test, pytest or go test commands before they run. Or delegate noisy work (running the suite, reading logs, fetching docs) to a subagent, so only its summary returns to your main conversation.

7. Things that load every single time

CLAUDE.md, rules without a paths filter, MCP server instructions and tool names: they're in context from the first request.

Fix: run /context to see what's there. Keep CLAUDE.md under about 200 lines (the docs' own target), move workflow-specific instructions into skills that load only when needed, use paths: frontmatter in .claude/rules/ for instructions that only matter in part of the repo, and switch off idle MCP servers in /mcp. CLI tools like gh are still more context-efficient than an MCP server for the same job.

Two smaller ones worth knowing

  • Prompt suggestions send a short request after each reply. It mostly reuses the cache, but you can turn suggestions off.
  • Session recap and idle compaction can use tokens while you're idle; both can be turned off in settings.

Make it visible, then decide

On a Pro, Max, Ultra, Team or Enterprise plan, /usage gives you a breakdown with recommendations, each row showing the share of your recent usage it applies to (at least 10%). On recent versions, pressing f lets Claude Code apply the ones it can, showing you each change first. That's a better starting point than any blog post, including this one, because it's your data.

A sensible order: clear more often, fix the one loud thing /usage points at, trim what loads every time. Only then think about plans. If you keep landing on the Claude usage limit anyway, the honest answer may be a bigger plan, and that's fine too.

Disclosure

We make Ninja Builder, a desktop app that runs Claude Code with your own account. Its usage view splits each chat's tokens into the chat itself, workflows, background agents and test runs. That makes a forgotten loop or a busy background agent easy to spot. It's one way to see this; /usage is another, and it's free.

Ninja Builder Team

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.