A developer cut their Claude Code daily spend from $37 to $13 by fixing seven specific token-waste patterns in coding agents.
Adapted from @sairahul1# Never Hit Your Claude Usage Limits Ever Again I was spending $37 a day running Claude Code. That is over $1,000 per month. I thought I was paying for intelligence. I was paying for noise. Here are the 7 reasons most coding agents burn 2–3x more tokens than they should and what I changed to drop my spend from $37 to $13 a day (or somedays even more) without touching output quality. Save this. Every one of these is costing you money right now. ## 1. The agent reads the whole codebase to find one file You say: "fix the auth bug." The agent doesn't know where the auth module lives. So it reads everything. → Opens the full payments module → Reads adjacent files to understand patterns → Re-reads the same files when context drifts → Finally finds the right file → Makes the edit By then it has consumed 40,000 tokens for a 300-token change. The fix: give the agent structured context instead of making it search through the codebase blindly. Local tools like semble can reduce waste with vector-based semantic search. But for deeper code understanding, Sonar Vortex goes further: it uses AST-based static analysis and graph navigation to map actual code relationships like call stacks and class hierarchies. (https://www.sonarsource.com/products/sonar-vortex/) Instead of just finding text that looks relevant, the agent gets architectural context about how the code actually connects. ## 2. Opus fires on tasks Haiku handles in 200ms Most coding agents default to the most capable model for everything. That means your best and most expensive model is answering questions like "what does this function do." Model cost tiers are real and large: → Haiku: locate code, grep, understand a function, diff review → Sonnet: default for everything iterative and conversational → Opus: architecture decisions and multi-module refactor strategy only Running Opus on a "what does this variable do" question is like paying a senior architect $500/hour to tell you where the bathroom is. The fix: hard routing rules in your CLAUDE.md that force model selection before the agent decides on its own. (http://claude.md/) This change alone accounts for 40%+ of cost reduction when you implement it. ## 3. CLI output floods context with noise nobody asked for Run `npm install` and the agent reads every line. Run `git status` and it processes the full diff. Run `kubectl describe pod` and 3,000 lines of YAML enter your context window. None of that is what you needed. The agent processes it all anyway because it arrives in context before the agent can decide to ignore it. The fix: a pre-tool hook that blocks known verbose commands before they flood context. Saves 60–90% on bash output. Zero behavior change. The agent just stops reading walls of text it never needed. ## 4. Every new session starts from zero You finished a feature last Tuesday. Today you open a new Claude Code session to continue it. The agent has no idea what happened last Tuesday. You spend the first 5–10 minutes re-explaining: → What you were building → What you already tried → What failed and why → What the current state is That re-explanation is not free. It is thousands of tokens of context that should already exist. The fix: cross-session semantic memory that mines your past conversations and project history. No more re-explaining what you built last week. The agent picks up with actual continuity instead of amnesia. ## 5. Fetching a URL dumps raw HTML into your context You ask the agent to check a GitHub issue. It fetches the URL. 60KB of raw HTML enters your context window. Navigation. Headers. Footers. Sidebar. Cookie banners. The actual issue content is buried somewhere inside. The agent processes all of it. Your bill reflects all of it. The fix: compress external content before it enters context. Context-mode compresses URLs and docs by 94–100% before they enter your window. A 60KB GitHub issue becomes the 400 tokens that actually matter. ## 6. The agent re-reads the same file three times per session You ask about file A. Agent reads file A. Later you ask something related. Agent reads file A again. Then again. Each read is full tokens. No caching. No "I already read this." The fix: a hard rule in CLAUDE.md. (http://claude.md/) One line. Eliminates a silent tax you are paying on every multi-step session. ## 7. The agent's own output is longer than it needs to be This one surprised me most. The agent generates long, verbose responses by default. Detailed explanations of every step. Full code with extensive inline comments. Long preambles before getting to the answer. Output tokens cost money too. Caveman Mode compresses Claude's own output — shorter, denser, same information — cutting output token spend by around 65%. Valid modes: `off`, `lite`, `full`, `ultra` You get the same answer. Significantly fewer output tokens. ## Numbers after fixing all 7 Before: $37/day — 92% Opus, no routing, no compression, no memory After: $13/day — 5% Opus, 95% Sonnet, all 7 layers running 65% cost reduction. Zero drop in output quality. The three biggest individual wins in order: → Model routing rules — 40%+ of total reduction alone → Structured code navigation — less blind searching and fewer unnecessary file reads → CLI noise filtering — zero behavior change, immediate savings You do not need all 7 at once. If you only do one thing: add model routing rules to your CLAUDE.md and give your agent structured code context before it starts searching. (http://claude.md/) That alone cuts a significant chunk of your spend with no other changes. The pattern behind all 7 Every one of these is the same problem in a different disguise. The agent doesn't know what it needs. So it reads everything, processes everything, generates everything at full length — and bills you for all of it. The fix is always the same: give it better context before it writes, not after. Better context before → fewer tokens finding what it needs. Verification in the loop → fewer mistakes to fix. Less rework → agent runs more efficiently every session. This is what I've been thinking about since I started running agents at scale how the gap between "what the agent knows before it starts" and "what it has to figure out mid-session" is where almost all the waste lives. Sonar has been working on exactly this problem with Sonar Vortex, injecting precise architectural context before the agent writes, then verifying output in real time inside the coding loop. Worth reading if you're serious about making agentic development economical at scale: https://fandf.co/4hKO1Fe (https://www.sonarsource.com/) ## Want to cut even further? 10 GitHub repos that go even deeper: → RTK — CLI proxy that filters terminal output before it hits context. 60–90% reduction on common dev commands. github.com/rtk-ai/rtk → Context Mode — sandboxes raw tool output into SQLite instead of dumping it in context. 98% reduction on Playwright, GitHub, logs. github.com/mksglu/context-mode → code-review-graph — local knowledge graph of your codebase using Tree-sitter. 49x reduction on large monorepos. github.com/tirth8205/code-review-graph → Token Savior — MCP server that navigates code by symbols, not full files. 97% reduction on code navigation. github.com/Mibayy/token-savior → Caveman Claude — makes Claude talk like a caveman to cut output tokens. 65–75% output reduction, full accuracy. github.com/JuliusBrussee/caveman → claude-token-efficient — one CLAUDE.md file that keeps responses terse. Drop-in, no code changes. github.com/drona23/claude-token-efficient (http://claude.md/) → token-optimizer-mcp — MCP server with caching, compression, and smart tool intelligence. 95%+ reduction through intelligent caching. github.com/ooples/token-optimizer-mcp → claude-token-optimizer — reusable setup prompts for any project. Reduces doc token usage from 11K to 1.3K. github.com/nadimtuhin/claude-token-optimizer → token-optimizer — finds ghost tokens silently eating your context. Survives compaction without quality loss. github.com/alexgreensh/token-optimizer → claude-context (Zilliz) — code search MCP using hybrid BM25 + dense vector search. ~40% reduction with equivalent retrieval quality. github.com/zilliztech/claude-context How to pick: → Heavy terminal output? RTK → Big codebase? code-review-graph + Token Savior → Lots of MCP servers? Context Mode → Quick win? Caveman + claude-token-efficient Run `/context` in a fresh session and see how much is gone before you even type a word. If this was useful: → Repost to share it with every developer running Claude Code → Follow @sairahul1 for more systems like this → Bookmark this — the 7 fixes all work independently, start with #1 and #2 Sponsored by Sonar. (https://www.sonarsource.com/)