NeuroRouter

A local proxy between your AI coding tools and the model.

Asking an AI assistant about NeuroRouter? Give it neurorouter.dev/docs/SKILL.md.

NeuroRouter sits between Claude Code, Codex, and the model API. It keeps the live model window focused on the work that still matters: source transcript to semantic field to target-model context.

It is the answer to a very specific failure mode: one long session becomes stale, expensive, and fragile, but the operator still needs continuity. NeuroRouter preserves the active work field, repairs safe tool-chain breaks before they become upstream 400s, and nudges the agent away from dead loops before the session burns more money than progress.

NeuroRouter works on its own; it does not keep the record of the work. Hiveram, a separate Obsta Labs product, keeps that record: who asked for the work, what changed and who accepted it.

More context is not control. NeuroRouter projects the slice of work the model is allowed to act on now.

The four promises

These are what the product is built to do; the mechanisms and their limits are in the sections below.

No giant stale session, unnoticed See the dead branches the live window is dragging; trimming them is one setting, off by default.
No forced re-explanation Fresh execution sessions can start from a mission briefing or bounded context instead of replaying a transcript.
No hidden authority confusion Local shaping stays local. The record of the work lives somewhere explicit. Portable handoff stays bounded and reviewable.
Cheaper models for routine execution Plan once, then let cheaper or more specialized agents execute from the same bounded truth.

Four compiler passes

One product, one job: preserve what the next model call needs, remove what no longer carries work, and prove the result is still trustworthy.

Block detected secrets

Detected credentials, tokens, and connection strings in traffic routed through NeuroRouter are redacted or blocked locally before forwarding according to policy. Findings include rotation guidance. Secret protection is deterministic pattern matching for known credential formats; it does not claim to catch every encoding or transformation.

Extract the semantic field

The active objective, decisions, hard constraints, rejected approaches, quantities, file state, and blockers are promoted into a compact field contract. Repetition and scaffolding are allowed to fall away.

Compile for the target model

Claude, Codex, and compatible tool surfaces do not need identical transcripts. NeuroRouter emits the dialect each client can use while preserving the same load-bearing field.

Validate continuity

Session Integrity checks whether green metrics are still trustworthy. It can downgrade a perfect RCS when objective freshness, workspace identity, recovery, loop, progress, or tool-chain signals say the agent is no longer safe to continue.

Proof of continuity

The neurorouter integrity command summarizes whether sessions stayed healthy, degraded, or critical using support-safe session evidence. It reports size, RCS, anchor preservation, prevented failures, and integrity downgrades so compiler claims can be checked against real sessions instead of trusted as a demo metric.

Forked-session proof artifact

Recorded example: in the oauth-smoke-5 forked-session capture, a fresh execution branch held RCS 100 across 51 requests after the handoff. That matters because the proof is not "bigger context worked". The proof is that a fresh branch can stay structurally faithful without replaying the whole past. RCS counts detected anchors that survived; it does not measure task success or savings.

oauth-smoke-5 forked session 018486d03
51 requests. RCS 100 sustained.
Fresh branch stayed aligned without transcript replay.
No continuity downgrade after the fork.

Cache-preservation proof artifact

Recorded example, May 2026, Opus 4.7: in a 198-message Opus 4.7 session through NeuroRouter, Anthropic prompt cache hit rate stayed above 99% while context was actively shaped. Cache reads grew monotonically from 102K to 140K tokens. Cache writes per turn stayed in the hundreds. NeuroRouter shapes the suffix past the cache boundary, not the cached prefix.

session 87d04e1d — 198 messages, Opus 4.7, OAuth
cache_read:     102K → 140K (monotonic)
cache_creation: 200–5000 tokens/turn (suffix only)
input_tokens:   1–3 per turn
cache hit rate:  99%+
active shaping:  ~5% byte reduction, confined to post-breakpoint suffix

A later matched run (October 2026, Sonnet 4.6, Claude Code 2.1.302, 36 sessions through NeuroRouter) found the opposite in the 8 sessions where shaping removed bytes: the provider rebuilt 15,000 to 61,000 cached tokens per event. That is why optional shaping is observe-only by default and why the cache-safe design is on the roadmap. Both captures are kept; neither is a savings figure.

How it works

Drop-in replacement for your API endpoint.

# Claude Code
ANTHROPIC_BASE_URL=http://localhost:9120 claude

# Codex (Responses API)
neurorouter proxy --listen 127.0.0.1:9120 --client-profile codex --api-key env:OPENAI_API_KEY
codex -p nr resume SESSION_ID
codex -p nr -m gpt-5.5 resume SESSION_ID

# Codex config
[model_providers.neurorouter]
name = "NeuroRouter"
base_url = "http://127.0.0.1:9120"
openai_base_url = "http://127.0.0.1:9120"
wire_api = "responses"

[profiles.nr]
model_provider = "neurorouter"

# Other OpenAI-compatible clients
# Validate per client before claiming support.

Works with Claude Code and Codex CLI. Claude Code signs in with your Claude account; Codex currently needs an OpenAI API key. Qwen Code and other OpenAI-compatible clients are not yet verified and are not advertised as supported. Provider credentials pass through to configured upstream APIs; NeuroRouter does not phone home with request content or store provider keys on disk.

# start the proxy
neurorouter proxy --listen 127.0.0.1:9120

# see what would be shaped without sending
neurorouter proxy --listen 127.0.0.1:9120 --dry-run

Proof and mechanics

The request log shows what was sent, what was compiled away, and whether decisions, constraints, and rejected approaches survived:

