
Link · engineering.atspotify.com ↗
Portal by Spotify cut my Claude Code token usage by 90%
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.
Comments
Loading comments…