Source: 18 Claude Code Token Hacks In 18 Minutes (YouTube, https://youtu.be/O2k_qwZA8HU)

A field-collected playlist of 18 token-management techniques for Claude Code users who keep hitting their session caps — even on the $200 Max plan. The framing is mechanical: every message in a session re-reads the entire conversation, the CLAUDE.md, MCP definitions, system prompt, and skills, so cost compounds rather than adds. One developer cited in the source tracked a 100+ message chat where 98.5% of tokens were spent re-reading prior history. The hacks are organized into three tiers — easy habits first, then surgical context discipline, then model and time-of-day strategy.

The 18 Techniques

Tier 1 — Habits (9)

  1. Start fresh conversations with /clear. Every message in a long chat is exponentially more expensive than the same message in a fresh chat. Don’t carry context about topic A into a conversation about topic B.
  2. Disconnect unused MCP servers. Each connected MCP server loads its full tool definitions into context on every message — a single server can be ~18,000 tokens per turn. Run /mcp at session start, drop the ones you don’t need, and prefer CLIs over MCP wrappers when both exist (e.g., Google Workspace CLI vs the MCP).
  3. Batch prompts into one message. Three separate messages cost roughly 3× a combined message because of history re-reads. If Claude gets something slightly wrong, edit the original message and regenerate rather than sending a follow-up correction — edits replace the bad exchange, follow-ups stack permanently.
  4. Use plan mode before any real task. Plan mode forces Claude to map the approach and ask clarifying questions, preventing the single biggest token sink: going down the wrong path and scrapping the work. Add to CLAUDE.md: “Do not make changes until you have 95% confidence. Ask follow-up questions until you reach that level.”
  5. Run /context and /cost. /context shows exactly what’s eating tokens right now — conversation history, MCP overhead, loaded files. /cost shows actual token usage and estimated spend for the session. Even a fresh session can already be ~51K tokens deep from system prompt, tools, custom agents, skills, and memory files.
  6. Set up a status line. Run /status line in the terminal and ask Claude to wire up a display showing model, a visual usage bar, and tokens / 1M context window. Visibility prevents surprise cap-outs.
  7. Keep your Claude usage dashboard open. Same idea — peek every 20–40 minutes, or wire an automation to ping you at 30-minute intervals when usage is climbing.
  8. Be surgical about pasting. Before dropping a document, ask whether Claude needs the whole thing. If the bug is in one function, paste that function. Precision in is precision out.
  9. Watch Claude work. Don’t fire-and-forget. In a bad loop, ~80% of tokens produce zero value — re-reading the same files, repeating mistakes. Stop the run the moment it goes off course.

Tier 2 — Context discipline (5)

  1. Keep CLAUDE.md lean. Project root, under 200 lines. Tech stack, conventions, build commands, the 95% confidence rule. Treat it as an index — point at where bigger context lives rather than embedding it. Every message in every chat re-reads this file, so 1,000 lines of it gets re-read every turn, even on a “hi.”
  2. Be surgical with file references. Don’t say “here’s the repo, find the bug.” Say “check verifyUser in auth.js or use @filename to point Claude at exactly the file you mean.
  3. Manually /compact at ~60% context. Auto-compact only fires near 95%, by which point output quality has already degraded. Compact early with explicit instructions on what to preserve. After 3–4 compacts the quality decays — at that point grab a session summary, /clear, paste the summary back, and continue.
  4. Mind the 5-minute prompt-cache window. Claude Code caches unchanged context to skip reprocessing, but the cache times out at 5 minutes. Stepping away and coming back triggers a full reprocess at full cost — the cause of the “random spike” people feel after a break. Run /compact or /clear before walking away.
  5. Watch command output bloat. Shell commands dump their full output into context — a git log returning 200 commits sends every line as tokens, and the UI hides this behind a one-liner. Deny noisy commands at the project permissions level when you know they aren’t needed.

Tier 3 — Model and time-of-day strategy (4 + bonus)

  1. Pick the right model. Sonnet for default coding, Haiku for sub-agents / formatting / simple tasks, Opus for deep architectural planning only when Sonnet wasn’t enough — keep Opus under ~20% of usage. For huge-codebase reviews, consider bringing in Codex via the official plugin so Claude tokens aren’t burned on review passes.
  2. Account for sub-agent cost. Agent workflows use ~7–10× more tokens than a single-agent session because each sub-agent wakes with its own full context and reloads system tools and files. Use them deliberately — pair one-off delegation with Haiku so 80% of your tokens are on the cheap model. Multi-agent teams produce nicer output but burn fast; reserve them for high-value runs.
  3. Respect peak vs off-peak hours. Anthropic drains the 5-hour session window faster during peak hours (8am–2pm Eastern, weekdays). Schedule big refactors, multi-agent runs, and long projects for afternoons, evenings, and weekends. Bonus 3.5: if you’re near a reset with budget left, go heavy and get your money’s worth; if you’re near the cap with hours to go, step away rather than burning the last 5%.
  4. Use CLAUDE.md as your system constitution. Store stable decisions, architecture rules, and progress summaries — “save decisions, not conversations.” Every architectural call captured there is a paragraph you never type again. The author also experiments with a self-evolving “Applied learning” section where Claude appends a one-line bullet (under 15 words, no explanations) when something fails repeatedly or a workaround is found — but this needs frequent pruning to stop bloat.

Recent Signals

[Reddit signal — r/ClaudeCode 2026-05-09]: r/ClaudeCode post 1t8461y (“Which token optimizer would you recommend?”, score 43) catalogs 12 token-optimizer projects competing for the same workload — rtk-ai/rtk (CLI proxy claiming 60-90%), JuliusBrussee/caveman (skill cutting 65% via verbose-output suppression), yamadashy/repomix (repo-as-single-file bundler), mksglu/context-mode (sandboxes tool output, 98% claim), DeusData/codebase-memory-mcp (155-language graph index, 99% claim), jgravelle/jcodemunch-mcp (tree-sitter AST), chopratejas/headroom, yvgude/lean-ctx (60-95% / up to 99% on cached reads), colbymchenry/codegraph (local pre-indexed knowledge graph), samuelfaj/distill (CLI-output distillation), manojmallick/sigmap (97% claim, 21 langs), mpecan/tokf (config-driven CLI compressor). The thread’s load-bearing insight: u/zoomaaron measured RTK at 3-5% saving in their actual workflow vs vendor-claimed 60-90% — always-measure-in-your-own-workflow is the rule, not the vendor headline. u/stellarton: “I would not stack all of these at first. You’ll save tokens and lose debuggability. Pick the one that matches the bottleneck you actually have.”

[Reddit signal — r/ClaudeCode 2026-05-09]: r/ClaudeCode post 1t7ycsv (link to dzarlax’s Substack post-mortem) reports a **0.37 per request from cache reads alone (~120-140/hr). Three load-bearing failure modes: (1) prompt caching is not free — 90% discount on 250k cached tokens still adds up over hundreds of requests (Opus reads 1M cached tokens at 0.37); (2) Anthropic’s web-console Hard Limit was bypassed — Anthropic support confirmed a bug where API billing limits were ignored for Claude Code requests on Claude for Work / Team subscriptions; (3) the wrapper hid the runaway — author was using AgentDeck (PTY-managed Claude Code) and the terminal could have been completely closed. Recovery: /logout revoked the API access token. Prevention recommendations: monitor /subagents for “silent” agents in the background; treat --auto mode on a massive monorepo as a budget hazard. Adds the cost-blast-radius failure mode to this article’s already-strong cost-discipline list — pairs with #9 (“Watch Claude work”) and #13 (“Mind the 5-minute prompt-cache window”).

[Reddit signal — r/ClaudeAI 2026-06-29]: r/ClaudeAI post 1uih6w7 (“How prompt caching works in Claude Code (and how to stop wasting tokens)”, u/jomi-se, score 63) is the **mechanics behind hack 13. Claude Code uses a prefix cache — each turn matches the start of the request (model + system prompt + project context + history) and only newly-appended tokens are fresh work. Pricing relative to base input: cache read0.1x, 5-minute cache write 1.25x, 1-hour cache write 2x. The default TTL depends on auth type: on a Pro/Max subscription the main conversation auto-uses the 1-hour TTL at no extra cost (it drops to 5-min only when you’re over the plan’s usage-credit limit); on enterprise per-token / API key / Bedrock / Vertex the default is 5-min; subagents are always 5-min. Override with ENABLE_PROMPT_CACHING_1H=1 or FORCE_PROMPT_CACHING_5M=1. A cache miss re-bills the entire context at the write rate — an all-misses 1h-TTL session can cost ~2x a no-cache baseline — so the exact corollary to hack #12 is: there is no cost benefit to /compact-ing a session that already fell out of cache (it costs more than just continuing). Changing model, effort level, plugins, or MCPs mid-session can invalidate the prefix. (Official docs: code.claude.com/docs/en/prompt-caching.)

[First-party verification — Claude Code session, 2026-07-04]: Hands-on test of an rtk promo kit found on a user’s Desktop confirms the skepticism in the 1t8461y signal above. The folder turned out to be a video-shoot staging kit, not the tool itself (rtk wasn’t installed) — DEMO-OUTLINE.md literally reads “Part 1 (the hook)… Part 2 (the title of the video)… Part 3 (the receipts).” Its fake test harness prints ~200 cases of manufactured “hydrating mocks” noise around one real failure — engineered to make errors-only filtering look dramatic: raw npm test = 612 lines / 36,675 chars (~9,200 tokens); the same output through a plain grep -E "FAIL|Error|Expected|Received" (no rtk needed) = 8 lines (~50 tokens), recovering the identical signal rtk claims credit for. Measured against a real project’s actual vitest suite (54 tests, all passing) instead of the staged demo: full raw output was already only 48 lines / 2,128 chars (~530 tokens) — negligible headroom for any errors-only filter to capture, since Claude Code already prefers Read/Grep/Glob over raw shell dumps and prompt caching discounts repeated context to ~0.1x. Two footguns in the kit itself: the “auto-hook” demo script opens with rm -rf CLAUDE.md .rtk (destructive if the pattern were copied into a real project), and routing file reads through rtk read would bypass Claude Code’s native Read-tool tracking (breaks read-before-edit safety, loses line numbers). Corroborates u/zoomaaron’s 3-5% figure above: the addressable waste is real but small, and mostly already handled by Claude Code’s native tool preferences plus caching — a dedicated filtering layer has little left to capture on a codebase with reasonably quiet tooling.

[Reddit signal — r/Anthropic 2026-07-05]: r/Anthropic post 1unqp2o (“Claude Code is quietly overpaying ~14% on subagent prompt cache — and it’s Anthropic’s to fix, not a setting you can change”, u/farono, score 19) parsed ~2 weeks of the OP’s own Claude Code transcripts (~95 sessions, ~1,800 subagents, 6.8B input tokens) and measured subagent prompt cost running ~14% too high, ~8% off total spend — the same context billed at cache-write rates instead of read rates. Two mechanisms beyond the 5-minute subagent TTL the 1uih6w7 signal above already documents: (1) cold-start reuse is blocked twice over — the shared ~30k-token static prefix (cold start ~37k tokens; only ~950, ~3%, is the actual task) expires at 5 minutes, and per-invocation dynamic content (date, cwd, git branch, injected reminders) sits early in the prompt, which invalidates the cache for everything after it, so the identical static block can never be shared across sibling subagents; (2) a parent’s own cache dies while it blocks on a child — the main loop gets a 1-hour cache but a parent that spawns a child and waits over 5 minutes finds its cache silently expired when the child returns, forcing a full-context re-write (96% of measured cache deaths clustered right past the 5-minute mark). Counterintuitive finding: the obvious fix — give subagents the 1-hour TTL too — makes total spend 8.6% worse, because 98% of cache reuse happens within ~34 seconds, so longer retention mostly just pays the higher write price for reuse that was never going to happen; splitting the cache by volatility is a wash (+1.3%). What actually works, using prompt caching’s current GA support for mixing 1h + 5m breakpoints in a single request: a 1h-TTL write immediately before dispatching a child (-6%), plus a 1h-TTL identical per-type static prefix with dynamic content moved after it so it’s shared instead of re-sent (-7.6%, cold start ~88% cheaper) — with the default 5m retained on the churning conversation tail, where 1h would be pure waste. Filed as anthropics/claude-code#74318 with a runnable ~150-line stdlib-only script that reads local ~/.claude/projects transcripts and prints both numbers — stronger verification than a typical Reddit claim. Caveat: one person’s heavy-subagent workflow (light subagent users won’t see much); the 5-minute subagent TTL is measured directly, but the fix percentages are modeled from usage logs, not Anthropic’s billing. Sharpens hack #16’s “account for sub-agent cost” advice above from a blunt 7-10x multiplier into a specific, fixable mechanism.

[Reddit signal — r/ClaudeHomies 2026-07-06]: r/ClaudeHomies post 1uomvuv (“My system for keeping context across long Claude projects”, u/Ssolgon, score 16, 11 comments) reframes months of drift issues as a systems problem rather than “the model forgetting stuff”: one master doc holding current status, reattached every session, plus a separate archive doc for anything not actively needed so the master stays light. The load-bearing addition beyond the master/archive split is a periodic drift-verification step — after big updates, ask Claude to summarize what changed, then manually double-check that summary against what actually happened. OP caught a real case where a detail got reworded slightly across a few edits until it silently stopped matching reality.^[inferred] This is a different failure than ordinary forgetting: it’s slow, in-document drift that doesn’t announce itself the way a dropped fact does, so it isn’t caught until someone goes looking for it.^[inferred] Sharpens hack #18’s “save decisions, not conversations” into a concrete two-document structure, and gives hack #12’s manual-/compact discipline a verification step it lacked — compacting preserves whatever you tell it to keep, but nothing previously checked that the kept text still matches ground truth.^[inferred] Caveat: single practitioner’s workflow (score 16, 11 comments), not independently benchmarked against a control.

[YouTube signal — 2026-07-20]: The video “Paste This Into Claude / Never Hit a Token Limit Again” (raw/Paste_This_Into_Claude_Never_Hit_a_Token_Limit_Again.md, creator unattributed) restates this article’s three-tier structure under different names (quick wins / system upgrades / “nuclear” enhancements) around one clean framing: compute budget used = tokens consumed × model used — every fix optimizes one variable. Nothing in Tiers 1–2 is new vs the hacks above (/usage + /context audit, /clear, /compact at ~60%, trim MCPs/skills, sub-200-line CLAUDE.md, “be concise” / Caveman, minimum-viable-model per skill, script-driven skills). Credulity flag: it presents RTK at a headline 60–90% (creator claims 92% across 13 commands) — exactly the vendor number the first-party test above measured at ~3–5%, so treat it as another instance of the “always measure in your own workflow” rule, not corroboration. Two mildly-additive data points: (1) it frames Codex routing as harness-layer efficiency (~4× fewer tokens on some execution tasks^[inferred — creator’s claim]; see Codex Inside Claude Code); (2) beyond local models, it floats swapping Claude Code’s engine to Z.ai’s GLM or a DeepSeek subscription plan (not just API) via env vars for more compute-per-dollar, with the usual weaker-model / data-privacy trade-offs (cousin of Ollama + Claude Code). Its “images instead of text” tip is the already-articled pxpipe arbitrage.

[YouTube signal — 2026-07-29]: A different video with the same title as the 2026-07-20 signal above (video ID Y8vAQ1FgNbM; raw/Paste_This_Into_Claude_Never_Hit_a_Token_Limit_Again_Y8vAQ1FgNbM.md, Nate B Jones) adds a first-party measurement that corroborates this article’s core framing: 3.77B tokens through his Codex workspace in one day, of which 3.59B (~96%) was reused input across 143 threads — the same order as the 98.5% history-re-read figure in the intro, now measured rather than anecdotal. Additive points: (1) output tokens cost roughly twice what the input side does in his accounting, so verbosity control is a spend lever, not just a context one; (2) a concrete ~55,000-token tool-definition burn just from connecting GitHub + Slack + Sentry + Grafana — hack #2’s per-server estimate, summed; (3) a clean API-level comparison of OpenAI-style compaction vs Anthropic context editing (the latter clears old tool results and thinking blocks rather than summarizing) — the mechanism behind hack #12. Own-product flag: the video’s recommended fixes are his Token Saver skill and Ringer proxy — apply the same measure-in-your-own-workflow rule the RTK signals above established before adopting either.

Try It

Start with these four:

  • Run /context on your next session and screenshot the breakdown. Most users have no idea where their tokens go before they look.
  • Disconnect every MCP server you didn’t use today, then start the session.
  • Add the 95%-confidence rule to your CLAUDE.md.
  • Set a manual /compact reminder at 60% — don’t wait for auto-compact at 95%.