Gemini Code
Gemini Code
Section titled “Gemini Code”Gemini CLI is Google’s high-performance terminal interface for interacting with Gemini models. It provides a robust platform for agentic coding, specialized subagents, and advanced tool use, making it a powerful companion to Claude Code.
What is Gemini CLI?
Section titled “What is Gemini CLI?”Gemini CLI (often referred to as gemini) allows you to interact with Google’s most capable models directly from your shell. Its primary strengths lie in:
- Massive Context Window: Native support for Gemini 1.5 Pro’s 2M+ token context window.
- Multimodal Native: Better at handling image and video inputs for UI/UX analysis.
- Agentic Infrastructure: Built-in support for specialized “Subagents” that can execute tasks in parallel or in isolation.
- System Integration: Seamless access to your local filesystem and terminal environment.
Gemini Subagents
Section titled “Gemini Subagents”Subagents are specialized “specialists” with their own system prompts, personas, and toolsets. They are designed to handle complex tasks without polluting the main conversation’s context.
Custom Subagent Definitions
Section titled “Custom Subagent Definitions”In our community workflow, we use specific subagents to maintain brand consistency and quality standards. These are defined in .gemini/agents/:
| Agent | Purpose | Primary Workflow |
|---|---|---|
| @ui-builder | Component implementation | Builds UI components adhering to brand rules and design tokens. |
| @a11y-reviewer | Accessibility audits | Performs audits using a WCAG checklist to ensure compliance. |
| @visual-qa | Viewport testing | Uses Playwright to test components across 375px, 768px, and 1024px viewports. |
How to Use Subagents
Section titled “How to Use Subagents”From the Gemini CLI, you can delegate specific tasks to these agents:
# Example commands:@ui-builder Build the StoreStatusBadge component per FRICTIONLESS_PLAN.md section 3.1@a11y-reviewer Review src/components/homepage/StoreStatusBadge.tsx for accessibility@visual-qa Test the homepage across mobile, tablet, and desktop viewportsJules: The Asynchronous Agent
Section titled “Jules: The Asynchronous Agent”The Jules extension is a game-changer for long-running tasks. Unlike standard agents that wait for your input, Jules operates asynchronously in a dedicated environment.
Key Capabilities
Section titled “Key Capabilities”- Asynchronous Execution: Delegate a task (like “Fix all linting errors in the
libfolder”) and continue working on other things. - Sandboxed VM: Jules clones your code, installs dependencies, and runs tests inside its own virtual machine.
- GitHub Integration: Automatically pulls GitHub issues and submits PRs upon completion.
- Parallel Processing: Can handle multiple issues or tasks simultaneously.
Installation
Section titled “Installation”gemini extensions install https://github.com/gemini-cli-extensions/jules --auto-updateNote: Requires a Jules account at jules.google.com and repository connection via the Jules console.
Multi-Model Orchestration
Section titled “Multi-Model Orchestration”For complex full-stack projects, we recommend a “Divide and Conquer” strategy between Claude and Gemini. This is detailed in our FRICTIONLESS_PLAN.md (Section 8).
Task Assignment Rationale
Section titled “Task Assignment Rationale”| Task Type | Recommended Model | Why? |
|---|---|---|
| Logical Refactoring | Claude (Sonnet 3.5) | Superior reasoning for complex code logic and architectural changes. |
| Massive Context Tasks | Gemini (1.5 Pro) | Best for “Search and Destroy” missions across millions of tokens or multi-file analysis. |
| UI/UX & Visual QA | Gemini (1.5 Pro/Flash) | Better native multimodal understanding of screenshots and design files. |
| Background Maintenance | Jules (Gemini-powered) | Perfect for dependency updates, linting, and unit test expansion while you code. |
Collaboration Rules
Section titled “Collaboration Rules”- File Ownership: Avoid having two models write to the same file in the same session.
- Commit Cadence: Commit after every successful agentic loop to provide a “checkpoint” for the next model.
- Parallel Workflows: Use
tmuxto run Claude in one pane for feature development and Gemini in another for documentation and QA.
Setup & Experimental Configuration
Section titled “Setup & Experimental Configuration”To unlock the full potential of subagents, you must enable experimental features in your settings.
Enable Agents
Section titled “Enable Agents”Edit your ~/.gemini/settings.json file to include:
{ "experimental": { "enableAgents": true }}Community Tips for Government/Military Users
Section titled “Community Tips for Government/Military Users”- Data Residency: Be aware that Gemini CLI transmits data to Google Cloud. Check your organization’s sensitivity level for proprietary or CUI code.
- Tool Safety: Use the
/safeor/askmodes if you are uncomfortable with the “YOLO” execution of shell commands. - Context Injection: Use
llms.txtand.gemini-rulesfiles to provide mission-specific context without manually pasting it every time.
Related Resources
Section titled “Related Resources”- Chrome DevTools MCP - Agentic browser control and debugging
- Claude Code Guide - Comparison and complementary workflows
- Full-Stack Development with AI - Broad AI integration strategies
- Project Rules & Lessons Learned - Maintaining
CLAUDE.mdand.gemini-rules
External Links
Section titled “External Links”- Gemini CLI Documentation
- Jules Console
- Google AI Studio - For API key management and model testing