๐ฐ๏ธ Antigravity for Claude Code
Run the Antigravity CLI (Gemini) as a collaborating sub-agent, right inside Claude Code.
Claude conducts the judgement; Gemini does the heavy lifting โ intelligent model routing across the SDLC.

โก Quick look
Claude stays the conductor; the bulk, token-heavy read ran on cheaper Gemini, and Claude verified the result.
๐ก Why
| Claude (conductor) | Gemini / agy (executor) |
|---|
| Owns | requirements ยท architecture ยท the hard 20% ยท verification ยท review | scaffold ยท implementation ยท test generation ยท search |
| Strength | judgement | cheap, fast throughput |
you โ Claude Code (conduct: design / verify / review)
โโโ agy โ Gemini (execute: implement / test / search)
Generation is solved; verification, judgement, and direction are the craft.
โจ What it does
- Routes work across the SDLC โ Claude keeps the judgement calls; Antigravity handles scaffolding, test generation, first-pass review, and migrations under a shared
AGENTS.md.
- Adds tools Claude lacks natively โ live Google/web search, Vertex AI Search over your internal data, deep research, Cloud Logging. Claude reviews and re-checks the results.
- Hears audio, watches video โ
/antigravity:media delegates the perception to Gemini (natively multimodal, no local ffmpeg/Whisper stack): you get a timestamped digest while the full transcript is written to a file, so a 1-hour recording never lands in Claude's context.
- Cross-model verification โ an independent, different-model opinion on your code.
- Background jobs โ fire a long delegation, keep working, collect later.
- Internal fan-out โ one delegation, and agy spawns its own subagents on the cheap side (dynamic
define_subagent on agy โฅ 1.0.16; TypeName "self" + Role on any version); each leaves a readable trajectory you audit with agy-trace.
- Hand-off mode โ
/antigravity:handoff gives agy a whole, test-covered task; Claude reads nothing and verifies only by running the tests. The one delegation shape that measured cheaper than Claude Code alone on implementation work (0.58ร per passing task; 0.43ร on large tasks โ and a loss on small ones), at the price of a 3โ4ร longer wall-clock and code that needs the human review a first draft gets.
- Built-in cost discipline โ measured, not guessed (see below).
- Drops in with the discipline on โ a
SessionStart hook injects the cost-aware
routing policy automatically (toggle in plugin settings), and the antigravity-delegate
subagent does file writing on Gemini, so Claude spends no tokens generating file contents.
- No slash command required โ the delegate subagent is picked up proactively for bulk
work, and a prompt-level nudge flags bulk-looking requests as delegation candidates.
Both are advisory: the break-even judgment stays with Claude (full auto-routing is a
measured net loss below the break-even), and the nudge is toggleable (
delegation_nudge).
๐ Measured results
On a large ADK multi-agent build (+ adk eval), same task / same model, 3 ways:
| Claude solo @high | solo @max | hybrid |
|---|
| frontier cost (COST-WEIGHTED) | 2.62M | 5.34M | 1.91M |
quality (adk eval) | โ
3/3 | โ
3/3 | โ
3/3 |
โ โ27% vs solo@high, โ64% vs solo@max, at equal quality โ and the cheap Gemini work isn't even counted. Savings scale with task size; tiny one-off tasks are cheaper to just run on Claude. Full A/B: docs/AB-RESULTS.md.
Note on cost figures: numbers are estimates โ token counts are approximated and rates live in prices.json. Set your real Vertex rates there before quoting any figure.
Hand-off mode, measured on real pull requests (2026-09, on agy 1.2.2 only; #91). Eight merged PRs from caddy,
cli/cli, k6 and zoekt (52โ2,242 lines), replayed with the PR's tests restored before
scoring, Claude Opus 5 conducting, agy on Gemini 3.8 Flash, n = 2 per cell, blinded
two-family review. Delegating file by file while Claude reads and specifies cost
1.33โ1.68ร a solo run per passing task. Handing the whole task to agy and verifying
only by running the tests (agy-handoff) cost 0.58ร (95% CI 0.39โ0.96) at the
pre-registered price deck โ 0.43ร on large tasks, 1.20ร on small ones โ with 16/16
tests passed and the Claude side alone at 0.16ร; the blinded Claude judge rated that code
0.6 of 5 below the solo run (dead code, duplicated helpers), about 0.2 below the human-merged
PR. At the Gemini unit price this project was actually billed (2ร the promotional rate) the
overall saving disappears and large tasks keep 0.77ร. Full protocol, per-run records and
deviations: PR #91.
๐ Install
In Claude Code:
/plugin marketplace add yuting0624/antigravity-for-claude-code
/plugin install antigravity@antigravity-for-claude-code
/antigravity:setup # verifies agy is installed + authenticated
Prerequisites: the Antigravity CLI (agy) installed & authenticated (agy models lists Gemini models), and Claude Code. For the same-bill cost benefit, run Claude Code on Vertex too.
Platform support: macOS, Linux, and WSL are the supported targets for headless delegation. Native Windows (Git Bash/MSYS) is not recommended โ agy -p can hang with a 0-byte log when run without a real console (ConPTY); see issue #6. The wrapper now bounds this with a wall-clock guard (GNU timeout/gtimeout, returning a clean TIMEOUT instead of hanging), and doctor distinguishes a hang from an auth failure โ but for reliable headless use, run from WSL/macOS/Linux.
๐งฉ Slash commands
The plugin's commands show up natively in Claude Code's / menu.
| command | what it does |
|---|
/antigravity:setup | health check โ agy installed + authenticated, scripts ready |
/antigravity:delegate [--tier flash|pro] <task> | delegate a subtask to agy under cost discipline, then verify |
/antigravity:handoff [--dir <repo>] [--tests <files>] <requirement> | hand a whole test-covered task to agy; Claude reads nothing, the wrapper runs the tests, allows one fix-up, and reports โ 0.58ร a solo run per passing task on the PR-replay benchmark (small tasks: more) |
/antigravity:review [--adversarial] | independent cross-model review of the current diff; Claude reconciles |
/antigravity:research <topic> | Claude-orchestrated deep research โ agy does grounded web legwork, Claude verifies citations across โฅ2 sources |
/antigravity:media <file> [focus] [--convert] | understand audio / video / images โ agy transcribes + analyzes, returns a timestamped digest; full transcript goes to a file, not your context |
/antigravity:cloud-run-debug [--service <s>] [--region <r>] [--project <id>] [--since 1h] [--apply] | diagnose a failing Cloud Run service โ agy digests the error logs, Claude infers the root cause + fix; read-only by default (--apply writes to a branch) |
/antigravity:status [id] ยท :result <id> ยท :cancel <id> | manage background delegation jobs |
/antigravity:migrate [--apply] [--include-repos] | move an existing Claude Code setup onto agy โ skills, CLAUDE.md, memory, MCP, plugins, permissions; dry-run by default, --uninstall reverses it |
Background jobs are for interactive sessions (fire-and-collect). In headless claude -p (one-shot), delegate synchronously โ there's no later turn to collect a result.
๐ฆ Bringing your Claude Code setup across
/antigravity:migrate moves an existing Claude Code configuration onto agy. Dry-run
by default; --apply backs up first and --uninstall --apply reverses it. Your
~/.claude is never written to.
/antigravity:migrate # see the plan
/antigravity:migrate --apply # global assets
/antigravity:migrate --apply --include-repos # also AGENTS.md + per-repo memory
| your Claude Code asset | becomes |
|---|
~/.claude/skills/ | read in place โ a skills.json entry, not a copy, so one edit serves both tools |
| installed plugins | ~/.gemini/config/plugins/ via the native importer, with its output repaired |
CLAUDE.md | an AGENTS.md symlink beside it |
| auto-memory | always-on rules โ global ones in a plugin, per-repo ones in <repo>/.agents/rules/ |
| MCP servers (project + desktop app) | merged into ~/.gemini/config/mcp_config.json |
| trusted projects | trustedWorkspaces |
permissions.allow | a proposal file โ see below |
~/.claude/agents/ | nothing. A user subagent's model: names a Claude tier (opus / sonnet / haiku) and its tools: lists Claude tool names, so there is no honest mapping; subagents shipped inside a plugin come across with the plugin |
~/.claude/CLAUDE.md, ~/.claude/commands/, hooks in settings.json | nothing โ only the copies that ship inside a plugin are carried across |
| session history | nothing. Antigravity stores conversations as protobuf blobs inside per-conversation SQLite files; there is no writer |
Two things are deliberately not automatic. Permissions widen when translated โ
Claude's allow-list holds whole command lines, while agy's command() matches a
prefix โ so the result is written out for review and merged only with
--apply-permissions. model / effortLevel / env are reported and never
written, because no honest mapping exists.
Worth knowing if you would rather do it by hand: an Antigravity rule without
trigger: always_on in its frontmatter is ignored with no error and no warning,
workspace .agents/ is ignored entirely unless the session is bound to an agy project,
and agy plugin import claude finds nothing on a current Claude Code because it only
looks one directory deep. docs/MIGRATION.md has the full layout
reference, the compatibility matrix, and how each of these was measured.
๐ณ๏ธ The same two models, arranged differently
This plugin is one shape of Claude and Gemini working together: conductor and executor โ judgement on one side, throughput on the other, one workflow. It is also the shape for people who live in a terminal.