Claude Code Token Running Out? A Guide to Auditing and Fixing 7 Hidden Consumption Points

Claude Code's real Token drain is repeated history resending — here are 7 fixes ranked by actual savings.
Claude Code users hit usage limits early not because they ask too much, but because every turn resends the full conversation history — real input is just 0.01% of the bill. This guide ranks seven fixes by impact: the free `/clear` command resets context entirely; switching models mid-session destroys caching and multiplies costs 10x; tool output filters, disconnecting idle MCP tools, and selective use of subagents address hidden background consumption; and misconfigured scheduled tasks silently drain quota overnight. It also debunks widely shared but ineffective advice: shorter prompts, compact, screenshots, and raw PDFs don't save money and can make things worse.
Many heavy Claude Code users have run into the same frustration: they haven't been running it for eight hours straight or working on any massive project, yet they keep hitting usage limits early and getting told to "come back in 5 hours." A Bilibili creator's debugging experience revealed a counterintuitive truth — the real Token drain is almost never the prompts you type, but the invisible, repeated consumption you can't see.
This article breaks down the underlying mechanics of Token consumption based on that creator's hands-on testing, ranking seven fixes from highest to lowest actual savings impact — from zero-cost changes to traps that double your bill while you think you're saving money.
Why Tokens "Compound"
The key to understanding Token consumption is a single fact: these models have no memory. None whatsoever. Every time you press Enter, the entire conversation gets repackaged and sent from the beginning.
Your first message only costs what you typed. Your second message costs what you typed, plus the model's reply, plus the first message. By message twenty, what you just wrote is a tiny box at the top — everything below it is history you've already paid for and are now paying for again. This is the root of Token compound growth.
According to the creator's logs, their actual input accounted for roughly 0.01% of the bill. A full 96% came from what they called "poisoned history" — old conversation turns being resent over and over. An agent reading data at turn 40 can multiply a 3,000-Token operation by dozens of times just from resending history.

Because every setup is different, the creator shared an audit prompt you can paste directly into Claude Code. It reads your actual configuration, breaks down context composition, checks tool latency, measures memory files, looks at cache hit rates, and flags scheduled tasks that fire while you sleep. Run it once to find out exactly what's eating your quota.
This mechanism is technically called the Context Window. Large language models don't have persistent memory like humans — each inference takes a fixed-length text sequence as input. Claude 3.5's context window caps at roughly 200,000 Tokens (about 150,000 words), with Opus being larger. As conversation length approaches that limit, the system auto-trims the oldest content, but until then, every interaction is billed on the total of "system prompt + full conversation history + current input." A Token is the basic unit of text processing, roughly equivalent to 3/4 of an English word or 1–2 Chinese characters. Anthropic prices input and output Tokens separately — input is usually cheaper, but in long sessions the repeated resending of history causes input volume to balloon far beyond any single reply's output, which is the mathematical source of the compounding effect.
Fix 1: Use /clear Between Tasks (Zero Cost, Highest Leverage)
The highest-leverage cost-cutting action is free and just five characters: /clear.
When you finish one task and start the next, don't take the shortcut of continuing in the same session. The old conversation doesn't sit quietly — it gets resent with every message you send, until your quota is gone. In the creator's demo, a session had ballooned to 80,000 Tokens; typing /clear and hitting Enter reset it to zero instantly.
Anthropic's documentation also states clearly that when you want to start fresh rather than continue, /clear costs nothing. That's why it beats every other method — other fixes reduce one component of context, while clearing resets the entire foundation everything else builds on.
A practical tip: before clearing, use /rename to name the session. You can then restore it with /resume if needed, so you're not losing work in an emergency. You're not throwing away results — you're just stopping the next task from dragging them along.
Fix 2: Pick Your Model at Session Start and Leave It Alone
This one runs counter to the instinct to save money. Many users switch from Opus down to Sonnet mid-session thinking it'll cut costs — but that's actually one of the most expensive moves you can make.
The reason is caching. Your conversation gets cached, and cache reads cost only one-tenth of normal output prices. That's why long sessions don't bankrupt you. But the model is part of the cache key — switch models and the history no longer matches the cache. The entire conversation gets reprocessed at full price. On Opus, a 200,000-Token context turns what would have been a one-tenth-price round into a full-price one — ten times more expensive — and none of it is visible.
Operations that break the cache include: switching models, changing effort level, enabling fast mode, connecting or disconnecting MCP servers, enabling plugins with MCP, and using compact. Additionally, resuming a long session after upgrading Claude Code is described in Anthropic's docs as "the most expensive request you can send."
Operations that are relatively safe and won't rebuild the cache include: editing repo files, editing memory files, changing output style, adjusting permissions, adjusting skills and commands, rewinding, and spawning subagents. The rule is simple: choose your model and effort level at the start of a session, then leave them alone. If you want cheaper models, use them from the beginning.
Anthropic introduced Prompt Caching for the Claude API, allowing the server to store frequently recurring context prefixes in a fast cache. When a subsequent request's prefix hits the cache, the read cost is just 10% of the standard input price. The cache key is composed of model version, system prompt, tool definitions, and conversation history — any change in any dimension causes a cache miss and triggers full reprocessing. Cache entries are valid for approximately 5 minutes (default) up to 1 hour (extendable); expiration also counts as a miss. This explains why "switching models mid-session" and "infrequent scheduled tasks" — both seemingly harmless — are actually silent cost multipliers: the former actively destroys the cache, the latter passively waits for it to expire.
Fix 3: Add Filters to Tool Output
The next three fixes target things consuming context that you never typed.
Imagine you ask an agent to install a library. It runs the command and returns 800 lines of logs — version numbers, warnings, progress info you'll never read. You just want to know if it worked. But the agent can't skim — all 800 lines enter the conversation, and you pay for them in every subsequent message until you clear.

