---
name: gemini
description: Invoke Google's models (Gemini 3.8 Flash by default; Gemini 4 Argon on Ultra) from Claude Code through the Antigravity CLI `agy`, Google's replacement for the Gemini CLI since 18 Jun 2026. Use when the user says "ask Gemini", "Google model", "agy", "second opinion from Gemini", "third-family review", "Gemini fact check", "have Gemini read the whole folder", or wants an image/video described by a Google model. Headless, read-only by default, JSON-parsed, never with client data.
---

# Gemini via the Antigravity CLI (`agy`)

> **Why `agy`, not `gemini`.** On 18 Jun 2026 Google stopped serving "Login with Google" accounts
> (free, AI Plus, AI Pro, AI Ultra) on the Gemini CLI and the Code Assist extensions
> (https://developers.google.com/gemini-code-assist/resources/faqs). A consumer account therefore
> cannot sign in to the Gemini CLI. The consumer path is the Antigravity CLI: binary `agy`, default
> install `~/.local/bin/agy`. This skill was written against v1.3.4 (Oct 2026). Only a paid Gemini
> API key still works with the old CLI.

## Hard rules

1. **No client data, no secrets.** Consumer Antigravity terms record "Interactions" (prompts, code,
   output) that Google staff may review and use to improve models (https://antigravity.google/terms/).
   Never pass customer data, employer or client content, env files, tokens, or anything under
   an NDA. Public repos, code you own, public posts and docs are fine.
2. **Read-only by default.** Always `--mode plan` unless the user asks for edits. Never
   `--dangerously-skip-permissions`. Headless runs cannot answer approval prompts: tools that need
   permission are soft-denied and the run still exits 0, so read `.status` from the JSON.
3. **Headless only from Claude.** `-p` + `--output-format json` + a `timeout`. Sign-in is
   interactive and is the user's step (below).
4. **Gemini is a colleague, not an authority.** Verify any fact it asserts with WebSearch or a
   primary source before acting. It has its own cutoff and its own hallucinations.
5. **Quota is weekly** (5-hour refresh on Pro/Ultra). Do not loop calls. One call per question.

## Sign-in (the user, once; interactive)

```
agy
```
Follow the browser flow, then `agy models` lists what the account can use. If `agy models`
says "Please sign in", the session token is gone: run `agy` again.

## Run it

Use the helper. It writes nothing, enforces plan mode, a timeout and JSON parsing, and exits
non-zero unless `status == SUCCESS`:

```
~/.claude/skills/gemini/scripts/agy-run.sh <prompt-file> [--model <slug>] [--effort low|medium|high|xhigh|max] [--add-dir <path>] [--timeout 10m]
```

Raw form, for reference:
```
timeout 10m agy -p "$(cat prompt.md)" --mode plan --output-format json --effort medium --add-dir . --print-timeout 10m
```
JSON fields: `conversation_id`, `status` (SUCCESS | ERROR | CANCELED | INTERRUPTED | INVALID |
WAITING | RUNNING), `response`, `error`, `duration_seconds`, `num_turns`, `usage`.
`--json-schema <file>` forces structured output (`structured_output` field).
`--continue` resumes the last conversation; `--conversation <id>` a specific one.
Long prompts: put them in a file. Very large inline arguments have been reported to hang.

## Models

`agy models` is the truth for your account. One consumer account on 13 Oct 2026 listed:
- `gemini-3.8-flash-high` / `-medium` / `-low` — the Google model. Use `-high` for review, `-medium` for
  fact checks and reads, `-low` for smoke tests. (Slugs carry the effort; `--effort` is for the session.)
- `claude-sonnet-4-6`, `claude-opus-4-6-thinking` — older Claude releases than the native ones. Never use.
- `gpt-oss-120b-medium` — open-weight GPT. Not useful here; use Codex for an OpenAI-family reviewer.
- NO `gemini-4-argon` on that account (Ultra and Enterprise only, https://antigravity.google/docs/models).

## Roles (ranked)

| # | Role | When | Prompt shape |
|---|---|---|---|
| 1 | **Third-family reviewer** after the Codex pass at milestones (the reviewer gets the diff and the acceptance criteria, never the author's claim) | Large multi-file changes on repos you own | `git diff <base>..HEAD > diff.patch`; prompt = acceptance criteria + "Find how this fails. One line per issue, worst first, cite file:line." + the patch |
| 2 | **Search-grounded fact check** for research reviews and tooling scans | A claim with a number or a date | "Confirm or refute each claim. Cite a URL per claim. Say 'unverified' when you cannot." Then verify the URLs yourself |
| 3 | **Whole-folder read** (1M context) | A batch of memos, a long transcript, a repo tour | `--add-dir <folder>` + "Read every file. Answer only from them. Quote file and line." |
| 4 | **Image or video description** | Research items with dashboard videos, UI screenshots | Put the file path in the prompt; untested when this was written. Try one frame first |

Claude already does code edits, planning and ordinary review better here; do not route those to
Gemini. If you also run Codex, it stays the first cross-model reviewer.

## After a run

- Report status, duration and the response. Quote disagreements with Claude's own view and say
  which side has the evidence.
- A `WAITING` status means a tool needed approval: rerun with the question rephrased so no tool
  is needed, or ask the user to run it interactively.
- Note usage from `.usage` when quota matters.

## Gotchas (learned 13 Oct 2026)

- **Web reads need an allow rule.** Headless runs auto-deny `read_url`; the JSON then has `status: SUCCESS`
  with an empty `response` and a `denied_actions` list. Add
  `"permissions": {"allow": ["read_url(*)"]}` to `~/.gemini/antigravity-cli/settings.json`. Other actions (`command`, `write_file`, `mcp`) stay on Ask,
  which headless denies: that is the read-only guarantee.
- **Model slugs carry the effort** (`gemini-3.8-flash-high`). Passing `--effort` with such a slug errors
  ("conflicts"). The helper passes `--effort` only when you ask for it.
- **Reviews are slow and verbose.** One script review took 268 s and 34k output tokens on `-high`
  (15 findings, 6 real). Budget 10 minutes. Fact checks with web reads timed out at 300 s; use `-low`, two
  claims at a time, and a 10-minute timeout.
- The helper refuses a prompt file that contains a token-shaped value (`_TOKEN=<16+ chars>` etc.). A line
  of code that merely names an env var passes.

- `--mode plan` and `--add-dir` are in `agy --help` (v1.3.4). `--sandbox` adds terminal restrictions.
- Skills for agy live in `~/.gemini/antigravity-cli/skills/` and project `.agents/skills/`; MCP in
  `~/.gemini/config/mcp_config.json`. Not needed for this skill.
- `GEMINI.md` / `AGENTS.md` in the working directory are read as rules. Keep secrets out of them.
- Update: `agy update`. Changelog: `agy changelog`.
