Claude Code gives you zero per-session cost data. You find out when the bill arrives.
A looping agent can exhaust your daily Opus allowance in minutes. There's no kill switch.
Max plan subscribers on the API tier have no native spend limit. Overnight tasks run until they're done, or your card is.
RelayPlane fixes all three. It sits between Claude Code and Anthropic's API. One environment variable. No code changes.
See exactly what each Claude Code request costs in real-time, right in your terminal. No more surprise bills.
RelayPlane detects agents looping on the same task and alerts you before they exhaust your Opus quota.
Set a hard spending limit per session, per day, or per project. Requests stop cleanly when the budget is hit. Nothing burns while you sleep.
One command. No config required to start.
Runs on port 4100. Proxies to Anthropic transparently.
Set ANTHROPIC_BASE_URL in your shell. Your existing ANTHROPIC_API_KEY stays the same, RelayPlane forwards it to Anthropic.
Or configure via relayplane.yaml:
# relayplane.yaml
proxy:
port: 4100
upstream: https://api.anthropic.com
routing:
provider: anthropic
claude_code: true
cost:
ticker: true # live cost in terminal
stuck_agent_ms: 30000 # alert if agent loops >30s
budget:
session: 5.00 # $5 per claude session
daily: 20.00 # $20/day hard capAdd ANTHROPIC_BASE_URL=http://localhost:4100 to ~/.zshrc / ~/.bashrc to persist across sessions.
That's it. Claude Code now routes through RelayPlane. Run relayplane stats to see your live cost ticker.
RelayPlane classifies each request before it hits Anthropic. Simple tasks go to Sonnet. Complex work stays on Opus. No config needed.
Max plans don't include Haiku. Sonnet is the cheapest model you have access to. RelayPlane routes everything that doesn't need Opus to Sonnet, which draws from its own separate rate limit pool. Opus quota stays untouched until the work actually needs it. Your plan goes further. You hit the wall less often.
API key users: RelayPlane routes simple tasks to Haiku (~$0.001/req) and saves Sonnet for medium complexity. Direct cost reduction per request.
Circuit breaker included. If RelayPlane goes down, Claude Code talks directly to Anthropic. No downtime, no disruption. Your ANTHROPIC_API_KEY is forwarded directly. RelayPlane never stores it.
$6k+ in routing savings on $620 of tracked spend, processing 10k requests per week. From a single account running Claude Code for agentic coding across a production codebase.