CLAUDE CODE ACTIVE
COST TRACKING ON
CLAUDE CODE COSTS
ANTHROPIC CLIREAL-TIME COST TRACKING

Claude Code
cost tracking
in real time.

Claude Code respects ANTHROPIC_BASE_URL. Point it at RelayPlane to see exactly what every session costs, per request, per model, per day.

$npm install -g @relayplane/proxy
CLAUDE CODE SESSIONLIVE
[09:12:01] Read files -> haiku
[09:12:04] Explain code -> haiku
[09:12:08] Write feature -> sonnet
[09:12:14] Fix lint errors -> haiku
[09:12:18] Refactor module -> sonnet
[09:12:23] Design system -> opus
[09:12:27] Write tests -> haiku
[09:12:30] Commit message -> haiku
✓ Session complete8 calls · $0.22 (was $1.76)
ALL OPUS$15.00/1M tokens
WITH RELAYPLANEavg $0.25/1M tokens
// ABOUT CLAUDE CODE

The AI Coding Agent You Are Already Using

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.

TYPICAL CLAUDE CODE SESSION COSTS
Quick fix (10 calls)
$2.10$0.42
Feature build (50 calls)
$10.50$2.10
Full sprint (200 calls)
$42.00$8.40
MONTHLY (active developer)
$300+~$60
80%
Average cost reduction with smart routing
<30s
Setup time from install to tracking
ZERO
MIT licensed, runs 100% locally
// QUICK START

30 Seconds to Full Visibility

Install once. Set one variable. Run claude as usual.

~/projects/my-project
# Step 1: Install the RelayPlane proxy globally
npm install -g @relayplane/proxy
# Step 2: Start the proxy (in a separate terminal or background)
relayplane-proxy --port 4100
# Step 3: Point Claude Code at the proxy and start coding
export ANTHROPIC_BASE_URL=http://localhost:4100
claude
✓ All Claude Code requests now routed through RelayPlane
# Or run it all in one line
npm install -g @relayplane/proxy && export ANTHROPIC_BASE_URL=http://localhost:4100 && claude
MAKE IT PERMANENT IN YOUR SHELL
Add to ~/.bashrc or ~/.zshrc so every Claude Code session is tracked automatically:
export ANTHROPIC_BASE_URL=http://localhost:4100
Claude Code will route through RelayPlane on every run from any directory.
// HOW IT WORKS

Three Steps. No Code Changes.

01

Install the Proxy

npm install -g @relayplane/proxy

A local proxy that runs on your machine. No cloud dependency. No data leaves your environment without opt-in. Starts in under a second.

02

Set ANTHROPIC_BASE_URL

export ANTHROPIC_BASE_URL=http://localhost:4100

Claude Code reads this variable automatically. Every API call goes through the proxy first, where it is logged and routed to the optimal model.

03

Watch Your Costs

relayplane stats

See per-request cost, model breakdown, session totals, and daily spend all stored locally in SQLite. No signup required.

80%
AVG. COST REDUCTION
30s
SETUP IN SECONDS
ZERO
CLOUD ACCOUNTS NEEDED
// FEATURES

What You Get

RelayPlane adds observability and smart routing to every Claude Code request.

Per-Request Cost Tracking

relayplane stats --today

Total spend, request count, and top models for today

relayplane stats --days 30

Monthly cost trend with daily breakdown

Complexity Routing

read file -> haiku

Simple tasks go to cheaper models automatically

architect feature -> opus

Complex reasoning escalates to the best available model

Local SQLite Dashboard

~/.relayplane/data.db

All request logs stored locally, queryable with any SQLite client

relayplane dashboard

Open the local web UI at localhost:4100/dashboard

No Cloud Account Required

telemetry: off (default)

Zero data sent to RelayPlane servers without opt-in

works with Max + API plans

Compatible with existing Anthropic subscriptions

// ROUTING MODES

Choose Your Strategy

DEFAULT

Smart Routing

relayplane:auto

Infers 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
AGGRESSIVE

Cost Priority

relayplane:cost

Always routes to the cheapest capable model. Maximum savings. Escalates automatically when a cheaper model fails or refuses.

most tasks -> haiku
# escalate on error
CONSERVATIVE

Quality Priority

relayplane:quality

Uses the best available Claude model for every request. Near-identical output to running Claude Code with no proxy at all.

everything -> opus
# no optimization
// TROUBLESHOOTING

Common Issues

Claude Code is not routing through the proxy?

Verify the environment variable is set in your current shell session:

echo $ANTHROPIC_BASE_URL
# Should output: http://localhost:4100

Proxy is not running?

Start it with verbose mode to see what is happening:

relayplane-proxy --port 4100 --verbose

Getting authentication errors?

Make sure ANTHROPIC_API_KEY is set. The proxy forwards it to Anthropic on your behalf:

export ANTHROPIC_API_KEY="sk-ant-..."

How do I verify requests are flowing through?

Check the stats endpoint while Claude Code is running:

curl http://localhost:4100/control/stats

Want to bypass the proxy for one session?

Unset the variable for that shell session only:

unset ANTHROPIC_BASE_URL && claude

Does this work with Claude Code Max subscriptions?

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
NO SIGNUP REQUIRED

Know What Claude Code Costs. Starting Now.

One variable. Local SQLite. Zero cloud dependency. Start tracking in under 30 seconds.

# Install and start tracking in one line
npm install -g @relayplane/proxy && export ANTHROPIC_BASE_URL=http://localhost:4100 && claude
100% OPEN SOURCEMIT LICENSECLAUDE CODE COMPATIBLE