40–70% off your Claude bill.

One line in Claude Code settings. That's it.

Prefex is a local proxy built for Claude Code and the Anthropic API. Intelligent optimization that works invisibly — your workflow doesn't change.

$ curl -fsSL https://prefex.vercel.app/install.sh -o install.sh
$ less install.sh review
$ bash install.sh

macOS & Linux · Docker or binary · read before you run

40–70% cost reduction
<15ms added overhead
0 code changes

Install

One command. Then change one setting in your existing API client.

1.
Download and run the install script
Review it before running — it's a shell script and you should know what it does.
$ curl -fsSL https://prefex.vercel.app/install.sh -o install.sh && less install.sh
$ bash install.sh --docker
2.
Start the stack
Pulls ~2GB of images on first run (cached forever). Proxy is live on :8019 when done.
$ cd ~/.prefex && docker compose up -d
3.
Open the dashboard and configure your API key
Open the dashboard, go to Settings, and enter your Anthropic API key.
$ open http://localhost:8019/dashboard
Then add one line to ~/.claude/settings.json to route Claude Code through Prefex:
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:8019" } }

Requires Docker with Compose V2. The proxy image is ~15MB; the optimizer sidecar is ~2GB (pulled once, cached forever).

1.
Download and install the binary
Downloads the macOS binary for your architecture (arm64 or x86_64). No Docker required.
$ curl -fsSL https://prefex.vercel.app/install.sh -o install.sh && less install.sh
$ bash install.sh --binary
2.
Start Prefex
Starts in the background on :8019. Savings active immediately.
$ curl -fsSL https://prefex.vercel.app/start.sh | bash
3.
Open the dashboard and add your API key
Open the dashboard, go to Settings, and enter your Anthropic API key. Prefex will then route requests through it.
$ open http://localhost:8019/dashboard
Then add one line to ~/.claude/settings.json to route Claude Code through Prefex:
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:8019" } }

Binary mode includes core optimizations. Use Docker for the full stack.

1.
Download and install the binary
Auto-detects Docker if available; falls back to standalone binary.
$ curl -fsSL https://prefex.vercel.app/install.sh -o install.sh && less install.sh
$ bash install.sh --binary
2.
Start Prefex
$ curl -fsSL https://prefex.vercel.app/start.sh | bash
3.
Open the dashboard and add your API key
Open the dashboard, go to Settings, and enter your Anthropic API key. Prefex will then route requests through it.
$ open http://localhost:8019/dashboard
Then add one line to ~/.claude/settings.json to route Claude Code through Prefex:
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:8019" } }
1.
Download the install script
Review it before running — it's a PowerShell script and you should know what it does.
PS> iwr https://prefex.vercel.app/install.ps1 -OutFile install.ps1
PS> Get-Content install.ps1 | more
2.
Run it
Detects Docker Desktop automatically — falls back to native binary mode if not found.
PS> .\install.ps1
3.
Open the dashboard and add your API key
Open the dashboard, go to Settings, and enter your Anthropic API key.
PS> Start-Process http://localhost:8019/dashboard
Then add one line to %USERPROFILE%\.claude\settings.json to route Claude Code through Prefex:
{ "env": { "ANTHROPIC_BASE_URL": "http://localhost:8019" } }
To stop Prefex: cd $env:USERPROFILE\.prefex; docker compose down (Docker) or .\stop.ps1 (binary).

What you actually save

Real numbers from Claude Code usage over a typical 8-hour dev session.

Scenario Without Prefex With Prefex Saving
Claude Code — daily session ~$4.20 ~$1.40 $2.80 / day
Claude Code — heavy refactoring day ~$12.00 ~$4.80 $7.20 / day
Claude agent — 100 runs/day ~$80 ~$30 $50 / day
Claude API — batch processing 10k docs ~$200 ~$90 $110 / run

See it yourself — run the benchmark

5 code-review questions on public code, run twice — cold then warm. Costs ~$0.02–0.05 total.

1.
Download & review the script
Uses the Claude CLI — no API key export needed. Runs 3 rounds: Prefex cold, Prefex warm, direct baseline.
$ curl -fsSL https://prefex.vercel.app/prefex-bench.sh -o prefex-bench.sh && less prefex-bench.sh
2.
Run it (Prefex must be running)
Requires: claude CLI, python3. Backs up settings, runs benchmark, restores on exit.
$ bash prefex-bench.sh
1.
Download & review the script
Uses the Claude CLI — no API key export needed. Same benchmark as the macOS/Linux version.
PS> iwr https://prefex.vercel.app/prefex-bench.ps1 -OutFile prefex-bench.ps1
PS> Get-Content prefex-bench.ps1 | more
2.
Run it (Prefex must be running)
Requires: claude CLI. Backs up settings, runs benchmark, restores on exit.
PS> .\prefex-bench.ps1
Round Requests Total input tokens Cached tokens Actual cost Saved % saved
Round 1 — cold 5 ~37 000 0 ~$0.042
Round 2 — warm 5 ~37 000 ~34 000 ~$0.005 ~$0.037 ~88%

Costs are read from Anthropic's own billing fields in the SSE stream — not computed by Prefex. Corpus: karpathy/nanoGPT@3adf61e (public, deterministic).

Connect your client

Change one value. Everything else stays the same.

Claude Code
# ~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://localhost:8019"  ← add this
  }
}
Python (Anthropic SDK)
import anthropic

client = anthropic.Anthropic(
    api_key="sk-ant-...",
    base_url="http://localhost:8019",  ← add this
)
Node.js (Anthropic SDK)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: "sk-ant-...",
  baseURL: "http://localhost:8019",  // ← add this
});
cURL
curl http://localhost:8019/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-4-6","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}'

Your prompts never leave your machine.

Prefex runs entirely on localhost. There is no telemetry, no analytics, no external logging service. If any internal component fails — requests pass through to the upstream API unchanged. Prefex never blocks a request because of its own failure.

Verify it yourself with tcpdump:

# All outbound traffic from Prefex should go only to api.anthropic.com
sudo tcpdump -i any -n 'dst port 443' 2>/dev/null | grep -v api.anthropic.com
Full privacy and data handling details →

Download, review, run. Savings from the first request.

$ curl -fsSL https://prefex.vercel.app/install.sh -o install.sh
$ less install.sh review
$ bash install.sh
github.com/PromptForcePrime/prefex →

Uninstall / restore

Stop Prefex and point Claude Code back to Anthropic directly.

macOS / Linux — one command:

$ curl -fsSL https://prefex.vercel.app/uninstall.sh | bash

Add --purge to also delete ~/.prefex (logs, cache, config).

Windows (PowerShell):

PS> iwr https://prefex.vercel.app/uninstall.ps1 -OutFile uninstall.ps1; .\uninstall.ps1

Add -purge to also delete %USERPROFILE%\.prefex (logs, cache, config).

Manually restore ~/.claude/settings.json:

Remove or change the ANTHROPIC_BASE_URL entry back to https://api.anthropic.com:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.anthropic.com"
  }
}

Then restart Claude Code. If you had no settings.json before installing Prefex, you can delete the file entirely.

Full cleanup (remove all Prefex data):

$ curl -fsSL https://prefex.vercel.app/uninstall.sh | bash -s -- --purge

Windows: .\uninstall.ps1 -purge

Stops containers, removes the binary, restores settings, and deletes ~/.prefex.