Route Claude Code requests through Gemini CLI authentication using a lightweight local compatibility proxy. No separate Gemini API key required. Zero npm dependencies.
export ANTHROPIC_BASE_URL="http://localhost:8099" && claude
CodeWeaver intercepts outgoing Anthropic client schemas, normalizes function declarations to Vertex AI specification, and translates incoming chunks into Server-Sent Events.
{
"model": "claude-3-5-sonnet-20241022",
"tools": [{
"name": "read_file",
"description": "Read repository file",
"input_schema": {
"type": "object",
"properties": {
"path": { "type": "string" }
}
}
}],
"stream": true
}
{
"contents": [...],
"tools": [{
"functionDeclarations": [{
"name": "read_file",
"description": "Read repository file",
"parameters": {
"type": "OBJECT",
"properties": {
"path": { "type": "STRING" }
}
}
}]
}]
}
No external cloud dependencies, no intermediate telemetry, and no complex configuration files required.
Implemented purely with Node.js built-in modules (`http`, `crypto`, `fs`, `path`). Fast startup, negligible memory overhead, and no supply-chain risks.
Extracts and refreshes OAuth access credentials directly from your existing Google Gemini CLI configuration (`~/.pi/agent/auth.json` or local token store).
Maps Gemini streaming chunks into Anthropic `content_block_delta` Server-Sent Events, ensuring interactive typing animations in Claude Code remain fluid.
Requests targeting Anthropic model strings are automatically routed to the corresponding Gemini model tiers.
| Claude Code Model Request | Translated Gemini Target | Capability | Status |
|---|---|---|---|
| claude-3-5-sonnet-* | gemini-2.5-pro | Deep reasoning, code generation, tool calls | Supported |
| claude-3-5-haiku-* | gemini-2.5-flash | Fast context retrieval, file summarization | Supported |
| claude-3-opus-* | gemini-2.5-pro (Stripped Tools) | Safety classifier bypass & subagent routines | Supported |
Ensure you have Node.js 18+ and an authenticated Gemini CLI session on your machine.
Clone the lightweight repository to your local development environment.
git clone https://github.com/sooraj-makala/CodeWeaver.git && cd CodeWeaver
Runs the local HTTP daemon on port 8099 with zero dependency installation needed.
node proxy.js
Direct Claude Code to route requests through the local proxy endpoint.
export ANTHROPIC_BASE_URL="http://localhost:8099" && export ANTHROPIC_API_KEY="dummy" && claude