🔀 Agent-Shunt v1.1
Universal Shunt Routing for AI Coding Agents

Stop burning frontier tokens on dumb file I/O

A universal, zero-dependency model-routing shunt. Delegates massive codebase reading and boilerplate generation to fast, economical worker models (Gemini Flash, Groq, Ollama) — cutting token burn by up to 90% while preserving context.

✓ Zero external dependencies
✓ Bypasses Linux ARG_MAX
✓ Dynamic Model Discovery
✓ MCP + CLI + Hooks

The Shunt Architecture

Inspired by Spotify Engineering's internal routing pattern, redesigned as a universal open-source tool.

Without Agent-Shunt Costly & Slow

The primary frontier agent reads raw files directly into its expensive context window.

// Frontier Agent Context
📖 File 1 (auth.ts): 1,200 lines (3,800 tokens)
📖 File 2 (session.ts): 850 lines (2,600 tokens)
📖 File 3 (user.ts): 2,400 lines (7,400 tokens)
Total: 13,800 tokens at $3.00/MTok
⚠️ Context pollution: 95% of read tokens are irrelevant boilerplate that dilutes reasoning accuracy.
With Agent-Shunt 🔀 90% Less Tokens

Heavy files stream into a fast worker model. Only concise bullets with exact line numbers return.

// Shunt Worker Streams & Synthesizes
⚡ Worker Model: Gemini 2.5 Flash / Groq ($0.075/MTok or $0)
// Frontier Agent Only Receives:
• auth.ts:42 | AuthTokenManager handles refresh
• session.ts:118 | Session cookie timeout set to 3600s
Total to Frontier: ~150 tokens (~98.9% saved!)
✨ Frontier context stays razor sharp; exact line citations (N|) prevent hallucinations.

Interactive Savings Calculator

Estimate how much money and context tokens Agent-Shunt saves for your daily coding workflow.

20,000 lines
2k lines 50k lines 100k lines
Estimated Monthly Cost Savings
$52.65
Saved ~94.8% of token costs
Without Shunt $55.80 / mo
With Agent-Shunt $3.15 / mo

One-Click Agent Setup

Copy and paste the configuration into your preferred coding agent.

mcpServers configuration

Engineered for Autonomous Coding

Every detail designed to remove friction, prevent bugs, and safeguard your context window.

01

Zero Dependencies

Written in pure Python 3 standard library. No pip install, no virtualenv, and no npm. Works instantly anywhere Python 3.8+ is installed.

02

Linux ARG_MAX Guard

Bypasses the 128 KB CLI buffer limit in Linux by streaming file contents over stdin. Process hundreds of files in one pass without shell crashes.

03

Live Model Discovery

Exposes get_available_models to query your provider's active models in real time, auto-selecting the best model for reading vs writing.

04

Binary File Guard

Automatically scans initial byte blocks for null bytes (\x00) to reject images, PDFs, or compiled objects before sending them to the LLM.

05

Exact Line Indexing (N|)

Every file block has each line prefixed with its 1-based number. Worker models cite exact line ranges with zero guessing or hallucination.

06

Exponential Backoff

Automatic retry loops for HTTP 429 rate limits and 503 gateway timeouts, ensuring long-running agent workflows don't fail unexpectedly.