Self-hosted · MIT · Any OpenAI-compatible agent

Your agents re-send everything. We fix that.

RootRouter cuts the context your agents send — 44% in our benchmark, up to 95% on cold repo slices — with one base_url change or an MCP server for coding agents.

Running in production on OpenClaw · No analytics, no phone-home.

Loading snapshot…

Install for your agent.

MCP for cold slices and cross-module work: index once, then ask for a budgeted slice instead of the whole repo.

cursor-mcp.sh
# one-time, per repository
npx rootrouter@beta init cursor --project-store --project-agent-id my-project

# then, in Cursor, the MCP tools do the work
index_repo(path=".")
select_context(query="slice + modules + anchor files", tokenBudget=2500)

# warm single-file change? edit directly, skip MCP

SDK: npm install rootrouter@beta · full docs

Context is the bill nobody owns.

Agents send the whole thread, the whole repo and every tool output. It costs money, buries the signal and leaves no evidence of what was sent.

The thread grows. So does the bill.

Every turn re-sends history the model does not need. Cost scales with the conversation, not with the task.

The repo is bigger than the task.

Agents read everything to find three files, then pay for the other thousand.

Savings are unprovable.

Nobody can show what context was sent, what was dropped, or what it cost. RootRouter logs it.

RootRouter fixes the context layer. The model and the agent framework stay yours.

Three steps.

The model and the agent stay the same. Only the context changes.

STEP 01

Point your agent at RootRouter

Change one base_url, or add the MCP server. No rewrite, no SDK lock-in.

STEP 02

RootRouter selects the smallest relevant slice

History, repo chunks and tool output are ranked and cut to a token budget before they reach the model.

STEP 03

Measure what it saved

Tokens saved per request, a selection audit per task, and a dashboard when you want the detail.

# any OpenAI-compatible client
base_url = "http://localhost:8787/api/v1"
# then every /chat/completions is trimmed before it reaches the provider

Proxy setup →

One engine, three surfaces.

Same selection core. Pick the integration your agent already supports.

Proxy

Zero-code context trimming.

Point base_url at it. Every chat completion arrives trimmed, streamed and fail-open to the original request.

Best for: Existing OpenAI-compatible agents

Proxy docs →
MCP

Only the files the task needs.

Index a repository once, then select a budgeted slice per task with path filters and an audit log.

Best for: Cursor, Codex, Claude Code

MCP docs →
IRP

Sell routing, not compute.

Rank a buyer’s candidate models for one turn by task fit and expected cost. Stateless, no prompt storage.

Best for: Inference marketplaces

IRP guide →

Evidence

Less context. Same answers.

Measured, not promised. Every number below carries its baseline.

43.9%
fewer context tokens
73%
lower modeled cost

50-query SDK benchmark · seed 42 · TF-IDF + simulated LLM · modeled cost at Claude-tier prices, not billed

SimulatedSDK benchmark · offline
43.9%
fewer context tokens

50-query TF-IDF + simulated-LLM benchmark (seed 42). The same run models 73% lower cost.

Modeled cost at Claude-tier prices, not a billed reduction.

Live APINVIDIA NIM · live API
46%
estimated context saved

Swarm profile: 24 steps, 3 agents, real nvidia/nemotron-3-ultra-550b-a55b completions.

Estimated over accumulated history; not an API-billed figure.

AuditedMCP · cold slice
95.5%
context tokens saved

~134k indexed-corpus tokens → ~6k selected for a spec-driven slice.

Best case for a cold, spec-driven slice; not an every-request result.

How we measure →

On Antseed

Pick RootRouter as your routing service.

RootRouter speaks IRP suggest-only: it ranks the candidates you allow for one turn by task fit and expected cost. It does not run inference, does not store prompts, and does not call upstream providers.

  • Task-aware: ranks by detected capabilities and difficulty, not just price.
  • Cost-aware: expected_cost_usd per candidate, including cache-read pricing.
  • Zero retention: no prompt storage, no upstream calls, no model hosting.
How IRP works →
irp · suggest-only
GET  /v1/routing/models
POST /v1/routing/rank
→ ranking + expected_cost_usd
→ retention 0 · no prompt logs

Self-hosted by design.

Context is sensitive. RootRouter is software you run, not a service that collects your traffic.

Your prompts stay with you

The proxy and the MCP server run on your infrastructure. The provider still receives the request you send — RootRouter does not add a middleman.

Explicit storage

Context lives in a JSON store whose path you set. There is no hosted database and no RootRouter account.

No tracking

No analytics scripts, no phone-home. On-chain telemetry is optional and off by default.

Read the decision record →

Free audit

Get a free context audit.

Send one agent trace or repository. You get a token breakdown, a sample of what RootRouter would keep, and an estimate of what it would save — with the method and the numbers.

  • A token breakdown of a real request or repository.
  • A sample of what RootRouter would keep, with the reason for each pick.
  • An estimate of monthly savings, with the method written down.
Request an audit →

No commitment. One repo or one trace is enough. I run it myself.

what to send
1 · one trace (JSON) or repo URL
2 · model(s) and monthly spend
3 · the task that costs the most
reply with: tokens in, tokens kept, estimated monthly saving

FAQ

Cost, quality, data, and how it fits with the tools you already use.

In our 50-query benchmark: 43.9% fewer context tokens and 73% lower modeled cost at Claude-tier prices. A live 24-step, three-agent run showed 46% estimated context savings, and a cold repo slice can cut ~95% of the indexed corpus. Your number depends on how much history and how many files you send — the free audit estimates it on your traffic.

Start with your own numbers.

One trace or one repo is enough to see what you are re-sending and what RootRouter would cut.

Get a free context auditInstall in 5 minutes