Skip to content

TolyK/antigravity-plugin-cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Antigravity plugin for Claude Code

Use Google Antigravity's terminal coding agent (agy) from inside Claude Code. Delegate tasks, ask one-shot questions, and review code — all without leaving your Claude Code session.

Unofficial. This is a community wrapper. It is not affiliated with, endorsed by, or supported by Google or Anthropic. "Antigravity", "Gemini", and "Claude" are trademarks of their respective owners.

This project mirrors the structure of openai/codex-plugin-cc, but wraps the Antigravity CLI instead of Codex.

What you get

Command What it does
/antigravity:rescue [task] Delegate a coding task to Antigravity (read + edit files in the repo) via a forwarding subagent.
/antigravity:ask [question] One-shot, read-only question to Antigravity.
/antigravity:review [--base <ref>] Have Antigravity review your current git diff (read-only).
/antigravity:setup Check that agy is installed and authenticated.

There's also an antigravity:antigravity-rescue subagent that Claude can invoke proactively to hand off substantial work.

Prerequisites

  1. Node.js (the companion script is plain ESM, no dependencies).

  2. The Antigravity CLI (agy), installed and authenticated:

    # macOS / Linux
    curl -fsSL https://antigravity.google/cli/install.sh | bash
    # Windows PowerShell
    irm https://antigravity.google/cli/install.ps1 | iex

    Then run agy once and complete Google Sign-In, or set GEMINI_API_KEY / ANTIGRAVITY_API_KEY.

Run /antigravity:setup from Claude Code to verify both.

Install the plugin

Add this repo as a plugin marketplace, then install the antigravity plugin:

/plugin marketplace add TolyK/antigravity-plugin-cc
/plugin install antigravity@antigravity-cc

(Or clone the repo and add it as a local marketplace with /plugin marketplace add ./antigravity-plugin-cc.)

Usage

/antigravity:setup
/antigravity:ask how does the auth middleware in this repo work?
/antigravity:rescue add input validation to the signup handler and a test for it
/antigravity:review --base main

/antigravity:rescue is write-capable by default — Antigravity may edit files. Pass --read-only for a no-edit pass. /antigravity:ask and /antigravity:review are always read-only.

How it works (and the one tricky bit)

Antigravity's headless print mode — agy -p "<prompt>" — is built for a TTY. When it runs under a non-TTY stdout, which is exactly how Claude Code's Bash tool invokes commands, the response can silently vanish even though the process exits 0.

To work around this, the companion script (plugins/antigravity/scripts/agy-companion.mjs) runs agy under a pseudo-TTY via the system script utility, then strips ANSI/carriage-return noise so Claude Code receives clean text:

  • macOS/BSD: script -q /dev/null agy -p … (exec form, no shell — injection-safe).
  • Linux (util-linux): script -qec "agy -p …" /dev/null with shell-quoted args.
  • Windows / no script: falls back to invoking agy directly.

Everything is a thin pass-through: the commands and subagent return Antigravity's output verbatim.

Prompt safety

Free-form prompts are never interpolated into a shell command. The slash commands and subagent pass your text to the companion on stdin via a single-quoted heredoc (<<'EOF'), so $(…), backticks, ;, and other metacharacters stay inert. Only a small, fixed set of flags (--model, --add-dir, --base, …) is ever passed as argv, and the companion validates that each value flag is followed by an actual value. On timeout, the companion kills the whole script+agy process group, not just the wrapper.

Flags

The companion (agy-companion.mjs <ask|task|review|setup>) accepts:

Flag Meaning
--stdin Read the prompt/focus text from stdin instead of argv (how the commands pass free-form text safely — see below).
--model, -m <name> Pass a specific model to agy (best effort).
--add-dir <path> Add an extra directory to the Antigravity workspace.
--cwd <path> Working directory for the run.
--resume, -c Continue the most recent Antigravity conversation.
--conversation <id> Resume a specific conversation.
--read-only Forbid file edits (default for ask/review).
--timeout <seconds> Hard-kill the run after N seconds (default 600).
--base <ref> (review only) diff against <ref> instead of the working tree.

Note on agy flags: Antigravity's CLI is young and its flags have shifted between releases (e.g. --output-format has come and gone). The companion only relies on the stable -p print mode and passes optional flags through best-effort. If a flag is rejected by your agy version, drop it. PRs welcome to track changes.

Layout

antigravity-plugin-cc/
├── .claude-plugin/marketplace.json        # marketplace manifest
└── plugins/antigravity/
    ├── .claude-plugin/plugin.json         # plugin manifest
    ├── commands/                          # /antigravity:rescue|ask|review|setup
    ├── agents/antigravity-rescue.md       # forwarding subagent
    └── scripts/agy-companion.mjs          # the bridge to `agy`

License

MIT

About

Use Google Antigravity (agy) from inside Claude Code — delegate tasks, ask questions, and review code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors