Transparent OS-level model interception for Claude Code. Redirect any model via CLIProxyAPI — zero config changes.
No env vars, no patches, no Claude Code modifications. Just run cmm and open Claude Code normally.
Anthropic-format requests forwarded directly to CLIProxyAPI. No translation layer — maximum compatibility.
Real-time streaming with backpressure support. 429 rate-limit auto-retry with intelligent delay parsing.
Certificates scoped to api.anthropic.com only. Private keys chmod 600. Clean shutdown always restores /etc/hosts.
Prefix-based model matching. Intercepted models go to CLIProxyAPI, everything else passes through untouched.
Built-in CLI for proxy settings. cmm config set PROXY_API_KEY sk-... — no file editing needed.
Run as a macOS launchd daemon. Auto-starts on boot, auto-restarts on crash. No terminal window needed.
Install Claude Code and have CLIProxyAPI running:
# Claude Code (installed and logged in) claude --version # CLIProxyAPI running on localhost:8317
npm install -g claude-model-mapping
Generate certificates and trust them in macOS Keychain:
cmm setup
Open a new terminal after setup.
# Terminal 1: Start cmm sudo cmm claude-haiku-4-5 gemini-2.5-flash # Or set defaults and just run: sudo cmm cmm config set DEFAULT_SOURCE_MODEL claude-haiku-4-5 cmm config set DEFAULT_TARGET_MODEL gemini-2.5-flash sudo cmm # Terminal 2: Use Claude Code normally claude
Run cmm as a macOS launchd daemon — no terminal window required.
Creates a LaunchDaemon that auto-starts on boot and auto-restarts on crash.
sudo cmm service install claude-haiku-4-5 gemini-2.5-flash
# Check status sudo cmm service status # Stop / start / restart sudo cmm service stop sudo cmm service start sudo cmm service restart
Stops the service and removes the LaunchDaemon plist.
sudo cmm service uninstall
Model names use prefix matching — claude-haiku-4-5 catches claude-haiku-4-5-20251001 too.
| Request Model | Behavior | Destination |
|---|---|---|
claude-haiku-4-5* |
INTERCEPTED | CLIProxyAPI (target model) |
| Everything else | PASSTHROUGH | Real api.anthropic.com |
| Non-messages endpoints | PASSTHROUGH | Real api.anthropic.com |