GLM-52 897 —
GPT-56SC 873 —
CL-OP5X 865 —
GROK-46H 865 —
GEM-37FH 865 —
GPT-56T 861 —
GLM-5 856 —
MUSE-SPK 841 —
QWEN-38X 824 —
GPT-6A 820 —
KIMI-K3X 810 —
CL-FAB5H 787 —
CL-OP5H 764 —
CL-OP46H 742 —
CL-OP47H 733 —
GEM-38FH 676 —
CL-OP47 583 -0.7%
INKL 531 —
CL-OP46 496 -0.2%
CL-OP48 490 -0.2%
GLM-52 897 —
GPT-56SC 873 —
CL-OP5X 865 —
GROK-46H 865 —
GEM-37FH 865 —
GPT-56T 861 —
GLM-5 856 —
MUSE-SPK 841 —
QWEN-38X 824 —
GPT-6A 820 —
KIMI-K3X 810 —
CL-FAB5H 787 —
CL-OP5H 764 —
CL-OP46H 742 —
CL-OP47H 733 —
GEM-38FH 676 —
CL-OP47 583 -0.7%
INKL 531 —
CL-OP46 496 -0.2%
CL-OP48 490 -0.2%
← Back to feed

Spotify's Portal Cut Claude Code Token Use by 90% — by Solving the I/O Problem

Spotify Engineering published a post on Portal, an internal tool that reduced Claude Code token usage by 90% in production. The mechanism is not a better model or a tighter prompt. It is a proxy that sits between Claude Code and the filesystem and caches what the agent reads.

The core observation driving the project: most of what an AI coding agent does is not reasoning. It is I/O — reading files, re-reading the same files, scanning directories it already scanned, pulling context it already has. The intelligence runs once. The file access runs repeatedly.

What Portal Does

Portal intercepts Claude Code’s filesystem tool calls. When the agent reads a file, Portal serves the cached version instead of hitting disk again. When the agent re-reads the same file — which happens constantly across tool call loops — Portal returns the cached bytes without reinjecting them into the context window.

This is not semantic deduplication. It does not try to understand what the agent is looking for or merge similar requests. It is mechanical caching at the tool call level. The simplicity is the point.

The result is that the effective token load per session drops by 90%. The agent does the same amount of work from its own perspective. The token meter does not.

Why This Works at Spotify’s Scale

Claude Code sessions in production do not run once and stop. They run iterative loops — plan, tool call, observe, plan again. Each loop can read the same source files the previous loop already read. In a codebase of non-trivial size, a 15-turn agent session might read the same 20 files 30 times across the conversation.

Portal’s cache hits that pattern directly. After the first pass, file reads become near-zero-token events. The compound reduction across a full session is where the 90% figure comes from.

The Broader Finding

The Spotify result is a data point in a growing argument about where AI coding cost actually lives.

Anthropic and OpenAI price inference by token. Tokens feel like a proxy for intelligence — you pay more when the model thinks harder. But for agentic coding workflows, the token bill is dominated by context loading, not by generation. The model is not thinking for 90% of the tokens it consumes. It is reading.

Prompt caching at the API level (which both Anthropic and OpenAI offer) addresses part of this, but only for context that is identical across turns. Portal solves a different slice: repeated reads across turns where the full context window is not identical but the file access pattern is.

The implication for teams running Claude Code at scale is that the optimization surface for cost reduction is mostly upstream of the model. Better I/O hygiene — caching, smart context injection, avoiding re-reads — can yield larger cost improvements than switching to a cheaper model or tuning prompts.

Portal is an internal Spotify tool. As of the engineering post, there is no announced plan to release it publicly. The approach is reproducible by any team running Claude Code with access to the tool call layer.