Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Antigravity ↔ Claude Code Bridge

Bridge the Antigravity CLI (agy) into Claude Code for review, critique, delegation, and session transfer.

This repository is a Claude Code marketplace plugin that shells out to the real agy binary. Run status, results, and stop are owned by the plugin (PID + log files). There is no app-server broker.

Requirements

  • Node.js >= 18.18
  • Antigravity CLI (agy) on PATH, or set AGY_BINARY
  • A logged-in Antigravity CLI session (agy models succeeds)

Install the CLI with the official one-liner if you do not have it yet:

# 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 interactively to log in (SSH sessions print an authorization URL) and confirm with agy models.

Install

Add the marketplace in Claude Code:

/plugin marketplace add CLYEH/agy-plugin-cc

Install the plugin:

/plugin install agy@antigravity-cli

Reload plugins:

/reload-plugins

Local install (from a clone)

From this repository root (path must be absolute):

# bash / zsh: resolve an absolute path to this clone, then add it as a local marketplace
claude plugin marketplace add "$(pwd)"
# example: claude plugin marketplace add /absolute/path/to/agy-plugin-cc

# Install the plugin from that marketplace
claude plugin install agy@antigravity-cli
# Windows PowerShell
claude plugin marketplace add (Get-Location).Path
# example: claude plugin marketplace add C:\src\agy-plugin-cc

claude plugin install agy@antigravity-cli

Or, when Claude Code is already open, use /plugin and add the local marketplace path, then install agy@antigravity-cli.

Check readiness

/agy:check

Ready means: Node is available and node is on PATH (hooks launch it by name), agy is available (agy --version), and soft auth via agy models succeeds.

Commands

/agy:check

Probe Node + Antigravity CLI availability and authentication. When something is missing it prints the install one-liner or the login hint (run agy interactively once, then verify with agy models).

/agy:review

Read-only review of local git state:

/agy:review --wait
/agy:review --background --scope working-tree
/agy:review --base main
/agy:review --wait --model gemini-3.6-flash-high --effort high

Runs:

agy -p <prompt> --add-dir <workspace> --output-format json --mode plan --sandbox --print-timeout 30m

The working directory is the reviewed workspace (set at spawn time; agy has no --cwd flag). Optional: pass --model / --effort (low|medium|high). If omitted, agy chooses defaults.

/agy:critique

Same target selection as review, with a design/risk critique prompt and structured JSON output enforced through --json-schema:

/agy:critique --wait
/agy:critique --base main challenge whether this was the right caching and retry design
/agy:critique --wait --model gemini-3.6-flash-high --effort high focus on failure modes

Runs:

agy -p <prompt> --add-dir <workspace> --output-format json --json-schema <schema> --mode plan --sandbox --print-timeout 30m

Optional: same --model / --effort flags as review.

/agy:delegate

Delegate investigation or implementation to Antigravity via the agy:agy-delegate subagent:

/agy:delegate investigate the flaky test in auth
/agy:delegate --resume apply the top fix
/agy:delegate --model gemini-3.6-flash-high --effort high fix the race

Write policy layering:

Layer Default
Bridge run CLI Read-only (best-effort) (--mode plan + --sandbox) unless you pass --write
Delegate agent / skill Adds --write by policy (write-capable delegate) unless the user asks for read-only
  • Direct node …/agy-bridge.mjs run "…" is therefore read-only (best-effort) unless --write is passed.
  • --write maps to agy --dangerously-skip-permissions. agy cannot hard-enforce read-only per invocation: headless runs have no approver, and the mode/sandbox flags plus the bridge's READ-ONLY prompt preamble are best-effort, not a hard boundary. The bridge also runs post-run change detection and prints Warning: this read-only run modified files: if a read-only run touched the working tree anyway — it never reverts the change. agy's permissions documentation describes permissions.deny rules such as write_file(<path or *>) in ~/.gemini/antigravity-cli/settings.json, which would apply to all of a user's agy sessions. This project has not verified those deny rules against the real CLI — test a rule yourself before relying on it for a hard guarantee.
  • --resume / --resume-last continues the last stored Antigravity conversation id via agy --conversation <id>.
  • Prefer bridge --background for long work so runs record both bridgePid (Node worker) and agentPid (agy child).
  • /agy:stop terminates both process trees when present (agent then bridge/worker).
  • If you do not pass --model or --effort, agy chooses its own defaults.

Multimodal via delegate

/agy:delegate is write-capable by default, so no extra flag is needed to read or generate media files — just reference the file path (or ask for an image to be generated) in the task text:

/agy:delegate describe what is shown in ./screenshots/dashboard.png
/agy:delegate summarize the contents of ./docs/spec.pdf
/agy:delegate transcribe the audio in ./recordings/call.wav
/agy:delegate describe what happens in ./clips/demo.mp4
/agy:delegate generate_image a flat-style icon of a green checkmark and save it to ./assets/check.png

Verified on Windows with the default Gemini model: reading a PNG image, OCR of an image-only PDF, transcribing a WAV file, per-second description of a 3-second MP4, and image generation via generate_image. Audio and video understanding require the default Gemini model — leave --model unset for these tasks; other models either cannot read audio at all or fall back to writing a script instead of answering directly. Large files and longer videos were not tested.