The fix is to add a small filter file between the agent and its commands that trims output before the agent ever sees it. Anthropic provides a ready-to-use version that reduces context from tens of thousands of Tokens down to hundreds. Set it up once and it applies to every session going forward.
Fix 4: Disconnect MCP Tools You're Not Using
This fix is about what's already in context before you type a single word.
You connect Gmail, Notion, and Slack — one command each, feels free. But it isn't. Each tool comes with a "manual" the agent must read before using it. According to the creator's data, GitHub alone costs 26,000 Tokens; Slack is 21,000. These load into every session before you say a word.
The good news is Claude has released an update so agents no longer read every full manual by default — instead they load a "table of contents" and only expand the relevant parts when needed, cutting costs by roughly 85%. This is on by default, no action required. But you're still paying for the table of contents, and each new tool you connect makes it larger.
The fix takes about 30 seconds: open the tools panel and turn off anything you haven't used in the last month. Disconnecting tools mid-session doesn't cost extra — as long as the display shows "latency," connecting and disconnecting are append operations and won't rebuild the cache the way switching models does.
Fix 5: Subagents Move Tokens, They Don't Save Them
There's a half-true claim about subagents: people say they save Tokens. They really just move them.

Using numbers from Anthropic's own documentation: a research subagent reads roughly 6,000 Tokens of files but only returns a 420-Token summary to the main context — looks like a huge win in the main window. But accounting for the full picture, that subagent also loaded its own system prompt, a copy of memory files, and tools, burning roughly 9,800 Tokens total to save you 5,700. Viewed in isolation, you're actually in the red. Anthropic itself states that agents consume roughly 4x the Tokens of chat, and multi-agent systems roughly 15x.
Subagents are genuinely worth using when three conditions are met simultaneously: high output volume, you no longer need the details, and the session will continue for many more turns. That third point is crucial — the 5,700 Tokens you saved only pay off if they're being resent in every remaining turn. If you end the session right after delegating, you simply paid more for nothing.
A free upgrade: set subagent models to Haiku. It reduces isolated-task consumption by roughly 5x without touching the main session's cache. Similarly, for small tasks like renaming files, writing commit messages, or cleaning up lists, using "the dumbest model that can do the job" is a good heuristic — but switch via skills and subagents, not by changing the model in the main session.
Claude Code's subagents are built on Anthropic's multi-agent framework: the main agent (Orchestrator) spawns independent Subagents via tool calls, each with their own isolated context window. After completing a task, the subagent returns only a result summary to the main context, not raw data. The architecture is designed to overcome the length limits of a single context window for very long documents or parallel tasks — not to reduce total Token consumption. Haiku is Anthropic's lightweight model, priced at roughly 1/30 to 1/50 of Opus, suitable for well-defined tasks with short outputs (e.g., file renaming, format conversion). Pointing subagents at Haiku instead of Opus dramatically compresses subtask costs without affecting the main session cache — provided the subtask doesn't require complex reasoning.
Fix 6: Check What Your Scheduled Tasks Are Doing at 3 AM
Every previous fix assumed you're sitting at the keyboard. This one is about what happens when you're not — and it's the "trap" promised at the start.

