Spotify Routes Routine AI Coding Tasks to Cheaper Model

An engineer's system sends simpler coding work from Claude Code to Google's Gemini 2.5 Flash to cut token costs.

Updated on Nov. 26, 2026 in Artificial Intelligence

Spotify Routes Routine AI Coding Tasks to Cheaper Model

Spotify principal product manager Dimitri Mazmanov built a system that routes routine AI coding tasks from Anthropic's Claude Code to Google's Gemini 2.5 Flash. In four test scenarios, the system reduced token usage for file-reading tasks by about 90% on average.

Why it matters

Token fees for AI coding tools are climbing, with some developers reportedly paying more than $2,000 a month. Gartner predicts that by 2028 the cost of AI coding tools will exceed the average developer's salary, pushing companies to match each task to the model that fits it best.

A plugin called shunt blocks Claude requests to read files longer than 350 lines and redirects them to the cheaper model, while each hand-off adds 10-30 seconds. Results were measured across four test scenarios, and the system depends on Portal, a platform Spotify sells.

The players

Spotify

Spotify is a global audio streaming company headquartered in Stockholm, Sweden, whose engineers built and tested the routing system described in the story.

Dimitri Mazmanov

Dimitri Mazmanov is a principal product manager at Spotify who set up the system routing routine AI coding tasks to a cheaper model.

Gartner

Gartner is a global research and advisory firm known for technology market forecasts that guide corporate IT spending decisions.

The details

The system uses two small AI agents built on Spotify's Portal platform: one reads and summarizes files, and the other writes routine code based on existing examples. Routine work is redirected to Gemini 2.5 Flash, while more complex tasks remain with Claude Code.

Timeline

  1. 2028: Gartner predicts AI coding tool costs will exceed the average developer's salary.

The Tech Race

The story pits Anthropic's Claude Code against Google's cheaper Gemini 2.5 Flash inside a single engineering workflow, rather than treating one model as the default. It suggests the competitive question is shifting from which model is best overall to which model fits each specific task.

Developers and teams paying per-token AI fees may find that routing simpler tasks to cheaper models can cut usage costs substantially. The approach also adds small delays with each hand-off, so the tradeoff between cost and speed depends on the work involved.

The takeaway

Matching each coding task to the model that handles it most efficiently can meaningfully reduce AI costs without a full switch away from premium tools. Teams weighing this approach should measure savings on their own workloads before assuming similar results.

Further reading

For broader context on how companies are weighing model costs, explore our coverage of Artificial Intelligence.

Source note: This article includes information reported by Cnbctv18.