← burnd — Claude Code cost control

Why Claude Code Sessions Get Expensive (And How to Find the Leaks)

By Garvit Surana · April 2026 · 8 min read

I spent $14,502 on Claude Code in a single month before I finally sat down and figured out where it was all going. I'm 16. That's real money. And the worst part? Most of it was avoidable.

After parsing thousands of my own session JSONL files, I found 8 recurring patterns that explain almost all runaway Claude Code bills. None of them are obvious. None of them show up in the Anthropic dashboard. And most of them can be fixed in under 15 minutes once you know they exist.

This is what I found.

TL;DR: Run npx getburnd to scan your own sessions. It's free, open-source, reads local files only, and shows you exactly which of these 8 patterns are costing you money — with dollar values.

How Claude Code billing actually works

Claude Code bills per token — input tokens and output tokens — using the pricing of whatever model you're running (Sonnet, Opus, Haiku). Every message you send, every file Claude reads, every tool result that comes back, every line of code in the response: all tokens.

The key thing most people miss: context is re-sent on every turn. If you have a 50,000-token conversation context and ask one follow-up question, that's 50,000 input tokens just to give Claude the context for a 20-word answer.

This is why long sessions get expensive fast. And it's why anything that inflates the context window — bash output, repeated file reads, error storms — has a compounding effect on your bill.

Claude does have a prompt cache that can dramatically reduce input costs when the same prefix is reused. But the cache only persists for a few minutes, and several common patterns bust it entirely — including one that surprises almost everyone.

The 8 patterns that drain your budget

How to find which ones are affecting you

Claude Code stores every session as a JSONL file at ~/.claude/projects/*/. Each file is a complete record of every message, every tool call, every input and output token count. The data is all there — it's just not surfaced anywhere.

I built Burnd to parse these files and run all 8 detectors automatically. It takes about 30 seconds, runs entirely on your machine, and produces a ranked list of which leaks are costing you money with exact dollar estimates.

$ npx getburnd

  burnd — find what's burning a hole in your AI coding budget
  ─────────────────────────────────────────────────────────────

  Scanned: 227 session files across 227 sessions
  30-day spend:      $14,502.00
  Last 7 days:       $843.27
  Potential savings: $75.92  ← plug these leaks

  Top leaks (sorted by estimated savings):

  1. Project "ChangeLife" costs 3.2x more per session
     $30.48  (~15 min to fix)

  2. Bash accounts for 80% of tool calls
     $7.76   (~8 min to fix)

  3. Tool error storm — 30% of calls failed
     $3.95   (~10 min to fix)

Every leak comes with a dollar estimate and a concrete fix step. The CLAUDE.md patches can be applied in one click if you run npx getburnd serve and use the local dashboard.

The quick wins (fix these first)

If you want to reduce your Claude Code bill this week without installing anything, start with these:

Add this to your CLAUDE.md:

# Cost control
- Pipe noisy commands: use `npm test 2>&1 | tail -50` not bare `npm test`
- Never re-read a file you've already read in this session
- Use Read tool for files, Grep for search — not `cat` and `grep` via Bash
- If a command fails twice, stop and tell me — don't retry indefinitely
- Keep model consistent for the whole session (don't switch mid-task)

These five rules, added to your CLAUDE.md right now, will likely reduce your per-session cost by 20–40% on the next session.

Find your specific leaks in 30 seconds
$ npx getburnd

Free · open source · reads local files only · no signup · no cloud

getburnd.vercel.app  ·  GitHub (MIT)

Why I built this

I'm Garvit Surana. I'm 16, in Class 12 in Guwahati, India. I've been using Claude Code since it launched and I spent $14,502 on it before I had any real visibility into what was happening. The cost showed up in my billing dashboard as a big number with no breakdown.

None of these 8 patterns are documented anywhere. I found them by parsing thousands of JSONL files, looking for correlations between session structure and cost. The model-switching cache invalidation in particular took me a while to confirm — it's not mentioned in Anthropic's documentation but it's real and expensive.

Burnd is the tool I wish had existed when I started. It's free, it runs locally, and it shows you your actual numbers not estimates.