Music streaming service Spotify has revealed a method to reduce token consumption in the AI coding agent Claude Code. According to Dimitri Mazmanov, an engineer at the company, they reported being able to reduce Claude's token consumption by an average of approximately 90% during tasks such as testing that involve reading large numbers of files.
This method involves assigning I/O-intensive tasks that do not require advanced inference to cheaper and more lightweight models. Specifically, by utilizing "AiKA Modes" within "Portal by Spotify," the company's developer platform, they prepared 2 modes: "bulk-reader" (for bulk reading) and "code-writer" (for code generation). In their verification, Gemini 2.5 Flash was used as the worker model.
To streamline the workflow, the company developed a Claude Code plugin called "shunt," introducing a mechanism that automatically distributes tasks when specific conditions are met. For example, when access to a large file exceeding 350 lines is detected, Claude is instructed to receive only summarized information via the bulk-reader instead of reading the file directly.
On the other hand, the company stated that tasks requiring advanced inference, such as debugging and architectural decisions, will continue to be handled by Claude. Additionally, as summarizing with lightweight models presents challenges regarding line number accuracy, tasks such as fixing specific sections are excluded from delegation.
Source:
- How Spotify engineers reduced Claude Code token consumption by approx 90%? (GIGAZINE, 2026-09-12)
- Spotify Engineering