Large Context Analysis via Gemini CLI
When to Use (Scope-Based Triggers)
Automatically invoke when the task involves:
- •Analyzing "entire codebase" or "whole project"
- •Finding patterns across "all files" or multiple directories
- •Architecture or structure analysis
- •Implementation verification: "Is X implemented?", "Find all uses of Y"
- •Comparing conventions across modules
- •Any question requiring project-wide code understanding
Execution Flow
- •Notify briefly: "Using Gemini CLI for this codebase-wide analysis..."
- •Construct command with appropriate
@paths and specific prompt - •Execute via Bash and capture output
- •Integrate findings into coherent response with file paths
Command Syntax
gemini -p "@<path> <prompt>"
| Task | Command |
|---|---|
| Full project | gemini --all_files -p "<prompt>" |
| Source only | gemini -p "@src/ <prompt>" |
| With tests | gemini -p "@src/ @tests/ <prompt>" |
| Specific dirs | gemini -p "@src/auth/ @middleware/ <prompt>" |
| Multi-file | gemini -p "@package.json @src/index.js <prompt>" |
Prompt Principles
- •Be specific: "List files and functions", not "find it"
- •Request evidence: "Show relevant code snippets"
- •Ask for structure: "Organize by module with file paths"
Notes
- •
@paths are relative to current working directory - •No
--yoloflag needed for read-only analysis - •Gemini handles codebases exceeding Claude's context limits