# Show HN: Prefex bundles 15 viral token saver repos into local no telemetry proxy

> Source: <https://github.com/PromptForcePrime/prefex>
> Published: 2026-07-24 03:37:17+00:00



```
██████╗ ██████╗ ███████╗███████╗███████╗██╗  ██╗
██╔══██╗██╔══██╗██╔════╝██╔════╝██╔════╝╚██╗██╔╝
██████╔╝██████╔╝█████╗  █████╗  █████╗   ╚███╔╝ 
██╔═══╝ ██╔══██╗██╔══╝  ██╔══╝  ██╔══╝   ██╔██╗ 
██║     ██║  ██║███████╗██║     ███████╗██╔╝ ██╗
╚═╝     ╚═╝  ╚═╝╚══════╝╚═╝     ╚══════╝╚═╝  ╚═╝
```

 |

**Spend less on Claude, with receipts.**

Prefex is a local-first proxy for Claude Code and the Anthropic / OpenAI APIs. The best ideas for cutting
LLM cost go viral one at a time, scattered across the ecosystem as sidecars, plugins, and cloud services.
Prefex distills a dozen of them, rebuilds each one natively in Go, and stacks them into a single
self-contained binary that runs behind one `base_url`

change. No code changes, no data leaving your
machine, and an honest dashboard that shows what Prefex actually saved you beyond the native prompt
caching you already get for free.

Claude Code is the flagship, but Prefex is client-agnostic: it ships with **prebuilt support for
Codex and other OpenAI-compatible tools** (via the OpenAI Chat and Responses APIs), currently in
active benchmarking. Any client that lets you set a custom base URL works today.

