Diagram of a stream of green and orange code blocks splitting into two paths, one billed at four Claude tokens and one at a single Claude token

Link · engineering.atspotify.com ↗

Portal by Spotify cut my Claude Code token usage by 90%

Hooks block any Read over 350 lines and hand the file to a cheaper worker; Claude sees only the bullets. Around 90% fewer tokens on bulk reads, and one thread-safety bug the worker missed.

Why we picked it · the editor's summary

The routing rules started as a block in CLAUDE.md, and Claude ignored them so often that Mazmanov moved enforcement into a plugin. Two PreToolUse hooks now block any Read, cat, head, or tail on a file over 350 lines and point Claude at a bulk-reader skill; a script ships the files to a Gemini 2.5 Flash mode on Spotify's Portal and returns bullets, so the corpus never enters Claude's context. A second mode writes boilerplate straight to disk against a reference file. Across four scenarios on a Java monorepo, mean bulk-read savings were around 90%, at 10 to 30 seconds per round trip; the worker also missed a thread-safety bug Claude caught, so debugging and edits that need line numbers stay with the frontier model. The plugin only runs against a Portal instance, but the shape travels: an enforced hook, a cheap worker, and a line threshold below which delegation costs more than it saves.

Read on atspotify.com7m read

Comments

Loading comments…