Spotify has released shunt, a plugin for Claude Code that routes large file reads and repetitive code generation to a cheaper model, a way to rein in a token bill that is starting to weigh on engineering budgets. According to the article on its engineering blog, written by Dimitri Mazmanov, the plugin cut tokens in bulk reads by an average of 90% in its tests, as noticias.ai reported.
shunt and the cost of coding agents in 30 seconds
- shunt intercepts reads of files longer than 350 lines in Claude Code and routes them to a more economical model.
- The average 90% savings comes from four Spotify tests on a Java monorepo, with no absolute counts published.
- It only works with Portal, Spotify’s developer platform, with its AiKA assistant enabled.
- Each delegated call adds between 10 and 30 seconds of latency, and editing and reasoning still happen in Claude.
The starting point is financial. In his article, Mazmanov cites a Gartner forecast that spending on AI-assisted coding will overtake developer salary costs by 2028, and mentions data showing that a quarter of engineering leaders already spend between $200 and $500 a month per developer on tokens, with some cases above $2,000. These are figures the author cites, not numbers from Spotify, but they point to a budget line that until recently didn’t exist — the kind of cost businesses are only now learning to weigh against buying their own hardware.
Paying Less to Read Files
Spotify’s thesis is that much of a coding agent’s work is input and output, not reasoning. When the agent opens a file with thousands of lines, all that text enters its context and gets billed as input tokens on the main model, the most expensive one. shunt uses Claude Code hooks to block those full reads and send them, along with the specific question, to a Portal agent that returns only the answer. To generate repetitive code, another script passes the spec to a second agent, which can write the result to disk without Claude reading it.
In Spotify’s examples, those agents use Gemini 2.5 Flash, though the Portal instance allows configuring a different model. The 350-line threshold, the instance, request size limits and the maximum time per call are all adjusted via environment variables, which lets each team decide how much work to offload.
What the 90% Doesn’t Tell You
The figure has important nuances for anyone looking to apply it to their own budget. It refers to the main model’s tokens in reads, not total cost, because the secondary model also consumes tokens, albeit cheaper ones. The article publishes no absolute counts or a dollar/euro comparison, the repository’s README gives a range of 82% to 94%, and the author himself admits the savings in code generation are hard to measure. There are no independent measurements either.
There are also operational costs. Each delegated call takes between 10 and 30 seconds, so the plugin doesn’t pay off on small reads. Editing stays in Claude’s hands because summaries don’t give reliable line numbers, and in one of the tests the secondary model missed a concurrency bug that Claude did catch. And the dependency on Portal limits its use to organizations already working with Spotify’s platform — a constraint that hasn’t stopped Claude Code itself from becoming a tool enterprises now monitor closely. For everyone else, the idea of splitting reading and reasoning across models at different price points can be applied with other tools, though it requires building that layer yourself.
Frequently Asked Questions
What does shunt do?
It diverts large file reads and repetitive code generation away from Claude Code to a cheaper model configured in Portal, so the main model consumes fewer tokens.
Is the 90% savings on the total bill?
No. It’s the average savings in main-model tokens for bulk reads across four Spotify tests. The secondary model also consumes tokens, and the final cost hasn’t been published.
What do you need to use it?
Claude Code, jq, and a Spotify Portal instance with AiKA enabled and the bulk-reader and code-writer modes.
Sources:

