<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6" -->

---
title: Spotify’s Backstage Portal cut my Claude Code token...
description: An engineer describes building a token-saving router for Claude Code using Spotify's Backstage Portal AiKA modes. The approach delegates I/O-heavy work (bulk...
canonical: https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spotify’s Backstage Portal cut my Claude Code token usage by 90% | daily.dev
og:description: An engineer describes building a token-saving router for Claude Code using Spotify's Backstage Portal AiKA modes. The approach delegates I/O-heavy work (bulk...
og:url: https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6
og:image: https://api.daily.dev/og/posts/2beO3hwm6.png
og:image:alt: Spotify’s Backstage Portal cut my Claude Code token usage by 90%
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[Spotify Labs](https://daily.dev/sources/spotify)** · 8 min read · 4 upvotes · 1 comments

## Summary

An engineer describes building a token-saving router for Claude Code using Spotify's Backstage Portal AiKA modes. The approach delegates I/O-heavy work (bulk file reading, boilerplate code generation) to a cheaper worker model (Gemini 2.5 Flash) via declarative agent 'modes', while reserving Claude for actual reasoning. A Claude Code plugin called 'shunt' enforces this routing through PreToolUse hooks, wrapper scripts, and skill files, cutting bulk-read token usage by roughly 90% in benchmarks on a Java monorepo. Limitations include inability to delegate edits or deep reasoning (e.g., a thread-safety bug was missed by the worker model), and added latency of 10-30 seconds per delegation. Both modes are published as public, reusable, shareable configurations, and the plugin marketplace is open source.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://engineering.atspotify.com/2026/9/spotifys-backstage-portal-cut-my-claude-code-token-usage-by-90>

## Questions this post answers

### How can I reduce token usage in Claude Code when it reads many large files?

Delegating bulk file reads to a cheaper worker model can cut token consumption by around 90%. Spotify's approach uses a Backstage Portal AiKA mode called bulk-reader running on Gemini 2.5 Flash, triggered by a Claude Code plugin hook that blocks reads over a configurable line threshold (default 350 lines) and redirects them to a bulk-read script instead.

_Developers tuning AI coding costs can find practical token-saving patterns like this one on daily.dev._

### Can an AI coding agent safely delegate code edits to a cheaper model?

No, delegating edits is unreliable because worker model summaries lack accurate line numbers needed for precise changes. Targeted reads with offset and limit are still handled directly by the primary model for this reason, so delegation is limited to understanding and boilerplate generation rather than actual edits, debugging, or architectural decisions.

_Engineers weighing what to safely offload to cheaper models can track findings like this on daily.dev._

### What is a Backstage Portal AiKA mode used for?

An AiKA mode in Spotify's Backstage Portal is a declarative agent that runs on an ephemeral runtime, similar to AWS Lambda for agents, defined by instructions, a chosen model, parameters like temperature, and optional MCP tools, without requiring infrastructure management or API keys. Modes can be public or private and are callable via the Portal CLI or API.

_Teams evaluating agent orchestration platforms can compare approaches like this one on daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@jpdelatorre** · 0 upvotes

> Tried doing this using `pi-agent-router`. Turns out I need more computing power to run multiple local models to handle trivial tasks.

## Similar posts on daily.dev

- [Maximize AI Efficiency: Reduce Token Use in Claude Pro](https://daily.dev/posts/maximize-ai-efficiency-reduce-token-use-in-claude-pro-vwm1wdmka) · Sergio Lema · 1 upvotes · 0 comments
- [Claude Code best practices for enterprise teams](https://daily.dev/posts/claude-code-best-practices-for-enterprise-teams-o3fu84mlo) · portkey · 3 upvotes · 2 comments
- [The Claude Code Source Leak: fake tools, frustration regexes, undercover mode, and more](https://daily.dev/posts/the-claude-code-source-leak-fake-tools-frustration-regexes-undercover-mode-and-more-gmkbbnzuj) · Hacker News · 8 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#claude-code](https://daily.dev/tags/claude-code), [#google-gemini](https://daily.dev/tags/google-gemini), [#ai-gateway](https://daily.dev/tags/ai-gateway)

[View this post on daily.dev](https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spotify’s Backstage Portal cut my Claude Code token usage by 90%","url":"https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6"},"datePublished":"2026-09-03T16:21:57.693Z","dateModified":"2026-09-13T21:37:07.284Z","description":"An engineer describes building a token-saving router for Claude Code using Spotify's Backstage Portal AiKA modes. The approach delegates I/O-heavy work (bulk...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c5aa23a6c1d45a2248e99ba1fa35534e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c5aa23a6c1d45a2248e99ba1fa35534e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Spotify Labs","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Spotify Labs","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/spotify","url":"https://daily.dev/sources/spotify"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"llm,claude-code,google-gemini,ai-gateway","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Spotify Labs","item":"https://daily.dev/sources/spotify"},{"@type":"ListItem","position":3,"name":"Spotify’s Backstage Portal cut my Claude Code token usage by 90%"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6","comment":[{"@type":"Comment","text":"Tried doing this using pi-agent-router. Turns out I need more computing power to run multiple local models to handle trivial tasks.","datePublished":"2026-09-05T21:58:28.714Z","url":"https://daily.dev/posts/2beO3hwm6#c-ybHsW0Fuq","author":{"@type":"Person","name":"JP de la Torre","url":"https://daily.dev/jpdelatorre","image":"https://media.daily.dev/image/upload/s--vMLSF3-1--/f_auto/v1787723050/avatars/avatar_0fMQQvxSIIVibBvP847Xo?_a=BAMAMicg0"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spotify-s-backstage-portal-cut-my-claude-code-token-usage-by-90--2beo3hwm6#faq","mainEntity":[{"@type":"Question","name":"How can I reduce token usage in Claude Code when it reads many large files?","acceptedAnswer":{"@type":"Answer","text":"Delegating bulk file reads to a cheaper worker model can cut token consumption by around 90%. Spotify's approach uses a Backstage Portal AiKA mode called bulk-reader running on Gemini 2.5 Flash, triggered by a Claude Code plugin hook that blocks reads over a configurable line threshold (default 350 lines) and redirects them to a bulk-read script instead. Developers tuning AI coding costs can find practical token-saving patterns like this one on daily.dev."}},{"@type":"Question","name":"Can an AI coding agent safely delegate code edits to a cheaper model?","acceptedAnswer":{"@type":"Answer","text":"No, delegating edits is unreliable because worker model summaries lack accurate line numbers needed for precise changes. Targeted reads with offset and limit are still handled directly by the primary model for this reason, so delegation is limited to understanding and boilerplate generation rather than actual edits, debugging, or architectural decisions. Engineers weighing what to safely offload to cheaper models can track findings like this on daily.dev."}},{"@type":"Question","name":"What is a Backstage Portal AiKA mode used for?","acceptedAnswer":{"@type":"Answer","text":"An AiKA mode in Spotify's Backstage Portal is a declarative agent that runs on an ephemeral runtime, similar to AWS Lambda for agents, defined by instructions, a chosen model, parameters like temperature, and optional MCP tools, without requiring infrastructure management or API keys. Modes can be public or private and are callable via the Portal CLI or API. Teams evaluating agent orchestration platforms can compare approaches like this one on daily.dev."}}]}
```

