Use Google's Antigravity CLI (agy) from inside Claude Code: review
code, delegate tasks, ask quick questions, research topics, and generate images — without leaving
your editor.
This is a full architectural port of openai/codex-plugin-cc
that swaps the Codex runtime for Antigravity's agy binary, keeping the same layered design — thin
commands/*.md → a companion CLI script → a runtime library → per-workspace job/state persistence →
text/JSON rendering — and adding commands that only make sense for Antigravity: image generation, a
cheap one-shot question path, and web research.
/agy:reviewand/agy:adversarial-review— structured, JSON-schema-enforced code review of your working tree or a branch diff, runnable in the foreground or background/agy:delegate— hand a task toagythrough a forwarding subagent; write-capable by default/agy:ask— the cheapest path: one question, one verbatim answer, no background job/agy:image— generate an image withagy's built-ingenerate_imagetool, saved to an absolute path you choose/agy:researchand/agy:deepresearch— single-pass or multi-hop web research viasearch_web+read_url_content/agy:status,/agy:result,/agy:cancel— inspect, fetch, or stop background jobs/agy:setup— check thatagyis installed and authenticated, and toggle the optional stop-time review gate
- Antigravity CLI (
agy) installed and authenticated — either via OAuth (runagyonce interactively) orANTIGRAVITY_API_KEY - Node.js 18.18 or later
- git
Add the marketplace in Claude Code:
/plugin marketplace add Or4cu1o/antigravity-plugin-ccInstall the plugin:
/plugin install agy@agy-plugin-ccReload plugins:
/reload-pluginsThen run:
/agy:setup/agy:setup tells you whether agy is installed and authenticated. If it's missing, it can offer
to install it for you:
curl -fsSL https://antigravity.google/cli/install.sh | bashIf agy is installed but not authenticated, run it once interactively to complete OAuth:
!agyor export ANTIGRAVITY_API_KEY in your shell.
After install, you should see the slash commands listed below and the agy:agy-delegate subagent
in /agents.
One simple first run:
/agy:review --background
/agy:status
/agy:resultRuns a structured agy review against your current working tree, enforced by a JSON schema
(verdict, summary, findings[], next_steps[]).
Use --base <ref> for a branch review, --scope auto|working-tree|branch to force a target, and
--wait/--background for execution control. It is not steerable and does not take custom focus
text — use /agy:adversarial-review for that.
/agy:review
/agy:review --base main
/agy:review --backgroundThis command is read-only. It will not fix issues or apply patches — only present findings and stop.
A steerable review that challenges the chosen implementation and design, not just surface-level defects: tradeoffs, hidden assumptions, and whether a different approach would have been safer or simpler.
It uses the same target selection as /agy:review, including --base <ref>, but also accepts
extra focus text after the flags.
/agy:adversarial-review
/agy:adversarial-review --base main challenge whether this was the right caching and retry design
/agy:adversarial-review --background look for race conditions in the retry logicAlso read-only.
Hands a task to agy through the agy:agy-delegate forwarding subagent. Write-capable by default —
there is no read-only mode for this command; use /agy:review or /agy:ask when you want read-only.
/agy:delegate investigate why the tests started failing
/agy:delegate fix the flaky integration test with the smallest safe patch
/agy:delegate --resume apply the top fix from the last run
/agy:delegate --model gemini-3.6-flash-high --effort high investigate the regression
/agy:delegate --background refactor the retry logic in src/queue.tsYou can also just ask for it in plain language — Claude routes substantial hand-offs to the
agy:agy-delegate subagent automatically:
Ask agy to redesign the database connection pooling to be more resilient.
Notes:
- if you don't pass
--model,agyuses its own default --effortaccepts onlylow,medium, orhigh(unlike Codex's six levels)--resumecontinues the latest trackedagyconversation for this Claude session and repository;--freshforces a new one
The cheapest path through the plugin: one prompt, one verbatim response, no persisted job, always foreground.
/agy:ask explain the tradeoffs between optimistic and pessimistic locking here
/agy:ask --model gemini-3.6-flash-high --effort low what does this regex do?Generates an image with agy's built-in generate_image tool and saves it to an absolute path.
/agy:image a minimalist dark-mode dashboard mockup, blue accent color
/agy:image --name hero --output ./docs/hero.png isometric illustration of a developer at a desk--output accepts a relative or absolute path; relative paths resolve against the repository root.
Default output is <name-or-agy-image>.png in the repository root.
Delegate web research to agy's search_web and read_url_content tools.
/agy:research is a single-pass investigation and defaults to asking whether to run in the
background. /agy:deepresearch is a multi-hop investigation and defaults to running in the
background without asking, since it typically takes much longer.
/agy:research what's the current state of WASM GC support across major runtimes?
/agy:deepresearch --model gemini-3.6-flash-high survey post-quantum signature schemes used in TLSShows running and recent agy jobs for the current repository, scoped to the current Claude
session by default.
/agy:status
/agy:status task-abc123
/agy:status task-abc123 --wait --timeout-ms 60000Shows the final stored output for a finished job, including the agy conversation ID so you can
resume it directly with agy --conversation <id>.
/agy:result
/agy:result task-abc123Cancels an active background job.
/agy:cancel
/agy:cancel task-abc123Checks whether agy is installed and authenticated, and can offer to install it. Also manages the
optional stop-time review gate:
/agy:setup --enable-review-gate
/agy:setup --disable-review-gateWhen enabled, a Stop hook runs a targeted agy review of the previous turn before Claude Code is
allowed to end the session, blocking on unresolved findings.
Warning
The review gate can create a long-running Claude/agy loop and may burn through usage limits quickly. Only enable it when you plan to actively monitor the session.
/agy:review/agy:delegate investigate why the build is failing in CI/agy:adversarial-review --background
/agy:deepresearch survey how competitors handle multi-region failoverThen check in with:
/agy:status
/agy:resultcommands/*.md → scripts/agy-companion.mjs → scripts/lib/agy.mjs → agy subprocess (--print)
(thin markdown) (CLI dispatcher) (runtime) (json | stream-json)
↓
lib/state.mjs + lib/tracked-jobs.mjs + lib/job-control.mjs (per-workspace jobs)
↓
lib/render.mjs (JSON payload ⟷ rendered text)
Commands are intentionally thin: no flag parsing happens in the markdown, only execution-mode
decisions (foreground vs. Claude Code's Bash(..., run_in_background: true)). Every subcommand
supports --json for structured output and a rendered-text mode for direct display.
--output-format jsonreturns a single envelope:{conversation_id, status, response, duration_seconds, num_turns, usage}.--output-format stream-jsonemits NDJSON where every line is{"event": "init" | "step_update" | "result", <event>: {...payload}}— the payload is always nested under the matching key, never flattened onto the line. The terminalresultevent carries the same envelope shape as the non-streaming path, so the plugin reads the final response from there rather than accumulatingagent_responsetext deltas.agy'srun_commandtool always executes inside a fixed scratch directory (~/.gemini/antigravity-cli/scratch), independent of the conversation'scwdand--add-dir. Every prompt this plugin sends carries the absolute repository root and an explicit instruction tocdthere before running shell commands — without it, any task that touches the repo silently operates on the wrong directory. This is the single most load-bearing fix in the port.--effortonly acceptslow,medium,high(Codex has six levels); unsupported values are rejected with a clear error rather than silently coerced.- Conversations resume via
agy --conversation <id>(persisted per job) oragy --continue(the CLI's own bare last-conversation memory, which the plugin deliberately does not fall back to for--resume— falling back would silently cross Claude session boundaries).
Pure node:test, no framework, no dependencies:
npm test # node --test tests/*.test.mjs
node --test tests/runtime.test.mjs # one filetests/fake-agy-fixture.mjs writes a fake agy binary into a temp PATH directory that emits the
same JSON/NDJSON contract as the real CLI (verified against it directly — see tests/runtime.test.mjs
for the workspace-context and session-isolation regression tests). No test ever calls the real agy.
If you're already signed into agy on this machine, that authentication works immediately here too
— the plugin uses your local agy CLI install and its cached auth state.
No. It delegates through your local agy binary, on the same machine, using your local
authentication, repository checkout, and environment.
Yes. Delegated tasks and reviews can be resumed directly with agy --conversation <id> — the ID is
shown by /agy:result and /agy:status.
This project is a derivative work built on two upstream projects — see THIRD_PARTY_NOTICES.md for full attribution:
openai/codex-plugin-cc(Apache-2.0) — the layered architecture, job/state persistence design, and testing approach this project ports, with the Codex runtime replaced byagy.simplybychris/antigravity-plugin-cc(MIT) — a smaller, Bash-only plugin with the same goal. Several command ideas here (/agy:ask,/agy:delegate,/agy:review,/agy:image) and the visual design of this project's GitHub Pages site were inspired by that project's command surface and documentation.
MIT.