a↗agentbay.Get AgentBay
My account ▾
Menu
← Articles

Repository spotlight · Cost & Performance · 2 min read

Let your coding agent delegate the file reading

Start with the work your agent repeats: reading large files, following existing test patterns and generating configuration. Spotify’s shunt moves selected work to a worker model through Portal’s AiKA modes.

Open Spotify’s repository ↗

What Spotify measured

Spotify reported roughly 90% mean savings on bulk-read tokens in its Java-monorepo benchmark. That measures the reads it delegated, not a 90% reduction in the whole engineering token bill.

Reported bulk-read benchmark
TaskBeforeAfterSaved
One large file33,6845,73782%
Source and test files75,9904,14894%
Several services16,22182194%

Publisher-reported bulk-read token counts. Percentages are reproduced as reported; the first row works out to about 83% from the displayed counts. AgentBay has not rerun this benchmark.

Read Spotify’s report ↗ · Benchmark source ↗

How the work moves

  1. 01

    Claude Code chooses

    A hook redirects large full-file reads. Targeted reads still go through.

  2. 02

    A worker handles the I/O

    bulk-reader returns a focused answer. code-writer can write a file from a spec and reference.

  3. 03

    Review the result

    Keep debugging and architecture decisions with the main agent. Inspect changes and run the relevant checks.

Set it up

You need Claude Code, jq and access to a Portal instance with AiKA enabled. Install the marketplace and both plugins:

claude plugin marketplace add spotify/portal-ai-plugins
claude plugin install portal@portal
claude plugin install shunt@portal

Start a new Claude Code session and run /portal:setup. Check that your Portal instance has bulk-reader and code-writer modes. Create or customize them using the repository instructions if needed.

The Portal plugin supports several coding agents. Shunt itself is currently documented for Claude Code.

Setup and mode instructions ↗

Try it on one ticket

For a CSV-import ticket, start with a bounded question: ask the agent to locate the existing parser, validation rules and import tests. Use a targeted read before changing a function. If generating a routine test file, provide a nearby test as the reference. Review the diff before accepting it.

Try one representative ticket. Record main-model tokens, worker usage, elapsed time, retries and review fixes. Compare the total cost of completing the ticket, including the worker. Keep routing only where it improves that result.

The examples in Spotify’s post used Gemini 2.5 Flash. Your configured worker model, repository and workload determine the result. Delegated files are sent through your Portal instance to its configured model provider; use your team’s approved configuration.