Context routing for coding agents

An agent reads what the file it touches needs. The rest loads on demand.

Why whole-tree context fails

Loading the whole repository costs tokens on every turn and buries the one rule that matters for this file under the many that do not. Routing turns the question around: start from the file, and load only what it answers to.

How a route is built

Entry
Start with a compact entry point, then follow the relevant project route.
Route
headron route <file> resolves the file to its language pack, rules, guide and precedence.
Port
headron port <file> --frame agent returns the route, owed gates and relevant lessons in one brief for the agent.
On demand
Everything else loads when a task reaches it.

What the runs recorded

Routing experiment
89% fewer prompt tokens than whole-tree context; 50% fewer than unassisted, across identified models.
Task bench
Three Claude models on contract 2.29.0: 137/138 with Headron, 78/138 blind, every task answered by both arms.

Each row is its own record, with its own contract version and task set. Rows are never summed into one figure, and no run crowns a model.

Try it on one file

uv tool install headron-software
headron route path/to/file.py
headron port path/to/file.py --frame agent

Questions

What is context routing for coding agents?

Giving an agent the rules and checks for the file it is changing instead of the whole repository, so each prompt carries what that change needs.

How much does routing save?

In the recorded routing experiment, 89% fewer prompt tokens than whole-tree context and 50% fewer than unassisted runs, across identified models. Your repo and tasks will differ.

Does routing skip checks?

No. Routing narrows what the agent reads, not what the change must prove. The gate still runs every check the change owes.

Which agents can use routes?

Any agent that can run a command or call MCP: headron route on the CLI, or route and port through the MCP server.

Related guides

Start

Run the free, MIT-licensed verifier or connect through MCP. Headron Harness shows your runs, checks and receipts in one account.