gemini-as-tool is a Claude Code plugin that lets Claude call Google Gemini (3.x Pro and Flash) as a headless second-opinion agent, builder, or judge — authenticated through a Google AI Pro OAuth subscription, with no API key and no per-token billing.
Last verified: June 2026. Gemini CLI / agy backends verified 2026-06-04.
It packages the gemini-as-tool skill plus a small, tested Python harness (gemini_tool.py)
that drives the Gemini CLI / Antigravity (agy) backends for you — so Claude Code can get a
second model's opinion, run a builder→judge pipeline, or fan out prompts to Gemini in parallel,
all without you wiring up an API key.
/plugin marketplace add MarioMagdy/gemini-as-tool
/plugin install gemini-as-tool@gemini-as-tool
Then just ask Claude things like "use Gemini to review this" — the skill auto-invokes.
Prefer not to use the plugin system? Clone the repo and run
python skills/gemini-as-tool/gemini_tool.py ask "..."directly.
Install this if you want Claude Code to:
- Get a second opinion from Gemini on any output or decision
- Use Gemini as a builder or judge in a multi-model pipeline (Pro builds, Flash judges)
- Cross-check Claude's reasoning with another frontier model
- Run Gemini headlessly and in parallel, using a Google AI Pro subscription (no API key)
Trigger phrases the skill responds to: "use Gemini", "ask Gemini", "second opinion from Gemini", "have Gemini judge/review this", "cross-check with Gemini", "orchestrate Gemini".
# one answer from Gemini 3.5 Flash
python gemini_tool.py ask "Explain this stack trace"
# one answer from Gemini 3.1 Pro
python gemini_tool.py ask "Design a rate limiter" --model pro
# builder -> judge: Pro builds, Flash reviews and returns a JSON verdict
python gemini_tool.py pipeline "Write a thread-safe LRU cache in Python"
# fan out N prompts concurrently
python gemini_tool.py parallel "prompt 1" "prompt 2" "prompt 3"Python API: from gemini_tool import ask → ask(prompt, model="pro"|"flash", backend="agy"|"gemini-cli").
gemini_tool.py wraps two subscription-backed backends and normalizes their quirks:
agy(Antigravity CLI) — the primary backend and the only one with Gemini 3.5 Flash. It works around the known Windows bug whereagy -pprints nothing to stdout by reading the response from agy's own transcript store, and runs each call in its own job workspace so parallel calls never collide.geminiCLI — a secondary backend that returns a clean JSON envelope.
Prompts are delivered per backend:
- The
geminiCLI backend receives the prompt over stdin (so untrusted prompt text can't reach a shell). - The
agybackend passes the prompt as a direct process argument (no shell is involved, so it is not injectable), which means very long prompts are bounded by the OS command-line length limit.
- Python 3.8+
- A Google AI Pro account, and at least one of:
- the Antigravity CLI (
agy) installed and signed in (recommended — required for 3.5 Flash), or - the Gemini CLI (
@google/gemini-cli) installed and signed in.
- the Antigravity CLI (
- Auth is OAuth (browser sign-in, stored in your OS keyring). No API key is used or stored.
What is gemini-as-tool? A Claude Code plugin that lets Claude call Google Gemini (3.x Pro and Flash) as a headless second-opinion agent, builder, or judge — authenticated through a Google AI Pro OAuth subscription, with no API key and no per-token billing.
Does this require a Gemini / Google AI Studio API key? No. It authenticates with OAuth via your existing Google AI Pro subscription. No API key is read, set, or stored.
Which Gemini models does it support?
--model flash → Gemini 3.5 Flash (via agy), --model pro → Gemini 3.1 Pro. The model aliases
are resolved per backend.
How is this different from a Gemini MCP server? This is a Claude Code skill/plugin, not an MCP server. It auto-invokes from context (no per- session MCP config), supports the builder→judge and parallel patterns out of the box, and needs no API key — it rides your Pro subscription.
Can it run prompts in parallel?
Yes — parallel fans out N prompts concurrently (each agy call uses an isolated workspace).
Is it safe to feed it untrusted text?
The gemini CLI backend receives the prompt over stdin, so untrusted text never reaches a shell. The agy backend passes the prompt as a direct process argument (a list-form argv, so no shell is involved and it is not injectable); on top of that the model label is allowlist-validated and the prompt length is capped.
How do I use Gemini from Claude Code?
Install the plugin (/plugin marketplace add MarioMagdy/gemini-as-tool then /plugin install gemini-as-tool@gemini-as-tool) and just ask Claude things like "use Gemini to review
this" — the skill auto-invokes. Under the hood it calls
python "$CLAUDE_PLUGIN_ROOT/skills/gemini-as-tool/gemini_tool.py" ask "..." for you.
Is this free? Yes, with a Google AI Pro subscription. The plugin authenticates with OAuth via your existing Google account — no separate API key, and no per-token billing on top of the subscription. (We don't quote a specific subscription price here; check Google's site for current AI Pro pricing.)
These are the verbatim error strings users Google for — match the string exactly to the fix.
| Error (verbatim) | Fix |
|---|---|
agy run finished but conversation could not be located |
Increase the timeout. For builds pass --timeout 2700 (the default 300 s kills the run mid-build). The harness needs the post-run window to read agy's transcript store. |
agy -p prints nothing on Windows |
That is a known agy bug (antigravity-cli#115 / gemini-cli#27466) — agy -p is intentionally empty on stdout. Use the gemini-as-tool harness; it reads the response from agy's own transcript store at ~/.gemini/antigravity-cli/brain/<conv-id>/.system_generated/logs/transcript.jsonl. |
| Method | API key | Auto-invokes in Claude Code | Builder/judge + parallel |
|---|---|---|---|
| gemini-as-tool (this) | No (OAuth) | Yes | Yes |
| Gemini MCP server | Usually yes | No (manual) | Manual |
| Direct Gemini API call | Yes | No | Manual |
MIT © MarioMagdy