AI/TLDR

Spotify · 2026-09-03 · major

Shunt — Spotify's Claude Code plugin cuts token use by 90%

Spotify's shunt plugin sends an AI coding agent's bulk file reads and boilerplate writing to a cheaper worker model. Spotify measured a mean saving of about 90% on bulk reads in Claude Code against a Java monorepo.

Header illustration for Spotify's post on cutting Claude Code token usage with Portal
Spotify Engineering

A Claude Code plugin that hands bulk file reads to a cheap model, which Spotify measured at about 90% fewer tokens.

Quick facts

MakerSpotify
Pluginshunt, from the Portal AI plugins marketplace
Measured savingAbout 90% mean on bulk reads
Default triggerFiles over 350 lines (configurable)
Default worker modelGemini 2.5 Flash
RequirementA Spotify Portal instance to authenticate against
LicenseApache-2.0

What is it?

Shunt intercepts the I/O-heavy parts of a coding-agent session. Rather than pulling every large file into the frontier model's context, the plugin forwards those reads — and boilerplate writing — to a cheaper worker model and returns the result. Spotify ships it in the Portal AI plugins marketplace alongside the main Portal plugin for Claude Code, Codex and Cursor.

How does it work?

Delegation runs through AiKA modes, Portal's declarative agents on an ephemeral runtime. Two modes do the work: one summarises several large files to answer a question, the other generates boilerplate that matches existing patterns. A configurable file-size threshold decides what gets handed off. Both modes are already public, so there is nothing to create before the first run.

Why does it matter?

Token spend on coding agents has become a per-developer line item, and most of what an agent does is reading rather than thinking. Principal product manager Dimitri Mazmanov's post puts a measured number on that split, tested against a real Java monorepo instead of a toy example. The catch is the dependency: the saving only reaches teams that already run Portal.

Who is it for?

platform teams running Spotify Portal

Frequently asked questions

How much does Spotify's shunt plugin actually save?
Spotify measured a mean saving of roughly 90% in bulk-read token usage when running Claude Code against a Java monorepo. The saving comes from delegating large file reads to a cheaper worker model rather than pulling whole files into the frontier model's context. How much any given team saves depends on how much of its agent work is I/O rather than reasoning.
Do you need a Spotify Portal instance to use shunt?
Yes. The Portal AI plugins call the upstream CLI through npx @spotify/portal-cli, and the setup step authenticates that CLI against your own Portal instance. Portal is Spotify's commercial distribution of Backstage, so shunt targets platform teams already running it rather than individual Claude Code users looking to trim a personal bill.
Which coding agents can install the Portal AI plugins?
The marketplace supports Claude Code, Codex and Cursor for the main Portal plugin, while shunt itself is Claude Code only. Claude Code installs it with two marketplace commands and then runs /portal:setup. Codex and Cursor users register the repository in their team marketplace settings and install it from plugin settings.
Which model does shunt hand the delegated work to?
Both of shunt's modes default to Gemini 2.5 Flash but accept any model configured in AiKA modes. A mode is a declarative agent: you write the instructions, pick a model, set parameters such as temperature, and attach MCP tools, and Portal runs it on an ephemeral runtime so there is no server to keep alive.

Try it

claude plugin marketplace add spotify/portal-ai-plugins

Sources · 4 outlets

Tags

  • spotify
  • claude-code
  • portal
  • backstage
  • coding-agents
  • plugin
  • model-routing
  • token-costs
  • cost-optimization
  • developer-tools
  • aika

← All releases · Learn AI