1---2name: cache-money3description: Use when a Claude Code session is burning through tokens fast, hitting usage limits, degrading in quality after a long conversation, or someone wants to cut context/token spend. Covers session hygiene (/clear, /compact, /context, /cost, /mcp, /statusline), CLAUDE.md and file-reference discipline, model selection (Sonnet/Haiku/Opus), subagent cost, prompt-cache timing, and peak-hour scheduling — specific to Claude Code.4---56# Cache Money78Practices that keep Claude Code sessions cheap and sharp by controlling what gets re-sent every turn — because bloated context doesn't just cost more, it produces worse output.910## When to Use1112- A session feels slow, expensive, or is close to a usage limit13- Someone asks how to reduce token/context spend, extend session life, or "why did my usage spike"14- Reviewing or writing a project's `CLAUDE.md`, MCP server setup, or subagent workflow15- Starting a long or multi-part task and deciding how to structure it16- Or just run `/cache-money` directly — once installed, this skill is a manual command too, no need to wait for Claude to decide it's relevant1718## How Tokens Actually Work1920- A token ≈ one word. Every message re-sends the **entire conversation from the beginning** — message 1, its reply, message 2, its reply... every single time. Cost compounds, it doesn't add: message 1 might cost 500 tokens, message 30 can cost 15,000+ because it re-reads everything before it. In one tracked 100+ message session, 98.5% of tokens went to re-reading old history — only 1.5% was new output.21- On top of message history, Claude Code reloads `CLAUDE.md`, every connected MCP server's tool definitions, system prompts, and referenced files on **every turn**. This overhead is invisible but constant.22- Bloated context also degrades quality, not just cost: "lost in the middle" research shows models pay less attention to content buried in long contexts. Keeping context tight is a quality move, not just a cost move.2324## Tier 1 — Do These Every Session2526| Hack | Do this |27|---|---|28| Start fresh conversations | Run `/clear` between unrelated tasks. Never carry topic-A context into a topic-B conversation — every message in a long chat costs exponentially more than the same message in a fresh one. This single habit extends session life more than anything else. |29| Disconnect unused MCP servers | Run `/mcp` at the start of each session and disconnect anything you won't use. Tool definitions are deferred by default (Tool Search), so an idle server only costs a name-listing entry — but the moment Claude actually uses one of its tools, that server's full definitions land in context for the rest of the session. Prefer a CLI over an MCP server when both exist — a CLI tool adds no listing overhead at all. |30| Batch prompts into one message | Three separate messages cost ~3x one combined message. Send "summarize, extract issues, suggest a fix" as one prompt, not three. If Claude gets something slightly wrong, edit your original message and regenerate — a follow-up correction stacks onto history permanently, an edit replaces the bad exchange entirely. |31| Use Plan Mode before real tasks | Let Claude map its approach and get your approval before writing a line. This prevents the single biggest source of waste: going down the wrong path, writing code, then undoing and redoing it. Consider adding to `CLAUDE.md`: "Do not make changes until you have 95% confidence in what you need to build. Ask follow-up questions until you reach that confidence." |32| Run `/context` and `/cost` | `/context` shows exactly what's eating tokens right now (history, MCP overhead, loaded files). `/cost` shows actual usage and spend for the session. Most people have no idea where their tokens go — you can't fix what you can't see. |33| Set up a status line | `/statusline` keeps model, context %, and token count visible in the terminal at all times, so you don't burn through everything and hit a wall without noticing. |34| Keep the usage dashboard open | Track current-session and weekly limits plus reset times so you know your real budget, not a guess. |35| Be smart with pasting | Before dropping a document, file, or error log into chat, ask: does Claude need the whole thing, or one section? Bug in one function → paste that function. Error in the last 10 log lines → paste those 10 lines. |36| Watch Claude work | Don't fire a prompt and walk away, especially on longer tasks. If it's stuck re-reading the same files, retrying the same approach, or exploring a dead end, hit Escape early. In a bad loop, 80%+ of tokens burned produce zero value — a few seconds of attention saves thousands of tokens. |3738## Tier 2 — Project-Level Hygiene3940| Hack | Do this |41|---|---|42| Keep `CLAUDE.md` lean | It auto-loads on every single turn, so a bloated file defeats its own purpose. Target under ~200 lines: tech stack, coding conventions, build commands, confidence rules — not your project's full history or docs Claude can read from source when needed. Treat it as an index that routes to where more detail lives, not an archive. |43| Be surgical with file references | Don't: "here's my whole repo, find the bug." Do: "check the `verifyUser` function inside `auth.js`." Use `@filename` to point at specific files instead of letting Claude explore freely. |44| Compact at ~60% capacity | Auto-compact triggers at ~95%, by which point context is already degraded. Check capacity with `/context`; at ~60%, run `/compact` with specific instructions on what to preserve. After 3–4 compacts in a row, quality starts to degrade further — at that point, have Claude write a session summary and `/clear` instead. |45| Move auto-compact earlier instead of watching manually | The ~95% default is a setting, not a fixed rule. `/autocompact 500k` (or `/autocompact auto` to reset) sets the auto-compact window directly — Claude Code v2.1.221+. `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50` triggers compaction at a lower percentage of that window without needing to watch `/context` yourself. `CLAUDE_CODE_AUTO_COMPACT_WINDOW` sets the raw token window instead of a percentage. |46| Give compaction default instructions | Add a `# Compact instructions` section to the project's root `CLAUDE.md` (e.g., "preserve open task state, key file paths, and recent decisions; drop resolved tool output") so it applies automatically to every compaction — manual `/compact` or the automatic one — not just the one time you remember to type `/compact <instructions>`. |47| Mind the 5-minute cache timeout | Claude Code uses prompt caching to avoid re-processing unchanged context, but the cache expires after 5 minutes idle. Stepping away longer than that means your next message reprocesses everything from scratch at full cost — this is why usage can seem to spike "randomly" after a pause. Run `/compact` or `/clear` before a longer break. |48| Watch command-output bloat | When Claude runs shell commands, the full output enters context and gets re-sent every turn after — a 200-commit `git log`, a verbose test suite, a noisy build log, all of it. It scrolls by and feels free; it isn't. Pipe long output through `head`/`tail`, or ask Claude to limit output before running a command. |4950## Tier 3 — Advanced Cost Control5152| Hack | Do this |53|---|---|54| Pick the right model | Sonnet is the default for most coding work. Haiku for subagents, formatting, and simple tasks (~3x cheaper than Sonnet). Opus only for deep architectural planning, when Sonnet genuinely wasn't enough — keep it under ~20% of total usage. |55| Know the cost of subagents | Agent workflows run roughly 7–10x more tokens than a single-agent session, because each subagent runs its own full context window as a separate Claude instance. Delegate one-off tasks that can use Haiku; agent *teams* are very expensive — reserve them deliberately. |56| Understand peak hours | Anthropic adjusts how fast a 5-hour session window drains based on demand. Peak (drains faster): 8 AM–2 PM ET on weekdays. Off-peak (lasts longer): afternoons, evenings, weekends. Run big refactors, multi-agent sessions, and codebase rewrites off-peak. |57| Play the clock | Near a reset with budget left over: go heavy, run the big refactor, get your money's worth before it resets anyway. Near your limit with only 30–45 minutes to reset: step away instead of burning the last 5% on something small and getting stuck mid-task. |58| Make `CLAUDE.md` your system's constitution | Store stable decisions, architecture rules, and applied learnings there — not conversations. Every architectural call saved is a paragraph never retyped. Add explicit context-routing rules directly, e.g. "use subagents for any exploration or research; if a task needs 3+ files or multi-file analysis, spawn a subagent and return only summarized insights." When something fails repeatedly or a workaround is found for a platform/tool limitation, add a one-line bullet under an "Applied Learning" section — under 15 words, no explanation, only things that save time in future sessions. |5960## Quick Reference — Action Checklist6162- [ ] Run `/context` and `/cost`63- [ ] Status line showing model, context %, and token count64- [ ] Usage dashboard open (remaining allocation + reset time)65- [ ] Disconnect unused MCP servers via `/mcp`66- [ ] Start complex tasks in Plan Mode before writing code67- [ ] `/clear` when switching to an unrelated task68- [ ] Manually `/compact` at ~60% context capacity69- [ ] `CLAUDE.md` has a `# Compact instructions` section70- [ ] Batch multi-step instructions into single messages71- [ ] Schedule heavy sessions for off-peak hours7273## Common Mistakes7475| Mistake | Why it hurts |76|---|---|77| Treating pasted logs/docs or command output as "free" because it scrolls by | It's re-sent in full on every subsequent turn — one paste can cost more than the rest of the session |78| Relying on auto-compact | It triggers at ~95% capacity, after quality has already degraded from a bloated context |79| Sending follow-up corrections instead of editing | Follow-ups stack onto history permanently; an edited-and-regenerated message replaces the bad exchange entirely |80| Spinning up subagents or agent teams for trivial one-off work | Each subagent is a full separate context window — 7–10x the token cost of doing it directly |81| Leaving MCP servers connected "just in case" | Tool Search defers definitions until first use, but once Claude touches one tool on a server, that server's full definitions stay in context for the rest of the session — an idle server you never end up using is the only truly free case |8283## Bottom Line8485Most sessions don't need a bigger plan — they need to stop re-sending the entire conversation history 30 times when 5 would do. It's not a limits problem, it's a context-hygiene problem. The Tier 1 habits alone typically make a subscription feel like it doubled.