gemini-plugin
Claude Code plugin that integrates Gemini CLI for code review, task delegation, and codebase analysis.
Uses your Google subscription (oauth-personal) for authentication — no API key billing.
Prerequisites
-
Install Gemini CLI
bun install -g @google/gemini-cli
-
Authenticate — run gemini interactively to complete Google OAuth.
-
Verify
gemini "what is 2+2" -o text --approval-mode yolo
Installation
Install from the local directory source:
/plugins install /path/to/gemini-plugin
Or point extraKnownMarketplaces in ~/.claude/settings.json at the repo directory:
{
"extraKnownMarketplaces": {
"gemini-local": {
"source": { "source": "directory", "path": "/path/to/gemini-plugin" }
}
}
}
Commands
/gemini:rescue — Delegate work to Gemini
Hand a task to Gemini for a second opinion, debugging, implementation, or research.
/gemini:rescue fix the race condition in src/worker.ts
/gemini:rescue --background investigate why the auth tests are flaky
/gemini:rescue -m pro refactor the database layer for connection pooling
/gemini:rescue --dirs src,lib --read-only explain how the caching layer works
| Flag | Description |
|---|
--background | Run in the background; you'll be notified on completion |
--wait | Run in the foreground (default) |
--read-only | Gemini won't make file edits |
--dirs path,... | Scope Gemini's context to specific directories |
--files pattern | Pipe matching files to Gemini via stdin |
-m model | Override model (see Models) |
By default, Gemini runs in write mode (--approval-mode auto_edit) so it can read and edit files in the repo.
/gemini:review — Code review
Run a Gemini code review against local git changes (staged + unstaged).
/gemini:review
/gemini:review --base main
/gemini:review --scope branch
/gemini:review --background
| Flag | Description |
|---|
--base <ref> | Diff against a specific git ref |
--scope auto|working-tree|branch | What to review (default: auto) |
--background | Run in the background |
-m model | Override model |
The command estimates diff size and recommends foreground vs background execution. Review output is returned verbatim — Claude will not auto-apply fixes.
/gemini:adversarial-review — Challenge review
Like /gemini:review, but questions the implementation approach, design choices, tradeoffs, and assumptions rather than just looking for bugs.
/gemini:adversarial-review
/gemini:adversarial-review focus on the error handling strategy
/gemini:adversarial-review --base feature-branch
Accepts the same flags as /gemini:review, plus optional free-text focus areas appended after the flags.
/gemini:optimize — Plan before spending quota
Analyze a task and recommend the optimal model, context scope, and prompt structure before consuming quota.
/gemini:optimize security audit of the auth module
/gemini:optimize --dirs src explain the data pipeline architecture
/gemini:optimize -m pro refactor the API layer
Reports:
- Quota impact — estimated tokens, context usage %, cost tier
- Recommended command — ready-to-copy
/gemini:rescue with optimal flags
- Optimized prompt — structured prompt using Gemini best practices
- Warnings — if the task would burn significant quota
/gemini:setup — Check readiness
Verify Gemini CLI installation, authentication, and configuration. Offers to install if missing.
/gemini:setup
Models
Positioning — this is a reluctant fallback tool. The oauth-personal subscription has pathologically tight quotas: pro tiers are ~1-2 calls/month, non-lite flash is daily-limited and depletes fast. For routine work, always prefer:
/gemma:rescue — local (Ollama), free, uses a dense 31B model for review/adversarial-review when installed. This is the default cheap-tier option.
/codex:rescue — different subscription (ChatGPT), generally more headroom for agentic coding work.
- Claude itself — when the main thread already has the relevant context.
Only reach for gemini when its specific advantages matter: the 1M-token context window, an orthogonal model family for second-opinion work, or agentic tool use needing deeper reasoning than gemma can provide.
Default across every subcommand: gemini-3.1-flash-lite-preview (quota-minimal). Automatically falls back to gemini-2.5-flash-lite if the 3.1 preview is exhausted or deprecated. Non-lite flash and all pro tiers require explicit -m and should rarely be used.
Aliases: