TLDRocket
Sign in

Portal by Spotify Cut My Claude Code Token Usage by 90%

Spotify Engineering

Portal by Spotify routed Claude Code’s grunt work to cheaper modes and cut token use by about 90%. It’s a routing fix, not a new model — and that’s the point.

Based on reporting by Spotify Engineering — read the original for the full story.

Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error

Most of the work an AI coding agent does isn’t deep thinking. It’s reading a few files, copying a pattern, or spitting out test boilerplate. That’s exactly the kind of task that burns through expensive tokens for very little gain, and it’s why the bill matters more than the seat license in a lot of teams.

The setup in Portal by Spotify uses AiKA Modes to split that work into two jobs. One mode, bulk-reader, handles large-file reading and code analysis. The other, code-writer, generates predictable output like tests, config scaffolding, and type stubs. Both are declarative agents running on an ephemeral runtime, with instructions, a model, parameters, and MCP tools attached. Portal handles the rest.

The routing itself now lives in a Claude Code plugin called shunt. Earlier versions tried to do the job with instructions in CLAUDE.md, but that only went so far because Claude could ignore them and every project needed its own copy. Shunt moves the decision into hooks, scripts, and skills. Hooks block oversized reads and point Claude to /bulk-reader. Scripts wrap Portal CLI calls. Skills explain how to use them. The effect is that expensive reads get diverted before they happen, and the system still works even if one layer gets skipped.

Portal says the modes are public and reusable, and that matters more than the plugin wrapper. The same bulk-reader and code-writer modes can be shared across projects, customized by forking, and swapped to different worker models without changing the plugin. In a Java monorepo test across four scenarios, mean bulk-read savings were around 90%. The code-write case is trickier to measure, because Claude never sees the generated code at all.

There are limits, though. You still need Claude for editing, real reasoning, debugging, and safety-critical code. The worker model missed a subtle thread-safety bug that Claude caught quickly. And delegation adds latency, usually 10 to 30 seconds per call, so Portal caps a single invocation at 30 seconds. For small tasks, the overhead eats the win. For big file reads and boilerplate, it doesn’t.

My take — AI-written commentary, not fact-checked reporting

This is the sane answer to AI coding cost inflation: stop paying frontier-model prices for paperwork. The industry loves pretending every prompt is a moonshot; most of them are just glorified file shuffles. Routing is boring, which is exactly why it works.

Read more about this at: Spotify Engineering

Related stories

The daily briefing

Every AI story that matters, in your inbox by 8am.

TLDRocket reads all relevant sources, removes duplicate coverage, and summarises the day in two minutes. Follow companies and topics for alerts, or get the briefing in Slack. Free, no spam, unsubscribe anytime.