/agy:import

Transfer the current Claude Code transcript into a new Antigravity conversation:

/agy:import
/agy:import --source ~/.claude/projects/.../session.jsonl

agy has no session import, so this is a best-effort transfer of the visible conversation: the bridge renders the Claude transcript (user and assistant turns; tool outputs are not replayed) into a Markdown digest, starts a read-only agy conversation with it as context, and asks for a one-paragraph summary. The output includes the new conversation id and the resume hint agy --conversation <id>.

/agy:runs

List active and recent plugin-owned runs:

/agy:runs
/agy:runs <run-id> --wait

The conversation id (and its resume hint) is not available until the run finishes, because agy only reports it in the final JSON envelope.

/agy:show

Show stored output for a finished run:

/agy:show
/agy:show <run-id>

/agy:stop

Stop an active run by terminating tracked process trees:

/agy:stop
/agy:stop <run-id>

Kills every distinct pid among agentPid (detached agy child) and bridgePid / legacy companionPid / legacy pid (bridge or run-worker). Terminal status is claimed under a locked CAS so a finishing worker cannot overwrite cancelled with completed.

Environment

Variable Purpose
AGY_BINARY Optional override for the agy executable
AGY_PRINT_TIMEOUT Go duration passed as --print-timeout (default 30m; e.g. 45m, 1h)
AGY_CC_SESSION_ID Claude session id (set by SessionStart hook)
AGY_CC_TRANSCRIPT_PATH Claude transcript path (set by SessionStart hook)
CLAUDE_PLUGIN_ROOT Plugin install root (host)
CLAUDE_PLUGIN_DATA Plugin data root; state lives under .../state
CLAUDE_ENV_FILE Host env file for session hooks
CLAUDE_PROJECT_DIR Project directory from the host
CLAUDE_CONFIG_DIR Honored when locating Claude transcripts (defaults to ~/.claude)

State fallback when CLAUDE_PLUGIN_DATA is unset: $TMPDIR/agy-cc-runs (Node's os.tmpdir(), so %TEMP% on Windows).

Differences from the Grok Build plugin

This plugin is a port of xAI's grok-build-plugin-cc. The command surface, run lifecycle, and state files are the same; the agy CLI forces these deltas:

  • /agy:import is a transcript transfer, not a session import. agy cannot ingest a Claude session file, so the bridge sends a digest of the visible conversation into a new conversation. Tool outputs are not replayed.
  • The conversation id is known only after a run completes. agy has no way to pre-assign an id, so /agy:runs cannot show a conversation id while a run is active; the id and the resume hint appear once it finishes.
  • Read-only runs (review, critique, delegate without --write) use --mode plan --sandbox. Write runs (--write) use --dangerously-skip-permissions.
  • Read-only is best-effort, not hard-enforced. agy has no per-invocation read-only guarantee: the bridge combines --mode plan --sandbox with a READ-ONLY prompt preamble and post-run change detection (a git status --porcelain --untracked-files=all snapshot before and after the run). Gitignored files are not compared, so a change to an ignored path (.env, dist/, node_modules, ...) is never reported. If the working tree differs anyway, the bridge prints Warning: this read-only run modified files:, lists the paths, and adds a second line, Something else may have written them during the run; check git diff before trusting the result. — the warning means files changed during the run, not necessarily that agy wrote them; another process could be the author, so check git diff. The bridge never reverts them. For a hard guarantee, add permissions.deny rules in ~/.gemini/antigravity-cli/settings.json.
  • Task text beginning with / may be interpreted by agy as a slash command rather than plain prompt text (for example in /agy:delegate). The bridge does not pass --disable-slash-commands; avoid starting delegate task text with / if you want it treated literally.
  • AGY_PRINT_TIMEOUT controls the --print-timeout passed to every run (default 30m; the CLI default of 5 minutes is too short for large reviews).
  • Every run uses --output-format json so the conversation id can be captured; plain-text results are rendered from the envelope's response.
  • Every run also passes --add-dir <workspace>. Headless agy has no active workspace from the process cwd alone, so without this flag it cannot see the repo being reviewed, critiqued, or delegated into.
  • A failed run exits 1 with an ERROR envelope on stdout; the bridge reports the envelope's error string as the run's error message.
  • Resuming an unknown conversation id is reported as a failure. agy itself does not error on an unknown --conversation <id> — it silently starts a new conversation — so the bridge compares the returned conversation id against the requested one and reports a mismatch instead of adopting the new id.

Note: --sandbox is accepted but is a no-op on Windows. agy does not hard-enforce read-only for any invocation on any platform; --mode plan makes writes unlikely but not impossible, so treat it as a strong default, not a guarantee (see "Differences from the Grok Build plugin" above).

Development

npm test

Tests use Node's built-in test runner and a fake agy binary on PATH. Runtime code uses Node stdlib only.

Version: 0.1.0.

License

Apache-2.0. See LICENSE and NOTICE. Derived from xAI's grok-build-plugin-cc (Apache-2.0).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages