Portal by Spotify cut my Claude Code token usage by 90%
Spotify Engineering reports that Portal by Spotify's AiKA Modes reduced Claude Code token usage by 90% for the author. The post argues that much of an AI coding agent's work is I/O rather than reasoning, and that routing such tasks to cheaper models saves costs. The author created two modes: bulk-reader for reading multiple files to answer questions, and code-writer for generating boilerplate code. Both use Gemini 2.5 Flash as the worker model, with temperature set to 0.2. The modes are declarative agents running on ephemeral runtimes, callable via Portal CLI or API, and can be public or private. The first routing attempt used rules in CLAUDE.md, but those were advisory and not enforced. The current version is a Claude Code plugin called shunt, which uses PreToolUse hooks to block reads of files exceeding a configurable line threshold (default 350) and redirects to the bulk-reader skill. Bash commands like cat, head, tail, less, and more on large files are also intercepted. Two bash scripts wrap Portal CLI calls, handling request building, error unwrapping, and token usage reporting. The scripts send files to the modes, and follow-up questions re-send files because the corpus goes to the worker model and never enters Claude's context. The post claims this approach cut token usage by 90%.
Developers can cut AI coding token costs by routing routine I/O tasks to cheaper models via Portal's modes.