Video summary
Paste This Into Claude Code, Never Run Out Of Tokens Again
Main summary
Key takeaways
Why token usage balloons in long Claude/agent sessions
The video explains why Claude/agent token usage balloons during long sessions and offers a free prompt to audit your setup, followed by seven fixes to reduce token consumption and prevent session-limit blowups.
Core technical explanation (why tokens compound)
- Claude/LLM sessions have no effective memory of the conversation.
- Each time you send a message, the entire conversation history is re-sent and reprocessed from the top.
- As a result, token cost compounds over turns:
- After many messages, your newest input is only a small fraction of what you’re paying for.
- Most of the cost comes from re-reading prior context.
- Example: a “3,000 token file” introduced early can end up costing far more later because it is reprocessed across many subsequent turns.
Audit prompt + what it checks (guide/tutorial)
The creator provides a prompt to paste into Claude Code (included/linked in the video description; no email required) that audits your configuration.
The audit:
- Reviews context breakdown
- Checks whether tool deferral is enabled
- Measures memory files
- Checks cache hit ratio
- Flags scheduled tasks that run while you’re away
It also tells you which of the later fixes will matter most for your setup.
Seven fixes that reduce token consumption
1. Clear between jobs (free, highest leverage)
- Use
/clearat the start of a new job instead of continuing the same thread. - Why: old conversation history is still resent on every message until session end.
- Workflow tip: use
/renamebefore clearing so you can later resume. - Claim: the speaker’s spend was ~96% from re-reading history.
2. Do not switch model mid-session (expensive keystroke)
- Switching models (e.g., Opus → Sonnet) changes the cache key, so history no longer matches cache and gets reprocessed at full cost.
- Also applies to changes like:
- effort level
- fast mode
- some server/plugin connection changes
- Warning (per Anthropic docs, as quoted): upgrading “Cloud Code” and resuming can be among the most expensive requests.
3. Filter tool/command output before it enters context
- Problem example: a command (e.g., an install) returns huge output (e.g., ~800 lines with versions/warnings).
- The agent must ingest it, and that context then gets resent repeatedly until cleared.
- Solution: insert a filter so the agent generates a smaller intermediate artifact (like a file) that reduces output before the main conversation sees it.
- Mentioned: Anthropic already provides a working version that reduces context dramatically.
4. Turn off unused connected tools (reduces “manual” context load)
- Connected tools (e.g., Gmail/Notion/Slack) may load large “manual” instruction content up-front.
- The speaker cites large token counts for tools like GitHub/Slack.
- Claude update behavior: manuals may be loaded more lazily (content page first, then only necessary sections), reducing cost ~85%—but there’s still cost for the contents pages.
- Fix:
- Use
/contextto inspect whether tool deferral is enabled. - Use an And command/panel to list connected tools and disable ones you don’t use (example: “last month”).
- Use
- Turning off tools mid-session should not rebuild cache if tool deferral shows “deferred.”
5. Be cautious with sub-agents (they move tokens, not eliminate them)
- “Sub-agents save tokens” is described as half true:
- They reduce what the main agent sees,
- but sub-agents incur their own costs (system prompt, memory copy, tools, etc.).
- Speaker’s math/example:
- Sub-agent might read ~6,000 tokens but return only ~420 tokens.
- However, total cost can still outweigh savings depending on how long the session continues.
- Sub-agents are most worth it when:
- output is high volume,
- you won’t need the detail again,
- the session will continue for many more turns (so saved tokens avoid repeated re-sending).
- Recommendation: if using sub-agents, set their model to Haiku for cheaper isolated work (claimed ~5× reduction) without touching main-session cache.
6. Pick the right model/effort at the start; don’t “optimize” midstream
- Kills a myth: that “half of what you ask for is small” isn’t the key factor.
- Better approach:
- choose the simplest model that can still complete the job
- fix settings at the start (avoid mid-session changes)
- Also suggests:
- per-skill/per-sub-agent model selection rather than changing the main session model.
7. Watch scheduled tasks (they can run context at night, repeatedly)
- Scheduled tasks send the full context each time they fire—even if you’re idle.
- Cache expiration behavior:
- on subscription, cache lasts ~1 hour
- if tasks run less frequently than once per hour, they may miss cache and reprocess at full price
- Result: cost can multiply 10× (speaker’s claim) “forever” at the task interval.
- Practical mitigation:
- adjust frequency (sometimes running more often within cache windows is cheaper)
- audit what runs around ~3:00 AM
What “does NOT work” (common misinformation corrected)
- Shorter prompts: not the main lever
- speaker claims typed prompt content was ~0.01% of bill.
- Compacting/summarizing to save tokens: can be backwards
- summarization still requires sending full conversation and can wipe cache
- if you only need to undo a few turns, use
/rewindinstead (rewind to cached points).
- Screenshots: images aren’t cheaper than text
- examples cited: ~2,700 tokens for an Opus 5 screenshot; ~5,000 for 4K.
- PDFs: each page costs thousands of tokens for text plus another cost for the image
- suggestion: convert PDFs to plain text first (speaker claims ~¼ the cost).
Tools/commands the speaker recommends (implementation checklist)
/context: shows what’s currently in the window line-by-line to identify token hogs/usage: shows plan usage and attributes cost to specific skills/tools/agents, including breakdown of rereading vs new work/cost(inside the usage area): cost for the current session, including rereading vs new work- A burn rate meter in the Claude Code UI to make token consumption visible during work
- Mentions saved session logs under a folder; replies record what it costs, enabling calculation of personal token breakdown percentages
Speaker and sources
- Main speaker/source: the video creator (unnamed), quoting Anthropic behavior and guidance.
- External source referenced: Anthropic documentation, including:
- statements about
/clear(fresh start vs continuity), - cache/model-switch behavior,
- claims about background usage and Cloud Code upgrade/resume being among the most expensive requests,
- multi-agent/sub-agent token overhead guidance (multi-agent research post).
- statements about