Claude Code is Anthropic's official agentic coding CLI. It reads your codebase, writes and edits files, runs commands, and works through complex tasks autonomously. Developers are racking up hundreds of dollars per month in API costs without realizing it.
Claude Code reads the ANTHROPIC_BASE_URL environment variable. Set it to your local RelayPlane proxy and every request gets logged, routed, and priced in real time. No code changes. No config files. Just one export.
Install once. Set one variable. Run claude as usual.
npm install -g @relayplane/proxy && export ANTHROPIC_BASE_URL=http://localhost:4100 && claudeexport ANTHROPIC_BASE_URL=http://localhost:4100npm install -g @relayplane/proxyA local proxy that runs on your machine. No cloud dependency. No data leaves your environment without opt-in. Starts in under a second.
export ANTHROPIC_BASE_URL=http://localhost:4100Claude Code reads this variable automatically. Every API call goes through the proxy first, where it is logged and routed to the optimal model.
relayplane statsSee per-request cost, model breakdown, session totals, and daily spend all stored locally in SQLite. No signup required.
RelayPlane adds observability and smart routing to every Claude Code request.
relayplane stats --todayTotal spend, request count, and top models for today
relayplane stats --days 30Monthly cost trend with daily breakdown
read file -> haikuSimple tasks go to cheaper models automatically
architect feature -> opusComplex reasoning escalates to the best available model
~/.relayplane/data.dbAll request logs stored locally, queryable with any SQLite client
relayplane dashboardOpen the local web UI at localhost:4100/dashboard
telemetry: off (default)Zero data sent to RelayPlane servers without opt-in
works with Max + API plansCompatible with existing Anthropic subscriptions
relayplane:autoInfers task complexity from the Claude Code prompt. File reads and edits go to Haiku. Architecture and refactors go to Sonnet or Opus.
read files -> haiku write feature -> sonnet
relayplane:costAlways routes to the cheapest capable model. Maximum savings. Escalates automatically when a cheaper model fails or refuses.
most tasks -> haiku # escalate on error
relayplane:qualityUses the best available Claude model for every request. Near-identical output to running Claude Code with no proxy at all.
everything -> opus # no optimization
Verify the environment variable is set in your current shell session:
echo $ANTHROPIC_BASE_URL # Should output: http://localhost:4100
Start it with verbose mode to see what is happening:
relayplane-proxy --port 4100 --verbose
Make sure ANTHROPIC_API_KEY is set. The proxy forwards it to Anthropic on your behalf:
export ANTHROPIC_API_KEY="sk-ant-..."
Check the stats endpoint while Claude Code is running:
curl http://localhost:4100/control/stats
Unset the variable for that shell session only:
unset ANTHROPIC_BASE_URL && claude
Yes. RelayPlane sits between Claude Code and Anthropic. It forwards your credentials and adds routing on top. Max and API subscriptions both work.
# No special config needed for Max plans export ANTHROPIC_BASE_URL=http://localhost:4100
One variable. Local SQLite. Zero cloud dependency. Start tracking in under 30 seconds.
npm install -g @relayplane/proxy && export ANTHROPIC_BASE_URL=http://localhost:4100 && claude