Scheduled tasks fire on their interval whether you're there or not, and they send the entire context, not a portion of it. If a task is connected to a bloated session, every trigger pays for the whole context — forever.
What makes it worse is that caches expire. If a task runs less than once per hour, every trigger misses the cache and reprocesses the full context at full price instead of one-tenth the cache price — a 10x cost increase. Task frequency is therefore a real cost setting: running every 45 minutes instead of every hour or every two hours can actually be cheaper.
This is also a good place to correct a popular misconception: some people claim that leaving Claude Code running in the background burns through your quota. Anthropic's documentation shows background usage costs less than 4 cents per session — that's not the problem. What actually doubles your bill while you're not touching the keyboard is scheduled tasks connected to bloated sessions, consuming continuously until you quit.
Advice That Doesn't Actually Work
The creator specifically debunked several widely circulated but incorrect recommendations:
Writing shorter prompts: Ineffective. Actual input accounts for a negligible fraction of the bill — prompt length is a rounding error. Vague prompts do cost more, but through triggering file reads and rework, not through length itself.
Using compact to save Tokens: Backwards. To generate a summary, the model has to send the entire conversation one more time, then deliberately invalidates the cache. Compact buys you continuity, not savings. If you just want to undo a few bad turns, use /rewind to return to a known cache point — no re-reading required.
Screenshots instead of text: Images aren't cheaper than the text they contain. On Opus, a typical screenshot costs about 2,700 Tokens; 4K resolution approaches 5,000. Pasting plain text is cheaper, and the agent can actually edit text — it can't edit an image.
Feeding PDFs directly: PDFs cost 1,500–3,000 Tokens per page for text alone, and the agent also takes a photo of each page — so you pay twice per page. Have the agent convert to plain text first; the same document costs roughly one-quarter as much.
Compact is a built-in Claude Code feature whose underlying operation is having the model generate a rolling summary of the current full conversation, then replacing the original history with that summary — freeing up context space without clearing the session. The cost: generating the summary requires sending the entire old history once at full price, the summary is the model's subjective distillation and may lose details, and it actively invalidates the cache. By contrast, /rewind lets you roll back to a specified history checkpoint and delete everything after it, without triggering cache rebuilding — because the retained history exactly matches what's in the cache. In the "regret a few turns" scenario, /rewind beats Compact on both cost and information integrity. Compact is better suited to the specific situation where a conversation is extremely long, must continue, but cannot be cleared.
Four Self-Audit Commands to Check Regularly
To keep these optimizations working long-term, the creator recommends four tools — three of which are already in your terminal:
/context: Displays line-by-line what's in the current window and how much space each part occupies. Used most frequently./usage: Shows how much of your plan quota has been consumed and which skill, tool, or agent consumed it./cost: Shows how much the current session has cost, broken down between "poisoned history" and new work.- The burn-rate display in the corner of the screen: that jumping number while you work will change your habits faster than any rule.
Additionally, every session you've run is stored in a folder with per-reply costs logged. Point a subagent at those logs to calculate your own consumption percentages, rather than copying someone else's numbers.
Closing: It's Your Desktop
The core conclusion is straightforward: you're hitting your limits almost never because you're asking too much, but because the vast majority of what you're paying for is history that's already been sent — and nobody told you where the switches are.
Clear between tasks because it's free and resets the foundation. Pick your model and effort level once and leave them alone. Filter tool output before it lands. Disconnect tools you're not using. Only delegate to subagents when the session still has a long way to go. Go check what your scheduled tasks are doing at 3 AM. The creator is candid: the labs won't proactively help you fix this — not because it's hard, but because they don't grade themselves on how many Tokens you use. This is your desktop. Keep it clean. Run the audit prompt once a week, or whenever spending feels high, because your configuration slowly drifts as you add servers, install plugins, and change settings.
Related articles

Building an AI-Powered E-Commerce Business from Scratch: A Real-World Account of Multi-Agent Architecture for Print-on-Demand
A blogger builds a print-on-demand e-commerce company from scratch using AI agents — documenting specialized Agent profiles, GPT-5.6 vs Claude Fable multi-model orchestration, and reusable skill accumulation.

AI Agent Earns $10K in One Week: 3 Key Upgrades Explained
A blogger shares how he earned $10K in a week with an AI Agent — not by adding more skills, but through verification, approval gates, and subagents to raise trust and enable true automation.

Getting Started with OpenClaw: Multi-Channel AI Agent Gateway and Automated Workflow Guide
OpenClaw is an open-source multi-channel AI agent gateway. This guide covers its three core components — gateway, agents, and channels — plus tool integration and memory mechanisms.