# Why you keep hitting Claude Code's usage limit: 8 fixes, measured on 6 billion tokens

> Source: <https://dev.to/nova_studio_127963f255de4/why-you-keep-hitting-claude-codes-usage-limit-8-fixes-measured-on-6-billion-tokens-33ej>
> Published: 2026-11-29 07:00:00+00:00

**Recommendation:** Clear context between tasks, disable unneeded MCP servers, trim CLAUDE.md, and set search-only subagents to Haiku or Sonnet to cut per-turn context cost.
More in the playbook "Controlling LLM cost": <https://wpnews.pro/playbooks/llm-cost>

If Claude Code tells you "You've hit your session limit" more often than you expect, the cause is usually not the work you asked for. It's what rides along with every request.

I measured three months of my own logs (6 billion tokens, 624 sessions, 2,193 subagents) with [Agent Wrapped](https://novastudio1shop-source.github.io/agent-wrapped/). 71% of the spend was context (the conversation written to the prompt cache and read back each turn), not the model's answers. Here are the fixes that matter, roughly in order of what they saved.

In 7 of my 9 limit walls, the biggest consumer was a scheduled agent: a `claude -p` job running every 15 to 30 minutes. Each run starts a fresh session and pays the full startup cost (system prompt, tool definitions, memory files) before doing anything.

**Fix:** list what runs on a schedule (cron, Task Scheduler, launchd, `~/.claude/scheduled-tasks/`). Run each job less often, or batch the work into fewer, larger runs.

`/clear` between tasks
Every turn re-reads the entire conversation. Past about 150k tokens, each extra turn pays for all of it again. My most expensive sessions peaked above 500k tokens of context.

**Fix:** when you switch to a new task, `/clear`. The new task doesn't need the old task's 200k tokens riding along.

`/compact` before you walk away
The prompt cache expires. Come back after a long pause and the whole conversation is written to the cache again at the full write price, which is much more than reading it.

**Fix:** at a natural stopping point, `/compact` and say what to keep (`/compact keep the API design and the failing test`). Coming back to a small context is cheap.

Caches are per model, and the tool list sits at the start of the prompt. Switching with `/model`, or connecting and disconnecting MCP servers partway through, throws the cache away and rewrites everything after it.

**Fix:** pick the model and tools at the start of a session.

Every connected server adds its tool descriptions to every request of every session and every subagent. My median subagent started at 28k tokens before doing any work.

**Fix:** `/mcp` and turn off what this project doesn't need.

CLAUDE.md and memory files load on every request. A 6,000-token CLAUDE.md costs 6,000 tokens on every turn.

**Fix:** keep only what the agent needs every time. Move rarely needed detail into separate files it reads on demand.

One big tool result (a PDF, a lock file, a full test log) is paid for when it arrives and again on every later turn of the session. I had 5,858 results over 4,000 tokens.

**Fix:** "read lines 100 to 180", `Grep` first, add `| tail -50` to noisy commands, and give page ranges for PDFs. Put "keep command output short" in CLAUDE.md so it's the default.

Subagents were 60% of my usage. Much of that work is searching and summarizing, which a smaller model handles well.

**Fix:** in `.claude/agents/<name>.md`, add `model: haiku` or `model: sonnet` to agents that only search, read or summarize. Keep the top model for the main thread.

I packaged these checks as a Claude Code plugin. Install it:

```
/plugin install agent-wrapped --marketplace novastudio1shop-source/agent-wrapped
```

Then run `/agent-wrapped:leak-check`. Claude inspects your MCP servers, CLAUDE.md size, scheduled jobs, biggest sessions and subagent settings, and gives you a fix list. It's read-only.

For the actual numbers (tokens and API-price value per session, every cache rebuild, oversized context, the biggest tool results, and what was running before each time you hit the limit), open the free [Agent Wrapped page](https://novastudio1shop-source.github.io/agent-wrapped/). It reads your `~/.claude` logs in the browser and uploads nothing. There's also a [$9 version](https://buy.stripe.com/9B67sN4NG6gx1yi1PJbsc0b) with the per-session detail and an export.

What's the biggest leak you've found in your own setup? I'm collecting them for the next version.

*Independent tool, not made or endorsed by Anthropic.*