Prefex is a [Promptforce.ai](https://promptforce.ai) product. Promptforce.ai is a Day Two AI company.

Prefex is in

Early Access: free for 60 days, no obligation. Get your install link at[promptforce.ai].

```
# macOS / Linux. Download the script and review it before running.
curl -fsSL https://promptforce.ai/install.sh -o install.sh
less install.sh
bash install.sh
# Windows PowerShell
iwr https://promptforce.ai/install.ps1 -OutFile install.ps1; .\install.ps1
```

We do not do `curl | bash`

. Download the script, read it, then decide. The installer starts Prefex on
`:8019`

, connects Claude Code, and is reversible with `prefex stop`

or the uninstaller.

Then point your client at it:

```
// Claude Code: ~/.claude/settings.json
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:8019" } }
```

Dashboard: [http://localhost:8019/dashboard](http://localhost:8019/dashboard)

A dozen-plus optimizations across eight layers, in one binary:

**Smart routing**: an explainable rules router sends simple turns to a cheaper model and keeps the hard ones on the strong one. You set the threshold.**Prompt-cache assist**: prefix detection, a cache warmer, and prefix-stabilization keep your cached context hot, extending the native prompt cache further than it goes alone.**Compression**: lossless-first compaction of tool output, logs, and JSON. Cache-boundary-safe and recoverable. Never lossy on code.** Cross-session memory**: typed facts extracted from your sessions and re-injected by project, so a new session starts with what the last one learned.**Spend guardrails**: token traps, loop guards, think-caps, and lean reasoning catch runaway turns before they bill.** Receipts and coaching**: savings attributed per mechanism, in honest incremental terms, then surfaced inline as you work so the numbers actually change how you spend.**Encoder routing**(optional): an on-device ONNX encoder — a frozen ModernBERT trunk that runs fully offline — scores prompt complexity for sharper routing than rules alone. Opt-in, default-off.**Spend watcher**: a background sentinel reads the live request stream and flags the expensive stuff the moment it happens — big cold cache writes, prefix flapping, rate limits, spend spikes — to your status line and dashboard.

Every layer is independent and fail-open. If any component errors, the request passes straight through to the upstream API unchanged.

There is no honest fixed percentage. It depends entirely on your workload, so Prefex shows you two numbers and is clear about which is which:

**Saved by Prefex**(the headline): what routing, trimming, and guardrails added*beyond*the native prompt caching Claude Code already gives you for free.**vs no optimization at all**(a labeled counterfactual): every token repriced at full strong-model rate with no caching discount. The bigger number, shown only for context.

Costs are read from the provider's own billing fields, not computed by Prefex. Don't trust a headline number, including ours; check your own dashboard, request by request.

Anything that lets you set a custom API base URL works out of the box.

| Tool | How to connect |
|---|---|
| Claude Code | `ANTHROPIC_BASE_URL` in `~/.claude/settings.json` (auto-configured by the installer) |
| Cursor | `ANTHROPIC_BASE_URL` env var in your shell |
| Continue.dev | `apiBase` per model in `~/.continue/config.json` |
| Aider | `--api-base http://localhost:8019` |
| Codex CLI | `prefex wrap codex` (routes this session only) |
| Python / Node SDK | `base_url="http://localhost:8019"` |

**Fail open.** Internal errors never block a request. On bad input, a missing dependency, or a slow path, Prefex logs and forwards upstream unchanged.**Binary, not source.** One CGO-free Go binary. No runtime fan-out of processes, no sidecar to supervise. Trained weights are the one exception, behind an opt-in, default-off seam (see Attribution).**Your keys stay home.** Everything runs on localhost. No telemetry, no analytics, no external logging. The dashboard has no auth because nothing can reach it but you.

Verify it yourself:

```
# All outbound traffic should go only to api.anthropic.com / api.openai.com
sudo tcpdump -i any -n 'dst port 443' 2>/dev/null | grep -v api.anthropic.com
```

Prefex is a **distillery**: we study the best ideas in AI tooling and re-author the *algorithm* natively
in Go, inside our own principles. Copyright protects code, not ideas, so for the projects below **no
source code is copied into Prefex**: these are courtesy credits, not license obligations. We name them
because the ideas are theirs and the credit should be too.

| Source | The idea we learned from | License |
|---|---|---|
|

[NVIDIA Switchyard](https://github.com/NVIDIA-NeMo/Switchyard)[LLMLingua / LLMLingua-2](https://github.com/microsoft/LLMLingua)[caveman-compression](https://github.com/wilpel/caveman-compression)[RTK](https://github.com/rtk-ai/rtk)[headroom](https://github.com/headroomlabs-ai/headroom)[Mem0](https://github.com/mem0ai/mem0)[MemGPT / Letta](https://github.com/letta-ai/letta)[OpenHands](https://github.com/All-Hands-AI/OpenHands)[GraphRAG](https://github.com/microsoft/graphrag)[vLLM](https://github.com/vllm-project/vllm)/[Ollama](https://github.com/ollama/ollama)ReadyBase (also known as code-drift), the co-change and blast-radius graph that gates code compaction, is a sister Promptforce project.

The one place Prefex distributes or runs third-party code and weights is the **optional, default-off
Kompress text-compaction sidecar** (the "headroom" model track). It runs out of process; the Go binary
stays model-free and fails open if the sidecar is absent. These obligations apply **only if you opt into
the sidecar** (`compression.kompress: true`

). See [ NOTICE](/PromptForcePrime/prefex/blob/main/NOTICE) and

`deploy/kompress-sidecar/`

.| Component | Role | License |
|---|---|---|
|
The keep/drop model + ONNX inference our sidecar runs (headroom's algorithms are reimplemented in Go and credited above; this entry is the model) |
Apache-2.0 |
`chopratejas/kompress-v2-base` |

[ModernBERT](https://github.com/AnswerDotAI/ModernBERT)[ONNX Runtime](https://github.com/microsoft/onnxruntime)[Hugging Face Transformers](https://github.com/huggingface/transformers)**Bundled Go libraries.** The Prefex binary itself links three third-party Go modules:
[go-redis](https://github.com/redis/go-redis) (BSD-2-Clause), [yaml.v3](https://github.com/go-yaml/yaml)
(MIT and Apache-2.0), and [modernc.org/sqlite](https://gitlab.com/cznic/sqlite) (BSD-3-Clause). The full
set of 22 bundled modules (direct and transitive) is in
[ THIRD_PARTY_LICENSES.md](/PromptForcePrime/prefex/blob/main/THIRD_PARTY_LICENSES.md); see also

[.](/PromptForcePrime/prefex/blob/main/NOTICE)

`NOTICE`

If we have miscredited or mislabeled anything, please open an issue and we will correct it.

Prefex is distributed as a binary, in Beta, provided as-is with no warranty. Source code is not included
in this repository (binary releases only). Early Access is free for 60 days; Pro and Team plans are
available on request at [contact@daytwoai.com](mailto:contact@daytwoai.com).

Third-party components bundled or invoked by the optional sidecar retain their own licenses, recorded in
[ NOTICE](/PromptForcePrime/prefex/blob/main/NOTICE).

Day Two AI is an Anthropic partner. **Prefex is built independently, with no Anthropic participation,
funding, or endorsement.** It is not an Anthropic product and is not affiliated with Anthropic. "Claude"
and "Anthropic" are trademarks of Anthropic; they are used here only to describe interoperability. Prefex
sits in front of the Anthropic API as a local proxy and never sends your prompts or keys anywhere but the
provider you are already calling.
