Use Claude Code CLI for free through Google's Antigravity (Cloud Code Assist) subscription.
A lightweight local proxy that bridges Claude Code CLI ↔ Google Cloud Code Assist API, giving you access to Claude Opus 4.6 and Claude Sonnet 4.5 — no Anthropic API key needed.
┌──────────────┐ ┌─────────────────┐ ┌──────────────────────────┐
│ Claude Code │────▶│ Local Proxy │────▶│ Google Cloud Code Assist│
│ CLI │◀────│ (localhost:51200)│◀────│ (Antigravity API) │
└──────────────┘ └─────────────────┘ └──────────────────────────┘
Anthropic API Translates Has Claude models via
format formats Google subscription
The proxy intercepts Claude Code CLI requests, translates them from Anthropic's format to Google's Cloud Code Assist API, and returns the responses in the format Claude Code expects. This works because Google's Antigravity/Code Assist subscription includes access to Claude models.
- Node.js 18+ — Download
- Claude Code CLI —
npm install -g @anthropic-ai/claude-code - Google Account with Antigravity IDE Ultra or Google One AI Premium subscription
git clone https://github.com/SovranAMR/claude-code-via-antigravity.git
cd claude-code-via-antigravitynode setup.mjs loginThis opens your browser for Google OAuth. Sign in with the account that has the Antigravity/AI Premium subscription.
Linux / macOS:
./start.shWindows (PowerShell):
.\start.ps1Windows (double-click):
Just double-click start.bat
That's it! Claude Code CLI opens with full access to Claude models. 🚀
| Model | Description |
|---|---|
claude-opus-4-6-thinking |
Most capable, with extended thinking |
claude-sonnet-4-5 |
Fast and capable |
claude-sonnet-4-5-thinking |
Sonnet with thinking |
All Claude Code model requests are automatically mapped to the best available model.
Fully supported. Desktop shortcut included:
# Copy desktop shortcut
cp claude-free.desktop ~/.local/share/applications/
# Edit the Exec line to point to your start.sh path:
sed -i "s|%SCRIPT_DIR%|$(pwd)|g" ~/.local/share/applications/claude-free.desktopFully supported via start.sh. You can also create an Automator app for dock access.
Fully supported via PowerShell (start.ps1) or batch file (start.bat).
Requirements:
- Node.js for Windows
- Claude Code CLI (
npm install -g @anthropic-ai/claude-code) - Windows Terminal recommended
| Variable | Default | Description |
|---|---|---|
PROXY_PORT |
51200 |
Port for the local proxy |
ANTHROPIC_BASE_URL |
http://localhost:51200 |
Set automatically by launcher |
ANTHROPIC_API_KEY |
claude-code-via-antigravity |
Set automatically (any value works) |
The proxy writes logs to a file instead of the terminal to keep Claude Code's UI clean:
- Linux/macOS:
~/.claude-code-via-antigravity-proxy.log - Windows:
%USERPROFILE%\.claude-code-via-antigravity-proxy.log
Watch logs in real-time:
tail -f ~/.claude-code-via-antigravity-proxy.logTokens are automatically refreshed by the proxy. If you encounter auth errors:
node setup.mjs refreshclaude-code-via-antigravity/
├── proxy.mjs # Local proxy server (Anthropic ↔ Google translation)
├── setup.mjs # OAuth authentication & credential setup
├── start.sh # Linux/macOS launcher
├── start.ps1 # Windows PowerShell launcher
├── start.bat # Windows batch launcher
├── claude-free.desktop # Linux desktop shortcut
├── LICENSE # MIT
└── README.md
- Message Conversion: Translates Anthropic's Messages API format to Google's
streamGenerateContentformat - Tool Schema Sanitization: Strips unsupported JSON Schema fields (
anyOf,oneOf,$schema), flattens complex types, and ensures all schemas have atypefield - Streaming: Converts Google's SSE stream to Anthropic's SSE stream format in real-time
- Role Alternation: Enforces Google's
user→model→user→modelturn structure by merging consecutive same-role messages - Thinking Blocks: Drops internal thinking blocks that would confuse the API
- Dynamic Thinking Budget: Scales thinking budget based on request size (25% of
max_tokens, clamped 1024–10240) - Parallel Endpoints: Races both production and sandbox endpoints simultaneously for lower latency
- Auto Token Refresh: Refreshes OAuth tokens automatically when they expire
| Issue | Solution |
|---|---|
Cannot read credentials |
Run node setup.mjs login first |
429 Rate Limited |
Wait a few seconds and retry |
503 Service Unavailable |
Google's API is temporarily down, retry |
tools.*.input_schema.type: Field required |
Update to the latest version |
| Proxy logs mixed with Claude output | Update to latest version (logs now go to file) |
EADDRINUSE |
Kill existing proxy: kill -9 $(lsof -t -i :51200) |
Pull requests welcome! Some areas that could use improvement:
- macOS Automator app template
- Prompt caching support (if Google API adds it)
- Streaming thinking blocks back to Claude Code
- Auto-update mechanism
This project is not affiliated with Anthropic or Google. It uses publicly available APIs. Use responsibly and in accordance with Google's and Anthropic's terms of service.
Personal & Non-Commercial Use Only — see LICENSE
You may use, modify, and share this freely for personal/hobby purposes. Commercial use, resale, or bundling with paid products is not permitted.