One-line install that adds the gclaude helper to your shell and sets up the proxy runner:
curl -fsSL https://raw.githubusercontent.com/ankurkakroo2/claudecode-antigravity-auth/main/scripts/install.sh | bashAfter install:
- Initialize OAuth + model mappings:
gclaude init - Run Claude Code with auto-starting proxy:
gclaude "your prompt"
You can also install the helper manually with:
gclaude install-shellThe shell helper is named gclaude. It routes gclaude start|stop|status|... to the
server CLI, and treats everything else as a Claude Code invocation. For explicit CLI
help, use gclaude cli --help.
This proxy is Antigravity-only (Google OAuth). No Gemini API key is supported or required.
- Clone and enter the repo
git clone <your-repo-url> cd <repo-directory>
- Create a virtual environment and install dependencies
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt pip install -e .
- Run OAuth setup + model detection
python -m gclaude init
- Install the shell helper (auto-starts proxy)
gclaude install-shell source ~/.zshrc # or ~/.bashrc
- Run Claude Code via the helper
gclaude "ping" - Verify
opencode run -m google/antigravity-claude-sonnet-4-5-thinking "ping" opencode run -m google/antigravity-claude-opus-4-5-thinking "ping" gclaude -p --model sonnet "ping" gclaude -p --model opus "ping"
Project docs live in docs/:
docs/LLD.md(low-level design / architecture)docs/IMPLEMENTATION_PLAN.md(current plan)docs/RUNNING_NOTES.md(live progress + fixes + remaining issues)
Older notes were moved to .archived/.
gclaude provides:
- OAuth authentication (PKCE) for Antigravity
- Model detection and interactive mapping
- Start/stop/status/logs for the proxy
See the gclaude CLI section for full commands and config paths.
This server bridges Claude Code with Antigravity (Google OAuth). It translates requests from Anthropic's Messages API format into the Antigravity API and converts responses back so Claude Code can work seamlessly.
- Antigravity OAuth (Google AI Pro): Use Claude Sonnet/Opus via Google OAuth.
- Claude Code Compatibility: Works with Claude Code CLI and its tool-call format.
- Model Mapping: Maps Claude Code aliases (
haiku,sonnet,opus) to Antigravity model IDs. - Streaming Support: Handles streaming responses with retries for malformed chunks.
- Tool Use Translation: Converts Claude tool calls to Antigravity function schemas.
- Token Counting:
/v1/messages/count_tokensendpoint compatible with Claude Code. - Diagnostics:
/healthand/antigravity-statusfor troubleshooting.
- Python 3.8+.
- Claude Code CLI installed (e.g.,
npm install -g @anthropic-ai/claude-code). - Google AI Pro subscription (OAuth / Antigravity).
- Optional: OpenCode CLI (
opencode) for quick verification.
-
Use the shell helper (recommended):
gclaudeauto-starts the proxy, writes~/.claude/antigravity-settings.json, and uses~/.claude/mcp_config.jsonif present.gclaude "summarize my repo"If Claude Code asks for a token, set
ANTHROPIC_AUTH_TOKENto any dummy value. -
Manual mode (optional):
claude --settings ~/.claude/antigravity-settings.jsongclaude initgenerates~/.claude/antigravity-settings.jsonautomatically. -
Quick non-interactive test
gclaude -p --model sonnet "ping" gclaude -p --model opus "ping"
- Claude Code sends Anthropic-format requests to the proxy (
http://localhost:8082). - The proxy maps Claude model aliases to Antigravity model IDs.
- Requests are translated to the Antigravity API format and sent with OAuth.
- Responses are converted back to Anthropic format and returned to Claude Code.
Model aliases map to Antigravity models:
ANTIGRAVITY_HAIKU_MODEL(default:antigravity-gemini-3-flash)ANTIGRAVITY_SONNET_MODEL(default:antigravity-claude-sonnet-4-5-thinking)ANTIGRAVITY_OPUS_MODEL(default:antigravity-claude-opus-4-5-thinking)
If Claude Code requests a full antigravity-* model ID, the proxy will use it directly.
POST /v1/messages: Claude Code messages endpoint.POST /v1/messages/count_tokens: Token count estimation using local model metadata.GET /health: Health status, streaming settings, and Antigravity status.GET /antigravity-status: OAuth account + quota status.GET /: Root endpoint with configuration summary.
Streaming Errors (malformed chunks):
- The proxy retries malformed chunk parsing automatically.
- Set
FORCE_DISABLE_STREAMING=trueif you need a temporary fallback.
Connection Timeouts:
- Increase
REQUEST_TIMEOUTif you see frequent timeouts. - Check network connectivity and firewall settings.
Rate Limiting:
- Check
python -m gclaude statusor/antigravity-statusfor quota info.
Antigravity OAuth Issues:
- Re-run
python -m gclaude initif you see auth or token errors.
Logs show request routing, retries, and conversion details. Adjust verbosity with LOG_LEVEL:
DEBUG: Detailed request/response loggingINFO: General operation loggingWARNING: Error recovery notifications (recommended)ERROR: Only errors and failures
- Use
ANTIGRAVITY_*model IDs that match your access. - Keep streaming enabled for interactive output; the proxy handles retries.
- Increase
REQUEST_TIMEOUTfor large requests. - Adjust
MAX_STREAMING_RETRIESfor unstable networks.
Contributions, issues, and feature requests are welcome.
Areas where contributions are especially valuable:
- Antigravity model routing improvements
- Error recovery strategies
- Documentation improvements
pip install -e .# Initialize with guided setup
python -m gclaude init
# Start the proxy
python -m gclaude start
# Check status
python -m gclaude status
# View logs
python -m gclaude logs
# Follow logs live
python -m gclaude logs -fModel Detection: Automatically detects which Antigravity models are available to your account.
Interactive Mapping: Select which models to use for haiku/sonnet/opus requests based on your access.
OAuth Management: Add, remove, and list Antigravity OAuth accounts.
Status Dashboard: Terminal UI showing proxy status, auth state, and model routes.
| File | Location |
|---|---|
| Config | ~/.gclaude/config.json |
| OAuth Tokens | ~/.config/gclaude/antigravity-accounts.json |
| Logs | ~/.gclaude/logs/proxy.log |
| Claude Code Pattern | Antigravity Model | Description |
|---|---|---|
*haiku* |
antigravity-gemini-3-flash |
Fast & efficient - Best for haiku requests |
*sonnet* |
antigravity-claude-sonnet-4-5-thinking |
Extended reasoning - For complex tasks |
*opus* |
antigravity-claude-opus-4-5-thinking |
Advanced reasoning - Best for opus requests |
Full list of available Antigravity models:
| Model ID | Name | Description |
|---|---|---|
antigravity-gemini-3-flash |
Gemini 3 Flash | Fast & efficient - Best for haiku requests |
antigravity-gemini-3-pro-low |
Gemini 3 Pro Low | Faster responses with less thinking |
antigravity-gemini-3-pro-high |
Gemini 3 Pro High | Deeper reasoning with more thinking |
antigravity-claude-sonnet-4-5 |
Claude Sonnet 4.5 | Balanced capability - Good for general coding |
antigravity-claude-sonnet-4-5-thinking |
Claude Sonnet 4.5 (Thinking) | Extended reasoning - For complex tasks |
antigravity-claude-opus-4-5-thinking |
Claude Opus 4.5 (Thinking) | Advanced reasoning - Best for opus requests |
antigravity-gpt-oss-120b-medium |
GPT-OSS 120B Medium | Open source alternative - Medium capability |
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────────────┐
│ Claude Code │────▶│ gclaude Proxy │────▶│ Antigravity API │
│ (claude cli) │ │ (localhost:8082)│ │ (Google OAuth) │
└─────────────────┘ └──────────────────┘ └─────────────────────────┘
Request Flow:
- Claude Code sends Anthropic-format requests to
http://localhost:8082 - Proxy translates to Antigravity format and routes via OAuth
- Responses are translated back to Anthropic format for Claude Code