agy-delegate
Use the agy_execute tool to offload large scaffolding, repetitive refactors,
or exhaustive test generation via the Antigravity CLI.
Prerequisites
Install the Antigravity CLI (a Go binary, not pipx):
curl -fsSL https://antigravity.google/cli/install.sh | bashAuthenticate in a terminal (one-time):
agyVerify the CLI works:
agy --version agy models
Tool usage
agy_execute prompt="Refactor all snake_case variables to camelCase in src/models/"
agy_execute prompt="Generate exhaustive unit tests for src/auth/" model=flash-low
agy_execute prompt="Plan the migration to ESM" model=sonnet mode=plan digest=true
Modes
| Mode | Purpose |
|---|---|
plan |
Exploration and planning — no edits |
accept-edits (default) |
Implementation — agy applies edits directly |
sandbox |
Preview changes without applying |
Rules
- Always review the
git diffafter agy runs withaccept-edits. - Never use agy for irreversible production changes.
- Use
flash-mediumby default,flash-lowfor trivial/high-volume work, andflash-highfor difficult agentic work. - Escalate within the Gemini quota group to
pro-loworpro-highonly when needed. - Use
sonnetfor normal Claude-group coding/review; reserveopusfor the hardest architecture or root-cause work. - Use
gpt-osswhen an open-model alternative is specifically desired. - For consequential work, have one family produce and the opposite family review with
mode=plan; do not spend both groups on trivial tasks. - Batch related work, avoid parallel calls within one shared-quota group, and use
digest=true(default) for non-write tasks. - Legacy
tier=flash|flash-lo|proremains supported, butmodeltakes precedence.
How pi-agy controls the handoff
Pi delegates to agy as a producer, not an autonomous agent. Each call is framed for verifiability and parseability:
planis read-only; returns parsed JSON (the.responsefield).accept-editsandsandboxboth write, so pi-agy passes--dangerously-skip-permissions(headless-pauto-denies writes without it). Inaccept-edits, if the project has atestscript, pi-agy appends a verify-loop instruction (run \npm test` and fix failures`).sandboxalso returns parsed JSON.- Model aliases map to agy's canonical machine names; run
agy modelsif Antigravity renames them.