Transparent OS-level model interception for Claude Code. Redirect any model to Google Gemini — zero config changes.
No env vars, no patches, no Claude Code modifications. Just run cmm and open Claude Code normally.
Messages, tool use, streaming, thinking blocks, images — all translated between Anthropic and Gemini formats in real-time.
Real-time streaming translation. Gemini SSE chunks are converted to Anthropic SSE events on the fly.
Certificates scoped to api.anthropic.com only. Private keys chmod 600. Clean shutdown always restores /etc/hosts.
Full bidirectional tool use translation — tool_use/tool_result mapped to functionCall/functionResponse.
No separate API key needed. Uses your existing Gemini CLI OAuth credentials automatically.
Install and log in to both CLIs:
# Claude Code (installed and logged in) claude --version # Gemini CLI (for OAuth credentials) npm install -g @google/gemini-cli gemini # Follow the OAuth login flow
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 # Terminal 2: Use Claude Code normally claude
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 | Gemini API (target model) |
| Everything else | PASSTHROUGH | Real api.anthropic.com |
| Non-messages endpoints | PASSTHROUGH | Real api.anthropic.com |