← In the News

Claude Code hooks route bulk reads to Gemini for about 90% mean token savings

Portal by Spotify cut my Claude Code token usage by 90% · Dimitri Mazmanov, Principal Product Manager · Spotify Engineering, September 3, 2026

Machine-readable Download Markdown

Mazmanov built a Claude Code plugin called shunt that intercepts tool calls before they run. Two hooks block file reads over 350 lines and large Bash reads of files. They redirect that work to a Gemini 2.5 Flash worker running on Spotify's internal Portal platform, so Claude's main model does not read the file itself.

Shunt's code-writer mode generates boilerplate such as tests and configuration stubs and writes the result directly to disk, keeping that output out of Claude's context. Across four scenarios in a Java monorepo, Mazmanov reports, "Mean bulk-read savings were around a whopping 90%." He does not use the worker model for editing or debugging. In his testing, it missed a thread-safety bug that Claude caught once it had the right context.

Why it matters: Portal is not public, but Claude Code users can test the same hook-based routing pattern with a cheaper backend they already use. Mazmanov cites a Gartner estimate that a quarter of engineering leaders spend $200 to $500 per developer each month on tokens. The reported 90% saving applies to bulk reads, so teams should measure it against their own workloads before changing which model handles other tasks.