Illustrative request-log line; not a recorded capture.

[req] model=gpt-5.4  context=156KB (shaped from 3732KB, 95% shaped)  rcs:100  integrity=degraded

RCS is a request-level continuity score. It is useful, but it is not the whole health model: Session Integrity can invalidate a green RCS when the active objective is stale, the workspace lock conflicts, recovery had to disable major shaping stages, or loop/progress signals say the agent is stuck. Smaller context isn't automatically better; the right context is.

Vector Lock keeps the active constraint set: objective, chosen approach, current state, hard constraints, unresolved blockers, and rejected approaches. Workspace Identity Lock keeps the allowed repo, path, and release target explicit. These are not chat memory, RAG, or learning. They are the minimal local state that lets NeuroRouter compile the next request without losing the work.

What NeuroRouter is not

Security

NeuroRouter runs locally and forwards provider credentials only to the upstream provider you configure. It does not phone home with request content or store provider keys on disk. Detected credentials are redacted or blocked before forwarding according to policy.

This is a structural difference from cloud LLM proxies. A 2026 study found 26 LLM proxy services collecting user credentials. The LiteLLM supply-chain compromise (March 2026) put credential-stealing code into a widely used LLM proxy package. A local proxy removes the hosted credential database from this path; it is not a promise to catch every encoded, chunked, or transformed secret.

When it pays for itself

NeuroRouter Pro is most useful when AI coding sessions get long, expensive, or fragile. It keeps useful context alive, reports stale transcript drag (removing it is a setting, off by default while the cache-safe design lands), protects detected secrets, repairs safe tool-chain continuity breaks before provider 400 errors, and warns when a session is no longer making trustworthy progress.

Who is paying for the tokens? The provider sells them and has no reason to shrink your request. Your client's own compaction exists to fit the window. NeuroRouter runs on your machine, so the only objective it serves is yours. Today optional history shaping reports what it would remove and does not edit by default: a matched run in October 2026 (Claude Code 2.1.302, Sonnet 4.6) found nothing to remove on short sessions and a cache-rebuild cost on long ones when it acted, so no saving is claimed until the cache-safe design below and the billed-token receipt land. Secret protection, continuity repair and the guards apply regardless.

Today nr savings reports what optional shaping would have removed, priced at the input price you configure; it is an estimate of removable context, not a saving. A per-session receipt from the provider's own billed usage, cache reads included and netted against the licence, is on the roadmap below.

It is not a replacement for the model, a hosted gateway, memory, RAG, or autonomous agent brain. It is the live-window layer in a wider stack that can also include Hiveram, a separate product, for the record of the work.

Pricing

What is not shipping yet

Pro is the available product today: it runs locally and never calls home. Governed agent fleets — where an org's agents form a network and their work is auditable to an owner-controlled sink — along with shared routing policy, session-evidence analysis, and hosted options, are in design and not shipping yet. So is a billed-token savings receipt per session and per month, from the provider's usage fields, cache reads included, netted against the licence. They are a roadmap direction, not a current offering. What is priced above is what ships today.

Cache-safe shaping, which shapes content once before the model first sees it and never edits cached history afterwards, is in design; until it lands, optional history shaping stays observe-only.

Install Pro

After checkout (or starting the 14-day trial), install the Pro build with Homebrew and activate your license key.

1. Install

macOS or Linux via the public Obsta Labs tap.

brew tap obstalabs/tap
brew install obstalabs/tap/neurorouter-pro

2. Activate

Use the license key emailed at checkout or shown on the trial start page.

nr activate <your-license-key>

3. Launch

Start the local proxy and prepare your coding agent in one command.

nr launch claude
nr launch codex

Direct download: latest Pro release. Lost your key? Email hello@obstalabs.dev.

Run it in Kubernetes

The gateway ships as a signed container image and a Helm chart, published with every release. Both are public — no registry credentials to pull them. The distribution README covers the release-archive install; the commands below install the same chart straight from the registry.

1. Pull the image

By tag, or by digest when you want the exact bytes you reviewed.

docker pull ghcr.io/obstalabs/neurorouter-pro-dist:<version>

2. Install the chart

Directly from the registry — no download step.

helm install neurorouter \
  oci://ghcr.io/obstalabs/charts/neurorouter-gateway \
  --version <version>

3. Supply credentials

Provider keys are referenced as existing Kubernetes Secrets. They are never written into chart values.

kubectl create secret generic nr-providers \
  --from-literal=<provider>=<your-key>

One instance, by design

The chart refuses a replica count other than one. Token custody depends on a single process owning session state, so a second replica would mean two processes disagreeing about whose session is whose. The chart rejects it at validation rather than accepting it and failing strangely later. If a node partition is uncertain, do not force-delete the pod until the old process is confirmed stopped.

The deployment runs as a non-root user on a read-only filesystem with no added privileges, under restricted Pod Security and a default-deny network policy. Health and metrics are served on a separate port from model traffic, so probes and dashboards never touch the endpoint your agents use.

No outbound connection required

The gateway needs no route to us to run. Licences are validated locally against a signed key: no entitlement service to call, no telemetry, no update check. For airgapped sites, the image can be mirrored into your own registry and the chart installed against that mirror with your own pull secret — nothing in that install references a public registry.

Decide the expiry behaviour before you deploy, not during an incident. By default an expired licence is refused; sites that cannot renew quickly may prefer the degrade policy instead. Mirroring steps, signature verification, and the expiry policy flag are in the offline install guide.