# Antigravity plugin for Claude Code Use **Google Antigravity (Gemini)** from inside Claude Code to delegate tasks in headless mode. Mirror of the [OpenAI Codex plugin](https://github.com/openai/codex) pattern, but for Google's `agy` CLI. ## What it does Adds 5 slash commands and 1 agent to Claude Code: | Command | What it does | |---|---| | `/antigravity:setup` | Check if `agy` is installed, offer to install it | | `/antigravity:rescue ` | Delegate a task to Gemini via `agy --print --dangerously-skip-permissions` | | `/antigravity:status []` | List background jobs and their state | | `/antigravity:result []` | Print the full log of a background job | | `/antigravity:cancel ` | SIGTERM a background job | Plus an agent `antigravity:antigravity-rescue` used internally by `/antigravity:rescue` (and that Claude can invoke proactively). ## Headless mode Under the hood, the plugin invokes: ```bash agy --print --dangerously-skip-permissions --print-timeout "" ``` - `--print` runs a single prompt non-interactively (no TUI) - `--dangerously-skip-permissions` auto-approves all tool calls (necessary for unattended execution) - `--print-timeout` is set to 10 min foreground / 30 min background by default ## Prerequisites 1. Install Antigravity CLI: ```bash curl -fsSL https://antigravity.google/cli/install.sh | bash ``` 2. **Run `agy` once interactively** in a terminal to complete Google OAuth sign-in. This stores credentials so headless / background calls don't get stuck on auth. 3. Add this plugin to Claude Code (see below). > ⚠️ **Auth note** — Background jobs cannot complete an OAuth flow (no TTY). > If your `agy` token expires, the next foreground call will refresh it via browser. > Always do one foreground rescue (or a manual `agy` call) before relying on `--background`. ## Install in Claude Code From Claude Code: ``` /plugin marketplace add file:///Users/olivierdupont/Desktop/diversclaude/antigravity-plugin /plugin install antigravity ``` Then verify: ``` /antigravity:setup ``` ## Usage examples ``` /antigravity:rescue Investigate the failing test in src/utils.test.ts and propose a fix. /antigravity:rescue --background Refactor the entire payment module to use Stripe Connect Express instead of the current generic Stripe integration. Apply the changes directly. /antigravity:rescue --sandbox --add-dir /tmp/sandbox-experiment Create a quick prototype that reads CSV and outputs JSON. /antigravity:rescue --resume Apply the top fix from the previous diagnosis. ``` After a background job: ``` /antigravity:status /antigravity:result agy-abc-12345 /antigravity:cancel agy-abc-12345 ``` ## Project layout ``` antigravity-plugin/ ├── .claude-plugin/plugin.json # plugin manifest ├── agents/ │ └── antigravity-rescue.md # forwarder subagent ├── commands/ │ ├── setup.md │ ├── rescue.md │ ├── status.md │ ├── result.md │ └── cancel.md ├── skills/ │ ├── antigravity-cli-runtime/ # internal: how to invoke agy-companion │ ├── antigravity-result-handling/ # internal: how to display output │ └── gemini-prompting/ # internal: how to write good Gemini prompts └── scripts/ └── agy-companion.mjs # central wrapper (task / setup / status / result / cancel) ``` ## Differences with the Codex plugin | Codex plugin (1.0.4) | This Antigravity plugin (0.1.0) | |---|---| | `codex` CLI from OpenAI | `agy` CLI from Google | | GPT-5.x family of models | Gemini family | | `codex --json` headless mode | `agy --print` headless mode | | Full job persistence (state.mjs, jobs DB) | Minimal jobs dir at `~/.cache/antigravity-plugin/jobs/` | | Review / adversarial-review / stop-gate hooks | Not in v0.1 (just `task`) | | Multi-model support, effort tuning | Not in v0.1 (Gemini default) | | Resume-last logic via thread IDs | Naive `--continue` (agy's default) | For most rescue/delegation use cases, the v0.1 surface is sufficient. ## License MIT. This plugin is not affiliated with Google or OpenAI.