/gemini:review [file-path] [--spec <path>] [--model <model>]from gemini
Get a code review from Gemini (via agy) as a second opinion
Ships in gemini. Installing the plugin adds it to Claude Code.
Perform a code review using Gemini via the Antigravity CLI (agy). This gives you a second opinion from a different AI model.
Check if $ARGUMENTS contains --model <value>:
--model <value> from $ARGUMENTSgemini-4-hydrogen-highMap the alias to an agy model slug:
pro → gemini-4-neon-high — the deeper model; higher review recall than Hydrogen at about twice the latency, available for explicit opt-in (needs a paid Google AI Pro or Ultra plan)agy models to list available slugs).Check if $ARGUMENTS contains one or more --spec <path> pairs:
--spec <path> found:
--spec is not followed by a value, or is followed by something starting with --, tell the user it needs a path and stop — do not consume the next flag as a filename--spec <value> pair from $ARGUMENTS--spec and --model may appear in any order, before or after the file path.
If $ARGUMENTS (after --model and --spec removal) is provided:
If $ARGUMENTS is empty:
git diff HEAD 2>/dev/nullgit diff --cachedThe system prompt lives in the gemini-review agent, installed by /gemini:setup. The agent's tools whitelist keeps the run read-only — there is no separate policy file.
Assemble PAYLOAD (the variable the bash command below reads) from up to three sections.
First get the repository root and keep it as ROOT — both the payload and the agy invocation below need it:
ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
The agent's view_file only accepts absolute paths — agy does not run in this shell's working directory, so a repo-relative path resolves against the wrong root. Handing it the root is what lets it check a call site when it spots a nameable risk. If the command fails (not a git repo), ROOT is empty: omit the section entirely, and the agent then reports such risks for the user to check instead of reading files.
PAYLOAD is the concatenation of whichever of these apply, in this order:
=== REPOSITORY ROOT ===
{absolute path from git rev-parse --show-toplevel}
=== REQUIREMENTS (what this change is supposed to do) ===
{SPEC_INPUT}
=== CHANGE UNDER REVIEW ===
{REVIEW_INPUT}
=== CHANGE UNDER REVIEW === line must precede REVIEW_INPUT.All === marker lines must be reproduced verbatim, including the parenthetical in the REQUIREMENTS marker; the agent matches on them.
Run the following bash command, passing PAYLOAD via stdin to avoid shell escaping issues:
output=$(printf "%s" "$PAYLOAD" | agy --agent gemini-review --model $MODEL ${ROOT:+--add-dir "$ROOT"} --print-timeout 5m 2>&1)
echo "$output"
--add-dir "$ROOT" is what makes the agent's view_file usable. Without it a headless run cannot get the read permission approved and agy discards the whole review — see the error handling below. The ${ROOT:+...} expansion drops the flag when ROOT is empty, which is the same case that omits the === REPOSITORY ROOT === section: there is nothing to grant, and the agent is already told it cannot read. (agy does tolerate --add-dir "", so this is about keeping the two halves of the decision in one place rather than avoiding a crash.)
The flag is not a formality. On a diff that renames an exported symbol, the same agent returns a LOW "callers may need updating, not verifiable from this diff" without it, and a HIGH naming the two files that actually import the old name with it.
Note: We pipe input via stdin instead of -p to handle large diffs and special characters safely.
A run can come back without a review for two different reasons. They need different responses, and the wrong diagnosis sends the user somewhere useless.
A denied file read. If the output says no output produced and names a permission (read_file), the agent tried to open something --add-dir did not cover: a headless run cannot show a permission prompt, and the denial throws away the entire review rather than just the tool call. Nothing is wrong with the install, so do not send the user to /gemini:setup.
This should be rare once --add-dir "$ROOT" is passed. It still happens when the diff points outside the repository — a sibling checkout, a path reached through .., a file the agent decided to look up by absolute path.
Re-run once with the === REPOSITORY ROOT === section removed from PAYLOAD, leaving REQUIREMENTS and CHANGE UNDER REVIEW untouched, and drop --add-dir with it. Without that section the agent knows it cannot open anything and reports such risks for the user to check instead, which completes normally. Say that the review ran without file-lookup capability, so any finding about code outside the diff is something to confirm rather than something Gemini verified — that downgrade is visible in the output, where verified call sites become "not verifiable from this diff".
Whether the agent reaches outside at all depends on what it finds in the diff, so the same review can succeed one run and fail the next. Do not report this as flaky output.
An agent that never loaded. If the output is a free-form review with no ## Verdict: line, --agent silently ignored an unknown name. Tell the user to run /gemini:setup.
Show the Gemini response directly to the user. Do not modify, summarize, or reformat it.
agy command is not found: suggest running /gemini:setup firstno output produced and a denied permission: follow the re-run without === REPOSITORY ROOT === described in Step 3. Do not send the user to /gemini:setup — the install is fineagy interactively to re-authenticate via Google OAuth--model (agy models lists the slugs). There is no automatic fallbackWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub haunchen/gemini-plugin-cc --plugin gemini5 commands in this plugin
/adversarial-reviewStep 1: Parse --model parameterGet a devil's advocate review that challenges your design decisions/askStep 1: Parse --model parameterAsk Gemini (via agy) a question, optionally with file context/implementStep 1: Establish the workspaceHave Gemini (via agy) implement a task by editing files directlyOther plugins' commands for the same job