Spotify measured 90% fewer tokens by sending bulk file reads to a cheaper model

Image: Spotify Engineering
Why it mattersMost agent spend goes on reading code rather than writing it, so the cheapest saving is deciding which model is allowed to open a large file.
Spotify published a measurement on 3 September saying that routing bulk file reads away from Claude Code and towards a cheaper worker model cut token use by roughly 90%. The post is by Dimitri Mazmanov, a principal product manager at the company, and the plugins behind it are on GitHub under Apache-2.0.
The mechanism is a plugin called shunt. It installs a hook that runs before Claude Code reads a file. If the file is longer than a set number of lines, the hook stops the read and tells the agent to ask a separate summarising step instead. The default threshold is 350 lines and it is configurable.
What was measured, and what was not
Spotify says the test ran against a Java monorepo across four scenarios, comparing the tokens Claude would spend reading files directly against the tokens spent consuming a summary. Their words: "Mean bulk-read savings were around a whopping 90%." That is the company's own figure on its own platform, and the post gives no sample size or per-scenario breakdown, so treat it as a direction rather than a number you can plan a budget on.
The post is honest about the part it could not measure. A second mode writes boilerplate code straight to disk without the expensive model ever seeing the output, and Spotify says that case is harder to quantify because the comparison mixes input and output tokens.
The cost is latency
Each delegation adds 10 to 30 seconds, and Spotify's platform caps a single invocation at 30 seconds. So the saving is real but it is paid for in waiting. A long file that the agent needs in full is now a round trip through a second model, and a summary is lossy by definition.
For context on why anyone bothers, the post cites industry figures of 200 to 500 US dollars per developer per month in token costs, with some engineering leaders reporting over 2,000 dollars. Those are quoted benchmarks in the article rather than Spotify's own accounting.
One limit matters before anyone plans around this. The plugins call Spotify's Portal command line tool and need a Portal instance to work, so the code as published is not something an outside team can install and run. The idea underneath it does transfer: put a rule in front of the expensive model that decides which reads it is allowed to perform, and hand the rest to something cheaper.
That reframes where agent cost actually comes from. Teams tend to watch generated output, because that is the visible work. On a large codebase the agent spends most of its budget reading, and reading is the part that a smaller model can often do well enough. The decision worth making is not which frontier model to buy, but which files it is allowed to open at full price.
Source
- Portal by Spotify cut my Claude Code token usage by 90%, Spotify Engineering, 3 September 2026
- spotify/portal-ai-plugins on GitHub, Apache-2.0
Source: Spotify Engineering
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually shipping with them. Short, and only when there is something worth reading.