{"slug": "why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion", "title": "Why you keep hitting Claude Code's usage limit: 8 fixes, measured on 6 billion tokens", "summary": "A developer analyzed three months of Claude Code logs covering 6 billion tokens, 624 sessions and 2,193 subagents, finding that 71% of spend went to context re-read on every turn rather than model output. The largest single consumer was scheduled `claude -p` jobs that start fresh sessions and pay full startup cost each run, followed by long un-cleared conversations and subagents, which accounted for 60% of usage. The developer packaged the findings as a read-only Claude Code plugin, `agent-wrapped`, that inspects MCP servers, CLAUDE.md size, scheduled jobs and subagent model settings to surface token leaks.", "body_md": "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.\n\nI 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.\n\nIn 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.\n\n**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.\n\n`/clear` between tasks\nEvery 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.\n\n**Fix:** when you switch to a new task, `/clear`. The new task doesn't need the old task's 200k tokens riding along.\n\n`/compact` before you walk away\nThe 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.\n\n**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.\n\nCaches 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.\n\n**Fix:** pick the model and tools at the start of a session.\n\nEvery 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.\n\n**Fix:** `/mcp` and turn off what this project doesn't need.\n\nCLAUDE.md and memory files load on every request. A 6,000-token CLAUDE.md costs 6,000 tokens on every turn.\n\n**Fix:** keep only what the agent needs every time. Move rarely needed detail into separate files it reads on demand.\n\nOne 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.\n\n**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.\n\nSubagents were 60% of my usage. Much of that work is searching and summarizing, which a smaller model handles well.\n\n**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.\n\nI packaged these checks as a Claude Code plugin. Install it:\n\n```\n/plugin install agent-wrapped --marketplace novastudio1shop-source/agent-wrapped\n```\n\nThen 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.\n\nFor 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.\n\nWhat's the biggest leak you've found in your own setup? I'm collecting them for the next version.\n\n*Independent tool, not made or endorsed by Anthropic.*", "url": "https://wpnews.pro/news/why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion", "canonical_source": "https://dev.to/nova_studio_127963f255de4/why-you-keep-hitting-claude-codes-usage-limit-8-fixes-measured-on-6-billion-tokens-33ej", "published_at": "2026-11-29 07:00:00+00:00", "updated_at": "2026-11-29 07:13:07.607291+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["Claude Code", "Anthropic", "Agent Wrapped", "Claude"], "also_reported_by": [], "takeaway": "In three months of Claude Code logs, 71% of token spend was context re-read each turn rather than model output, and subagents accounted for 60% of usage, so clearing sessions between tasks, trimming MCP tools and CLAUDE.md, and routing search-only subagents to Haiku or Sonnet cuts the bill most.", "recommendation": {"advice": "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.", "playbook": "llm-cost", "playbook_url": "https://wpnews.pro/playbooks/llm-cost"}, "alternates": {"html": "https://wpnews.pro/news/why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion", "markdown": "https://wpnews.pro/news/why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion.md", "text": "https://wpnews.pro/news/why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion.txt", "jsonld": "https://wpnews.pro/news/why-you-keep-hitting-claude-code-s-usage-limit-8-fixes-measured-on-6-billion.jsonld"}}