Portal by Spotify cut my Claude Code token usage by 90%
TL;DR Highlight
Routing big file reads to a cheaper model cut Claude's read tokens by about 90% on average
Who Should Read
Developers worried about Claude Code token costs who want to offload simple reads and boilerplate to cheaper models
Core Mechanics
- Much of the work is I/O
- Reading five files to answer about one method, or generating a test that copies twenty neighbors, burns many tokens.
- The author says this involves almost no reasoning but still runs on a frontier model.
- Two modes split the work
- bulk-reader reads several large files and answers the question in bullets.
- code-writer takes a spec and reference files and outputs only code matching existing patterns.
- Both examples use Gemini 2.5 Flash at temperature 0.2.
- Hooks force the cheap path
- Routing rules in CLAUDE.md were only advisory, and Claude could ignore them.
- The shunt plugin hooks Read calls and blocks files over 350 lines (default), redirecting to the /bulk-reader skill.
- Targeted reads and piped commands (cat file | grep) pass through.
- Scripts and skills wrap the calls
- Two bash scripts, bulk-read and code-write, handle Portal CLI calls, errors, and token reporting.
Community Reactions
- No accuracy numbers, critics say
- Some noted there's no mention of correctness or task success rate, and that routing purely on size ignores complexity.
- Others suggested running it against a benchmark like DeepSWE.
- One noted saving 90% of input tokens isn't saving 90% of all tokens, since output costs far more.
- Measured on own sessions: 5–7%
- One commenter estimated token savings of about 5–7% from their full LLM request/response logs.
- With mostly Opus 4.8, only 5.9% of unique reads qualified for bulk-read.
- 58% of reads were already targeted.
- Planning already reads the files
- One commenter argued the big model reads relevant files during plan mode anyway.
- Splitting work to a smaller model still needs the big model to handle distribution and review, so savings are doubtful.
- Local alternatives shared
- Someone asked why delegation must be remote rather than a local subagent, MCP server, or tool.
How to Apply
- Measure big reads in your sessions today
- Count full-file Reads over 350 lines in recent Claude Code session logs.
- Also count the share of targeted reads.
- If few qualify, the payoff will be small.
- Install shunt and try a multi-file question
- Run claude plugin marketplace add spotify/portal-ai-plugins, then install portal and shunt.
- Run /portal:setup in a new session.
- Ask a question spanning several files and compare tokens.
- Tune the SHUNT_MIN_LINES threshold
- Set SHUNT_MIN_LINES in env in .claude/settings.json.
- Raise it to something like 500 if latency bothers you, so fewer small files are delegated.
- Limit delegation to reads and boilerplate
- Don't delegate debugging, architecture decisions, or safety-critical code.
- For edits, have Claude read just the needed section with offset/limit.
Try It
# Simplified version of the article's method: paste into Claude Code to delegate large file reads to a subagent without Portal
Follow these rules for this session.
- Don't Read whole files over 350 lines directly; have a subagent read them and return only a summary.
- Subagent instruction: "Answer only in bullets that start with the exact name, type, or line number. No greetings or preambles. Skip anything not asked."
- If edits are needed, read just that section directly with offset/limit.
- Don't delegate debugging or design decisions; do them yourself.
Question: {{question}}
Target files: {{file paths}}
Next step: ask the same question once more without delegation and compare token usage and answer quality.Terminology
Related Papers
Mercury 3: Diffusion at scale
Scaling diffusion LLM 40x gives Mercury 3: 4–8x faster than speed-tier models, similar quality
Timestral: Mistral's time-series foundation models
A 209M time-series model ranks first on three benchmarks and runs on CPU.
DeepSeek V4.1 Flash 1017 (Max)
DeepSeek V4.1 Flash 1017 Max scores 45 on the Intelligence Index at 211 tok/s and $0.30 input.
If you don't run your own LLM proxy, how do you know whats going on?
Running your own LLM proxy shows which keys, models, and cache misses drive your usage.
DeepSeek: DeepSeek v4.1 Flash 1017
DeepSeek V4.1 Flash 1017: $0.05/M input, 1M context, built for agents
DeepSeek-v4.1-Flash-1017
DeepSeek V4.1 Flash minor update lifts coding and agent benchmarks while cutting run time and output length
Show HN: Llmspeed – feel how fast a local LLM runs before you buy the hardware