writingmaclulich.com

Spotify’s 90% Claude Code saving: how to check what it would save you

Check a Claude Code saving against your own bill, then cut the part that matters

  1. Check what share of your bill a saving coversA 90% cut applied to reads that were 0.9% of my spend, so it could save me 0.8%, before paying for the cheaper model
  2. Ask what a headline percentage was measured onSpotify’s 90% was the average of three file reads in one product manager’s testing, not a whole session
  3. Count the big reads in your own transcriptsMine had 644 in four weeks, averaging 12 cents each. The script at the end finds yours
  4. Brief your agents and budget their callsBig reads hit 2.1% of my spend in the one week my agents ran without briefs or a budget, and 0.4% on average in the three weeks after
  5. Shrink what your agents carry, not what they readCache reads were 53% of my spend, and the average call carried 179,000 tokens
From four weeks of my own Claude Code transcripts on two projects, 5 October to 1 November 2026, set against Spotify’s published figure.

Check what share of your bill it covers

If you run Claude Code and have seen Spotify’s 90% saving going round LinkedIn, this is for you. I run it all day, so I went through four weeks of my own transcripts to see what it would do for me, and it would save me less than 1%.

Spotify’s engineering blog has a post called “Portal by Spotify cut my Claude Code token usage by 90%”, and it’s been going round LinkedIn as Spotify cutting its Claude Code bill by 90%.

The 90% is real, but it applies to something that makes up 0.9% of my spend, and that second number is the one worth checking before you install anything.

Spotify’s 90% saving comes to under 1% of my Claude Code spend

90%
fewer tokens on a big file read, in Spotify’s benchmark
0.9%
of my spend goes on the reads it would catch
0.8%
is what it could save me, before paying for the cheaper model
Four weeks of Claude Code on two projects, 5 October to 1 November, at list API prices.

So before you install a saving, find the share of your own spend it applies to. The script near the end of this page does that for Claude Code.

Ask what the headline percentage measured

The plugin is called shunt, and the idea is a good one. A hook stops Claude reading a whole file over 350 lines.

A cheaper model (Gemini 2.5 Flash in the post) reads the file instead and sends back a short answer, so the file never enters Claude’s context.

Shunt swaps a big file read for a short answer from a cheaper model

  1. Claude asksIt tries to read a whole file over 350 lines
  2. The hook blocks itIt points Claude at the bulk reader
  3. A cheaper model readsThe file goes to the worker instead
  4. Claude gets the answerA short summary, not the file

To be fair to Spotify, the post doesn’t say the company’s bill fell by 90%. It’s one product manager, Dimitri Mazmanov, writing up his own testing on a 162,000-line Java monorepo, and the title says “my”.

He’s upfront about the limits as well. The cheaper model “missed a subtle thread-safety bug”, so debugging, architecture and safety-critical code stay with Claude.

Where I’d push back is the headline. The 90% is “mean bulk-read savings”, the average of three file-reading tests, and “token usage” is a much bigger claim than that.

The 90% is the average of three file reads, not a session

One large file, 4,014 lines82% fewer33,684 → 5,737 tokens
Source and test pair, 7,408 lines94% fewer75,990 → 4,148 tokens
Several services, 1,281 lines94% fewer16,221 → 821 tokens
From shunt’s README. The post gives no whole-session total, no token count for the cheaper model and no dollar figure for the saving.

So I ask two things of any percentage: what it was measured on, and whether it comes with a whole-session or dollar figure. This one came with neither.

Count the big reads in your own transcripts

I replayed four weeks of my own transcripts to see what the hook would have caught, charging each big read for every call that carried it.

Whole-file reads over 350 lines were 0.8% of four weeks of spend

Whole-file reads over 350 lines0.8%
If the limit were 200 lines1.2%
If the limit were 100 lines1.7%
All tool output24%
The dollars behind these shares are list API prices, a yardstick rather than an invoice. Shunt also blocks cat on big files, which adds 0.1%. Tool output means every read, search, test run and shell command.

Those 644 reads averaged 12 cents each. At 90% off, each would save about 11 cents, in exchange for a call Spotify says typically takes 10 to 30 seconds.

Tool output as a whole is nearly a quarter of the bill, but 62% of my Read calls already ask for a line range, which the hook lets through by design.

More than half of the big reads, 365 of the 644, were test files and diffs, which is the code you read to check the work. A size limit can’t tell those from a generated file, and a summary is a poor thing to review from.

Brief your agents and budget their calls

I went in expecting to put the low 0.8% down to how I run my agents, and the data only half agrees.

One agent plans and reviews while others do the work, so the planner barely opens files: 17 big reads in 72,638 calls.

The rest comes from a few habits I’ve built up over the last few months.

Four habits keep big reads out of the expensive context

  1. A planner that doesn’t readIt hands out work and reads the conclusions
  2. Exact briefsEach worker is told which files and line ranges it needs
  3. A call budgetA hook stops a worker after 40 calls
  4. Filtered shell outputA hook trims command output before the agent sees it

The best evidence for them is one bad week, when a fleet of agents ran with no briefs and no budget and big reads hit 2.1% of spend.

