Gemini CLI Integration for Claude Code

A complete guide to using Gemini CLI as a cheap, parallel analysis layer inside Claude Code. Gemini handles bulk read-only work; Claude handles judgment, decisions, and file writes.


Table of Contents

  1. Philosophy
  2. Prerequisites
  3. Setup Overview
  4. CLAUDE.md Configuration
  5. Investigator Agent
  6. Gemini Agents Skill
  7. The Fallback Function
  8. Usage Patterns & Examples
  9. Integrating Into Your Own Agents
  10. Troubleshooting

1. Philosophy

The core idea is a two-tier delegation model:

Role Claude Code Gemini CLI
Purpose Judgment, decisions, writes Bulk analysis, pattern finding
Cost Higher Much cheaper
Capabilities Full (read + write + execute) Read-only analysis
Best for Multi-step work, final decisions, file edits Scanning 50+ files, summarizing, validating data

The pattern: