Now live · Prefex

Claude Code, automatically cheaper.

Prefex is a local proxy that auto-applies proven cost-saving techniques — smart routing, prompt-cache assist, context compression, session memory — to every Claude Code request. One base_url change. No code changes, no cloud account, no prompts leaving your machines. Your team's AI spend, actually under control.

$4.61 saved this session · 34% off native
76%
spend reduction on a 7-day agentic-coding window
$3,265 actual vs $13,468 counterfactual
94%
sustained prompt-cache hit rate
$527 write cost → $25k+ read savings
<5 min
from download to live dashboard
one env var, no code changes

Real numbers from a real workload

These are measured from our own team's production traffic (heavy Claude Code use). Not benchmarks. Not averages. Early-access teams are running it now and validating on their own workloads.

$3,265 actual vs $13,468 labeled counterfactual

Prefex reports both numbers, side by side, and labels which is which. The counterfactual is what the same requests would have cost without any proxy-level optimization — routed direct to the model at full input rate, no cache assist, no compression, no routing. The incremental savings beyond what native prompt caching alone would give you are reported separately ($249 for that week) — so you always know whether Prefex is earning its keep or just taking credit for the provider's caching.

Savings depend on workload. Prefex publishes its methodology; you can audit every figure in the dashboard.

$527 in cache-write costs, $25k+ in cache-read savings

Prompt-cache writes cost real money (1.25× input rate). Most teams can't see whether warming pays off — they just see a higher bill. Prefex instruments every write and every read, shows you the cost side of its own ledger, and keeps the cache warm so hits stay above 90%. The net ROI is visible in the dashboard on day one.

Under 5 minutes from first install to seeing live traffic

One install command. One env var in Claude Code's settings. No cloud account, no SDK change, no code review required. Everything — the binary, the SQLite store, the dashboard — runs on the developer's machine. Your prompts go from the developer's machine directly to Anthropic. Nothing transits Prefex's servers. That's not a privacy policy; it's an architectural fact you can verify with a network trace.

Prefex vs. the alternatives

Watch the billing dashboardobservation only
Billing consoles show spend after it happened, aggregated per API key — they can't attribute waste to a cause, and they can't prevent it. Prefex acts on each request before the tokens are billed and attributes savings per mechanism and per developer. Detection vs. control.
Build a homegrown proxyDIY route
Teams that build their own get logging in a week, then spend months on the hard parts: cache-boundary-safe compression, cache warming, session handover, honest savings attribution, keeping up with every new model and beta header. Prefex is one env var to try and one env var to remove — cheaper than the design meeting for the homegrown version. It's also a binary you don't have to maintain.
A cloud AI gatewaySaaS optimization
Cloud gateways route your prompts — including source code and any credentials that leak into context — through a third party's infrastructure. For teams where "our code can't transit another vendor's cloud" is a hard requirement, cloud gateways are disqualified on day one. Prefex is a local binary: traffic goes from the developer's machine directly to the model provider. Nothing is sent to Prefex's servers. The security-review story is one sentence.
Point solutionscaching-only or routing-only
Caching, routing, and compression interact. A router that switches models blindly busts the prompt cache and can net out negative. A cache layer that doesn't understand compression boundaries corrupts its own prefixes. Prefex treats these as one system: routing is cache-aware, compression is cache-boundary-safe, and every layer is measured against the same baseline. Point tools optimize one variable and silently degrade another.
Honest tradeoffs: Prefex is deepest on Anthropic/Claude workloads today. It's local-first — teams wanting a centrally hosted, managed gateway aren't the fit yet. And savings depend on workload: Prefex publishes its methodology rather than promising a fixed percentage.

FAQ

What is Prefex, in one sentence?

A local-first proxy that sits behind ANTHROPIC_BASE_URL, auto-applies a dozen open-source cost-cutting techniques to every Claude Code request, and shows you the savings with receipts.

What cost-saving techniques does it actually apply?

Model routing (send simple turns to a cheaper model), prompt-cache assist (keep Anthropic's cache warm so it actually hits), context compression (JSON/log/text-aware, cache-boundary safe), and cross-session memory (skip re-explaining context you already gave it). An optional on-device encoder sharpens the routing, and a background spend watcher flags big cold cache writes, prefix flapping, and rate limits the moment they happen. All instrumented, all auto-applied, no workflow change.

What open-source ideas does this build on?

RouteLLM (explainable rules routing), headroom/Kompress (cache-safe compaction), LLMLingua-2 (token-importance trimming), Mem0 (cross-session typed memory), MemGPT/Letta (tiered context management), OpenHands (task-span focus notes), RTK (tool-output compression), ModernBERT (an on-device routing encoder), NVIDIA Switchyard (cascade routing signals, currently calibrating), and Anthropic's own native prompt cache + context editing.

Why does this need to exist?

Every week a new viral repo ships a cache trick, a router, or a compressor. Each is brilliant alone, but a pile of bolt-ons isn't a system, and none of them know about each other. Saving tokens is nobody's job at the frontier labs (more usage is their business) or on dev teams (chasing the next feature, not last month's bill). Prefex is the one place that measures everything and makes the wins compound instead of fight each other.

Do my prompts or code ever leave my machine?

No. Everything runs on localhost, no telemetry, no analytics, no external logging. See the full privacy writeup.

How do I install it, and does it work with my team?

One line: curl -fsSL https://promptforce.ai/install.sh | bash. Full setup for solo use is in the solo guide; for shared dashboards and SSO, see the team guide.

What does it cost?

Free during Early Access. Pricing isn't public yet. Enterprise and Team features are available, reach out and we'll set you up.

Does Prefex only work with Claude Code?

No. Claude Code is the flagship, but Prefex ships with prebuilt support for Codex and other OpenAI-compatible tools — in active benchmarking now to validate the savings on each. Same proxy, same layers, one base_url/config change per tool.

Why not just build our own proxy?

Teams that build their own get pass-through logging in a week — then spend months on the hard parts: cache-safe compression, prompt-cache warming and stabilization, session handover, and honest savings attribution that doesn't double-count the provider's native caching. Those are the pieces that actually move the number. Prefex ships all of that maintained, and the switching cost is one env var — so you can adopt it, or drop it, in minutes. A homegrown proxy is also a permanent maintenance tax on an engineer's calendar every time Anthropic ships a new model or changes a beta header.

How does it compare to cloud-based AI gateways?

Cloud gateways route your prompts through a third party's infrastructure. For teams where source code or customer data appears in prompts — which is most coding teams — that's a hard privacy and security question. Prefex is a local binary: your requests go from the developer's machine directly to the model provider. Nothing transits our servers. The dashboard is localhost-only. That's not a policy commitment; it's an architectural fact you can verify with a packet trace. Cloud gateways may suit teams that want a centrally managed, hosted solution; if that's the requirement, Prefex is not the right fit yet.

close ×

Get Early Access

Prefex is in Early Access, free for 60 days. Tell us where to send your install link and the occasional update.

We store your name, email, and company only to send your link and product updates. Local-first as ever: your prompts and keys never touch our servers.

You're in. Welcome aboard.

Install Prefex on macOS or Linux with one line. Windows and full instructions are in the guide.

$curl -fsSL https://promptforce.ai/install.sh | bash
Full instructions →