Big reads hit 2.1% of spend in the one week my agents ran without briefs

Week of 5 October2.1%
Week of 12 October0.3%
Week of 19 October0.5%
Week of 26 October0.3%
My ordinary sessions, same four weeks0.7%
The three weeks after averaged 0.4%. The thinner weeks I still have from before 5 October came in at 0.3% and 0.6%, so that week was a spike rather than a baseline.

My ordinary sessions spoil the story a bit: with no planner, no briefs and no budget, big reads came to 0.7% over the same four weeks.

So the setup helps, I’d guess by about half, though that’s comparing different work.

The part I’d copy either way is the hook. Spotify found what I found, that rules in CLAUDE.md are “advisory, not enforced”, and a hook is what makes the rule stick.

Shrink what agents carry, not what they read

The plainer reason shunt wouldn’t save me much is that whole reads of big files were never much of my bill. Just over half of my spend is cache reads, which is the cost of sending everything an agent is carrying on every call.

The average call carried 179,000 tokens, so the size of that load matters far more than any one file in it.

Four fifths of the spend is context going in and being carried

Cache reads53%
Cache writes28%
Output18%
The same four weeks. Uncached input rounds to zero.

That’s why my effort has gone into what agents carry rather than what they read.

Replacing compaction with a fresh start has cut one agent’s restart from about 145,000 tokens to 78,000, and its cost per call by about 9% so far, though that test isn’t finished.

How far to trust it

My 0.9% could be nothing like yours, and it leaves some spend out

  1. Your repo may be differentIn a repo full of 4,000-line files that Claude opens whole, shunt could earn its keep quickly, and that’s the kind of repo it was tested on
  2. Claude Code onlyThe Codex agents I also run aren’t in these numbers, and neither are a few background calls that never reach a transcript, which would push the share lower
  3. List prices, not an invoiceThe dollars are a yardstick, from two projects over four weeks
  4. My setup’s effect is a guessI’d guess it helps by about half, though that compares different work
  5. The compaction test isn’t finishedThe 9% lower cost per call is for one agent, so far

Copy this script to check yours

Shunt does need a Portal instance with AiKA enabled, so most people would be copying the idea rather than installing the plugin. Measure first either way.

This script reads your local transcripts, sends nothing anywhere and prints the share.

It’s rougher than my full analysis and reads a little high: 1.2% to 1.5% on my machines, against 0.8% to 0.95% with proper pricing.

#!/usr/bin/env python3
"""How much of your Claude Code context came from whole-file reads over 350 lines?"""
import glob, json, os

LIMIT, CHARS_PER_TOKEN = 350, 2.3
USAGE = "input_tokens", "cache_read_input_tokens", "cache_creation_input_tokens"
home = os.path.expanduser("~/.claude/projects")
sent = big = reads = 0


def settle(found, calls):
    """A read is sent again on every call until its context ends."""
    global big, reads
    big += sum(tokens * (calls - at) for at, tokens in found)
    reads += len(found)


for path in glob.glob(f"{home}/*/*.jsonl") + glob.glob(f"{home}/*/*/subagents/*.jsonl"):
    calls, found, wanted, seen = 0, [], {}, set()
    for line in open(path, errors="replace"):
        try:
            record = json.loads(line)
        except ValueError:
            continue
        if record.get("subtype") == "compact_boundary":
            settle(found, calls)
            calls, found = 0, []
        message = record.get("message") or {}
        blocks = message.get("content")
        for block in blocks if isinstance(blocks, list) else []:
            if block.get("type") == "tool_use" and block.get("name") == "Read":
                wanted[block["id"]] = block.get("input") or {}
            if block.get("type") == "tool_result" and block.get("tool_use_id") in wanted:
                asked = wanted[block["tool_use_id"]]
                text = json.dumps(block.get("content"))
                whole = not (asked.get("offset") or asked.get("limit"))
                if whole and text.count("\\n") > LIMIT:
                    found.append((calls, len(text) / CHARS_PER_TOKEN))
        usage = message.get("usage")
        if usage and message.get("id") not in seen:
            seen.add(message.get("id"))
            calls += 1
            sent += sum(usage.get(key, 0) for key in USAGE)
    settle(found, calls)

print(f"{reads} whole-file reads over {LIMIT} lines")
print(f"{100 * big / max(sent, 1):.2f}% of the tokens you sent were those reads")

If that prints under a couple of percent, I’d leave your setup alone. If it’s well above that, shunt or a home-made version is worth a look.

How I measured it

Claude Code keeps a transcript of every session, with the tokens used by each model call and the full text of every tool result. That’s enough to replay what the hook would have caught.

Replay every session, find the big reads, charge each one in full

  1. Replay every sessionTwo projects, 5 October to 1 November: 173,637 model calls, about $10,000 at list API prices
  2. Find the whole-file readsReads with no line range that returned over 350 lines
  3. Charge each in fullIts tokens are written to the prompt cache, then re-read on every later call until the context is compacted or cleared
  4. Divide by the spendThe share of four weeks of spend that those reads cost

A percentage saving only means something next to the share of the bill it applies to. Ask for both numbers, mine included.