Gemini CLI integration plugin for Claude Code — multi-model collaboration and token optimization
npx claudepluginhub andytargino/gemini-bridgeBridge between Claude Code and Google Gemini CLI — delegate heavy tasks to Gemini to save Claude tokens
Claude Code plugin that integrates Google Gemini CLI for multi-model collaboration and token optimization.
Delegate heavy tasks (analysis, planning, code review, test generation) to Gemini CLI while Claude Code focuses on orchestration and applying changes. Save Claude tokens by letting Gemini handle the bulk of the work.
Claude Code tokens are expensive. Gemini CLI is free (with Google account) and has a massive 1M-2M token context window. This plugin lets you use the best of both:
| Claude Code | Gemini CLI |
|---|---|
| Orchestration & decisions | Heavy analysis & research |
| Applying code changes | Code generation drafts |
| User interaction | Architecture reviews |
| Quality control | Test generation |
| Final validation | Refactoring suggestions |
Result: Same quality, fraction of the Claude token cost.
npm install -g @google/gemini-cli
gemini # Run once to authenticate
claude plugin add AndyTargino/gemini-bridge
That's it. The plugin registers 6 skills, 3 agents, and lifecycle hooks automatically.
After installing the plugin, copy the bridge scripts so they're available globally:
cp ~/.claude/plugins/cache/gemini-bridge/gemini-bridge/1.0.0/lib/gemini-bridge.sh ~/.claude/gemini-bridge.sh
cp ~/.claude/plugins/cache/gemini-bridge/gemini-bridge/1.0.0/lib/gemini-session.sh ~/.claude/gemini-session.sh
chmod +x ~/.claude/gemini-bridge.sh ~/.claude/gemini-session.sh
Use these directly in Claude Code:
| Command | What it does |
|---|---|
/gemini-bridge:gemini-ask | Send any question/task to Gemini |
/gemini-bridge:gemini-analyze | Deep code & architecture analysis |
/gemini-bridge:gemini-review | Code review (bugs, security, performance) |
/gemini-bridge:gemini-plan | Implementation planning |
/gemini-bridge:gemini-test | Generate tests from source code |
/gemini-bridge:gemini-refactor | Refactoring suggestions with risk assessment |
# Ask Gemini anything
/gemini-bridge:gemini-ask explain the observer pattern in TypeScript
# Analyze a file
/gemini-bridge:gemini-analyze src/services/auth.ts
# Review your changes before committing
/gemini-bridge:gemini-review diff
# Plan a feature (Gemini plans, Claude implements)
/gemini-bridge:gemini-plan add push notification system
# Generate tests
/gemini-bridge:gemini-test src/utils/validators.ts
# Get refactoring ideas
/gemini-bridge:gemini-refactor src/controllers/userController.ts
Claude can spawn these agents to run Gemini tasks in background while continuing other work:
| Agent | Purpose |
|---|---|
gemini-analyst | Research, analysis, strategy |
gemini-coder | Code generation + validation + apply |
gemini-reviewer | Thorough code review |
1. /gemini-bridge:gemini-plan [feature] → Gemini creates the plan
2. Claude implements following the plan → Claude applies code
3. /gemini-bridge:gemini-review diff → Gemini reviews the result
4. /gemini-bridge:gemini-test [file] → Gemini generates tests
By default, Gemini runs in standard mode and asks for confirmation before executing actions (reading files, running commands, etc.). Enable YOLO mode to let Gemini auto-approve everything:
Create ~/.claude/gemini-bridge.conf:
# Let Gemini run freely without confirmation prompts
GEMINI_YOLO=true
# Optionally override the model
GEMINI_MODEL=gemini-2.5-pro
A template is included at lib/gemini-bridge.conf.example.
# Enable YOLO for one call
bash ~/.claude/gemini-bridge.sh --yolo "analyze this code for bugs"
# Disable YOLO even if config says true
bash ~/.claude/gemini-bridge.sh --no-yolo "review this carefully"
export GEMINI_YOLO=true
Override the default Gemini model:
# Via config file
GEMINI_MODEL=gemini-2.5-pro
# Via flag
bash ~/.claude/gemini-bridge.sh --model gemini-2.5-flash "quick question"
# Via environment
export GEMINI_MODEL=gemini-2.5-pro
| Setting | Default | Description |
|---|---|---|
GEMINI_YOLO | false | Auto-approve all Gemini actions |
GEMINI_MODEL | (CLI default) | Override Gemini model |
MAX_RETRIES | 2 | Retry count on transient failures |
RETRY_DELAY | 3 | Seconds between retries |