---
title: "Spotify’s Backstage Portal cut my Claude Code token usage by 90%"
description: "Claude Code often spends frontier-model tokens on file I/O rather than reasoning, prompting a routing approach that sends predictable work to cheaper models. The post implements this with two public AiKA Modes in Spotify’s Backstage Portal: bulk-reader summarizes large file sets, and code-writer generates patterned files from a specification and reference file, using Gemini 2.5 Flash in the examples. A Claude Code plugin called shunt enforces delegation through PreToolUse hooks, scripts, and skills; reads above a configurable threshold, defaulting to 350 lines, are blocked and redirected. In tests on a Java monorepo, bulk-read saved around 90% of Claude’s tokens, while generated code can go directly to disk. The design does not cover editing or reasoning, and 10–30-second delegation latency makes small tasks counterproductive."
---

# Spotify’s Backstage Portal cut my Claude Code token usage by 90%

[Spotify](https://yomu.fyi/company/spotify) · Spotify Engineering · Sep 3, 2026

**Type:** Tutorial

## Summary

Claude Code often spends frontier-model tokens on file I/O rather than reasoning, prompting a routing approach that sends predictable work to cheaper models. The post implements this with two public AiKA Modes in Spotify’s Backstage Portal: bulk-reader summarizes large file sets, and code-writer generates patterned files from a specification and reference file, using Gemini 2.5 Flash in the examples. A Claude Code plugin called shunt enforces delegation through PreToolUse hooks, scripts, and skills; reads above a configurable threshold, defaulting to 350 lines, are blocked and redirected. In tests on a Java monorepo, bulk-read saved around 90% of Claude’s tokens, while generated code can go directly to disk. The design does not cover editing or reasoning, and 10–30-second delegation latency makes small tasks counterproductive.

## Context

Claude Code uses substantial token capacity for repetitive file reading and predictable code generation, even when those tasks require little reasoning. The post also describes rising token costs and the need to reserve frontier models for work that requires deeper analysis.

## Approach / What changed

Two AiKA Modes handle delegated work: bulk-reader summarizes large file collections, while code-writer generates patterned code from a specification and reference file. The shunt Claude Code plugin uses PreToolUse hooks to block oversized reads, scripts to invoke Portal modes, and skills to guide Claude’s delegation. A configurable line threshold controls when reads are redirected.

## Takeaways

- The bulk-reader mode receives files and questions, returns concise structured summaries, and keeps the file corpus out of Claude’s context.
- The code-writer mode requires a reference file, strips markdown fences, and can write generated output directly to disk so Claude does not consume those output tokens.
- Delegation is unsuitable for editing and reasoning-heavy work; 10–30-second latency can outweigh token savings for small tasks, while targeted reads remain allowed.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Claude Code](https://yomu.fyi/topic/claude-code), [Model Routing](https://yomu.fyi/topic/model-routing)

- Source: [Spotify](https://engineering.atspotify.com/2026/9/spotifys-backstage-portal-cut-my-claude-code-token-usage-by-90)
- Source URL: https://engineering.atspotify.com/2026/9/spotifys-backstage-portal-cut-my-claude-code-token-usage-by-90
- Ingested by Yomu: 2026-09-03T20:00:42.304Z

[Read original post](https://engineering.atspotify.com/2026/9/spotifys-backstage-portal-cut-my-claude-code-token-usage-by-90)
