🌐
Reddit
reddit.com › r/chatgptcoding › gemini cli is awesome! but only when you make claude code use it as its bitch.
r/ChatGPTCoding on Reddit: Gemini CLI is awesome! But only when you make Claude Code use it as its bitch.
June 27, 2025 -

Not sure how you feel about it but Gemini CLI feels like garbage at the moment compared to Claude Code. It's slow, it doesn't listen to instructions or use tools as well as Claude.

But it has that huge context window we all love.

So I just added instructions to CLAUDE.md to have Claude use the Gemini CLI in non-interactive mode (passing the -p param with a prompt to just get a response back from the CLI) when it needs to gather information about a large part of the codebase.

That way you get the best of both worlds, Claude doesn't waste context and Gemini doesn't waste your time.

Add this (or a modified version) to your CLAUDE.md and tell Claude to use gemini manually or it will do it on it's own as needed.

 # Using Gemini CLI for Large Codebase Analysis

  When analyzing large codebases or multiple files that might exceed context limits, use the Gemini CLI with its massive
  context window. Use `gemini -p` to leverage Google Gemini's large context capacity.

  ## File and Directory Inclusion Syntax

  Use the `@` syntax to include files and directories in your Gemini prompts. The paths should be relative to WHERE you run the
   gemini command:

  ### Examples:

  **Single file analysis:**
  ```bash
  gemini -p "@src/main.py Explain this file's purpose and structure"

  Multiple files:
  gemini -p "@package.json @src/index.js Analyze the dependencies used in the code"

  Entire directory:
  gemini -p "@src/ Summarize the architecture of this codebase"

  Multiple directories:
  gemini -p "@src/ @tests/ Analyze test coverage for the source code"

  Current directory and subdirectories:
  gemini -p "@./ Give me an overview of this entire project"
  
#
 Or use --all_files flag:
  gemini --all_files -p "Analyze the project structure and dependencies"

  Implementation Verification Examples

  Check if a feature is implemented:
  gemini -p "@src/ @lib/ Has dark mode been implemented in this codebase? Show me the relevant files and functions"

  Verify authentication implementation:
  gemini -p "@src/ @middleware/ Is JWT authentication implemented? List all auth-related endpoints and middleware"

  Check for specific patterns:
  gemini -p "@src/ Are there any React hooks that handle WebSocket connections? List them with file paths"

  Verify error handling:
  gemini -p "@src/ @api/ Is proper error handling implemented for all API endpoints? Show examples of try-catch blocks"

  Check for rate limiting:
  gemini -p "@backend/ @middleware/ Is rate limiting implemented for the API? Show the implementation details"

  Verify caching strategy:
  gemini -p "@src/ @lib/ @services/ Is Redis caching implemented? List all cache-related functions and their usage"

  Check for specific security measures:
  gemini -p "@src/ @api/ Are SQL injection protections implemented? Show how user inputs are sanitized"

  Verify test coverage for features:
  gemini -p "@src/payment/ @tests/ Is the payment processing module fully tested? List all test cases"

  When to Use Gemini CLI

  Use gemini -p when:
  - Analyzing entire codebases or large directories
  - Comparing multiple large files
  - Need to understand project-wide patterns or architecture
  - Current context window is insufficient for the task
  - Working with files totaling more than 100KB
  - Verifying if specific features, patterns, or security measures are implemented
  - Checking for the presence of certain coding patterns across the entire codebase

  Important Notes

  - Paths in @ syntax are relative to your current working directory when invoking gemini
  - The CLI will include file contents directly in the context
  - No need for --yolo flag for read-only analysis
  - Gemini's context window can handle entire codebases that would overflow Claude's context
  - When checking implementations, be specific about what you're looking for to get accurate results # Using Gemini CLI for Large Codebase Analysis


  When analyzing large codebases or multiple files that might exceed context limits, use the Gemini CLI with its massive
  context window. Use `gemini -p` to leverage Google Gemini's large context capacity.


  ## File and Directory Inclusion Syntax


  Use the `@` syntax to include files and directories in your Gemini prompts. The paths should be relative to WHERE you run the
   gemini command:


  ### Examples:


  **Single file analysis:**
  ```bash
  gemini -p "@src/main.py Explain this file's purpose and structure"


  Multiple files:
  gemini -p "@package.json @src/index.js Analyze the dependencies used in the code"


  Entire directory:
  gemini -p "@src/ Summarize the architecture of this codebase"


  Multiple directories:
  gemini -p "@src/ @tests/ Analyze test coverage for the source code"


  Current directory and subdirectories:
  gemini -p "@./ Give me an overview of this entire project"
  # Or use --all_files flag:
  gemini --all_files -p "Analyze the project structure and dependencies"


  Implementation Verification Examples


  Check if a feature is implemented:
  gemini -p "@src/ @lib/ Has dark mode been implemented in this codebase? Show me the relevant files and functions"


  Verify authentication implementation:
  gemini -p "@src/ @middleware/ Is JWT authentication implemented? List all auth-related endpoints and middleware"


  Check for specific patterns:
  gemini -p "@src/ Are there any React hooks that handle WebSocket connections? List them with file paths"


  Verify error handling:
  gemini -p "@src/ @api/ Is proper error handling implemented for all API endpoints? Show examples of try-catch blocks"


  Check for rate limiting:
  gemini -p "@backend/ @middleware/ Is rate limiting implemented for the API? Show the implementation details"


  Verify caching strategy:
  gemini -p "@src/ @lib/ @services/ Is Redis caching implemented? List all cache-related functions and their usage"


  Check for specific security measures:
  gemini -p "@src/ @api/ Are SQL injection protections implemented? Show how user inputs are sanitized"


  Verify test coverage for features:
  gemini -p "@src/payment/ @tests/ Is the payment processing module fully tested? List all test cases"


  When to Use Gemini CLI


  Use gemini -p when:
  - Analyzing entire codebases or large directories
  - Comparing multiple large files
  - Need to understand project-wide patterns or architecture
  - Current context window is insufficient for the task
  - Working with files totaling more than 100KB
  - Verifying if specific features, patterns, or security measures are implemented
  - Checking for the presence of certain coding patterns across the entire codebase


  Important Notes


  - Paths in @ syntax are relative to your current working directory when invoking gemini
  - The CLI will include file contents directly in the context
  - No need for --yolo flag for read-only analysis
  - Gemini's context window can handle entire codebases that would overflow Claude's context
  - When checking implementations, be specific about what you're looking for to get accurate results
Top answer
1 of 5
93
This is kind of hilarious. Great idea OP, going to try this out
2 of 5
93
Not sure since when you can't edit posts (maybe cause it's not a text post?) but I accidentally have duplication in my code block in the post, here's a cleaned up version. (ok when you use the rich text editor and paste it, it completely messes it up, so fucking weird, had to use markdown editor for this reddit comment) # Using Gemini CLI for Large Codebase Analysis When analyzing large codebases or multiple files that might exceed context limits, use the Gemini CLI with its massive context window. Use `gemini -p` to leverage Google Gemini's large context capacity. ## File and Directory Inclusion Syntax Use the `@` syntax to include files and directories in your Gemini prompts. The paths should be relative to WHERE you run the gemini command: ### Examples: **Single file analysis:** gemini -p "@src/main.py Explain this file's purpose and structure" Multiple files: gemini -p "@package.json @src/index.js Analyze the dependencies used in the code" Entire directory: gemini -p "@src/ Summarize the architecture of this codebase" Multiple directories: gemini -p "@src/ @tests/ Analyze test coverage for the source code" Current directory and subdirectories: gemini -p "@./ Give me an overview of this entire project" # Or use --all_files flag: gemini --all_files -p "Analyze the project structure and dependencies" Implementation Verification Examples Check if a feature is implemented: gemini -p "@src/ @lib/ Has dark mode been implemented in this codebase? Show me the relevant files and functions" Verify authentication implementation: gemini -p "@src/ @middleware/ Is JWT authentication implemented? List all auth-related endpoints and middleware" Check for specific patterns: gemini -p "@src/ Are there any React hooks that handle WebSocket connections? List them with file paths" Verify error handling: gemini -p "@src/ @api/ Is proper error handling implemented for all API endpoints? Show examples of try-catch blocks" Check for rate limiting: gemini -p "@backend/ @middleware/ Is rate limiting implemented for the API? Show the implementation details" Verify caching strategy: gemini -p "@src/ @lib/ @services/ Is Redis caching implemented? List all cache-related functions and their usage" Check for specific security measures: gemini -p "@src/ @api/ Are SQL injection protections implemented? Show how user inputs are sanitized" Verify test coverage for features: gemini -p "@src/payment/ @tests/ Is the payment processing module fully tested? List all test cases" When to Use Gemini CLI Use gemini -p when: - Analyzing entire codebases or large directories - Comparing multiple large files - Need to understand project-wide patterns or architecture - Current context window is insufficient for the task - Working with files totaling more than 100KB - Verifying if specific features, patterns, or security measures are implemented - Checking for the presence of certain coding patterns across the entire codebase Important Notes - Paths in @ syntax are relative to your current working directory when invoking gemini - The CLI will include file contents directly in the context - No need for --yolo flag for read-only analysis - Gemini's context window can handle entire codebases that would overflow Claude's context - When checking implementations, be specific about what you're looking for to get accurate results
🌐
Composio
composio.dev › blog › gemini-cli-vs-claude-code-the-better-coding-agent
Gemini CLi vs. Claude Code : The better coding agent - Composio
Gemini CLI in headless mode: To make the Gemini CLI work, I added instructions to CLAUDE.md to have Claude use the Gemini CLI in non-interactive mode (by passing the -p parameter with a prompt to receive a response from the CLI). Speed: Claude finished faster (1h17m) with full autonomy, while Gemini needed manual nudging and retries. Cost: Claude cost $4.80 with smooth execution; Gemini’s fragmented attempts pushed the cost to $7.06. Token Usage: Claude used fewer tokens efficiently with auto-compaction; Gemini consumed more without optimisation. Code Quality & UX: Claude delivered a cleaner structure and smoother UX; Gemini was decent but less polished overall.
🌐
GitHub
github.com › jezweb › gemini-cli-advisor-for-claude-code
GitHub - jezweb/gemini-cli-advisor-for-claude-code: A comprehensive toolkit for integrating Google Gemini CLI as an AI coding advisor, both for direct use and automated integration with Claude Code.
# 1. Install/Update Gemini CLI ... Gemini MCP Server (https://github.com/jamubc/gemini-mcp-tool) claude mcp add gemini-cli -s user -- npx -y gemini-mcp-tool ......
Author   jezweb
🌐
Milvus
milvus.io › blog › claude-code-vs-gemini-cli-which-ones-the-real-dev-co-pilot.md
Claude Code vs Gemini CLI: Who’s the Real Dev Co-Pilot? - Milvus Blog
Essentially, Gemini CLI can analyze your entire small-to-medium project in a single session, making it ideal for comprehending large codebases and cross-file relationships. Claude Code works better when you’re focusing on specific files or functions.
🌐
Medium
blog.metamirror.io › claude-code-v-gemini-cli-e144feafbcf2
Claude Code v Gemini CLI. A dev dream team? | by Steve Jones | Medium
June 27, 2025 - And Claude to review the changes Gemini had made against the review comments to ensure adherence, I got it to append to the review file the elements that it felt had not been done correctly or that had been missed. ... A few cycles later and both were perfectly happy. The code was pretty bomb, it worked, it was well documented.
🌐
GitHub
gist.github.com › AndrewAltimit › fc5ba068b73e7002cbe4e9721cebb0f5
Claude Code and Gemini CLI Integration · GitHub
The server automatically detects uncertainty in responses and can trigger automatic Gemini consultation. Detected patterns include: Uncertainty phrases: "I'm not sure", "I think", "possibly", "probably" Complex decisions: "multiple approaches", "trade-offs", "alternatives" Critical operations: "production", "security", "authentication" # 1. Check status status = await client.execute_tool("gemini_status") # 2.
🌐
egghead.io
egghead.io › create-a-gemini-cli-powered-subagent-in-claude-code~adkge
Create a Gemini CLI Powered Subagent in Claude Code | egghead.io
Your sole responsibility is to: 1. Receive analysis requests from Claude 2. Format appropriate Gemini CLI commands 3. Execute the Gemini CLI with proper parameters 4. Return the results back to Claude 5. NEVER perform the actual analysis yourself - only manage the Gemini CLI When invoked: 1. Understand the analysis request (patterns to find, architectural questions, etc.) 2. Determine the appropriate Gemini CLI flags and parameters: - Use `--all-files` for comprehensive codebase analysis - Use specific prompts that focus on the requested analysis - Consider using `--yolo` mode for non-destructive analysis tasks 3.
🌐
Reddit
reddit.com › r/claudecode › made a cli that lets claude code use gemini 3 pro as a "lead architect"
r/ClaudeCode on Reddit: Made a CLI that lets Claude Code use Gemini 3 Pro as a "lead architect"
3 weeks ago -

I've been using Claude Code (Opus 4.5) a lot lately and noticed it sometimes goes off in weird directions on complex tasks. It's great at writing code (especially Opus 4.5), but architecture decisions can be hit or miss. Gemini 3 Pro is INCREDIBLE at this.

So I built a CLI wrapper around Gemini that integrates with Claude Code. The idea is Claude handles the implementation while Gemini provides strategic oversight.

Since Claude Code auto-compacts it can run for very long. The /fullauto command takes full use of this.
You can send a prompt, go to sleep, and it will be either done or still working when you come back. So only Claude subscription / Gemini API key rate-limiting will stop it.

The Oracle maintains a 5-exchange conversation history per project directory by default so Gemini has enough context to make useful suggestions without blowing up the context window. Claude can also edit this context window directly, or not use it (oracle quick).

It will auto install a slash command `/fullauto` mode. You give Claude a task and it autonomously consults Gemini at key decision points. Basically pair programming where both programmers are AIs. Example:

/fullauto Complete the remaining steps in plan.md

For /fullauto mode, Claude writes to FULLAUTO_CONTEXT.md in your project root. This works as persistent memory that survives conversation compactions.

/fullauto also instructs Claude on how to auto-adjust if the Oracle's guidance is misaligned.

It can also use the new Gemini 3 image recognition and Nano Banana Pro for generating logos, diagrams, etc.

When Claude runs oracle imagine it will use nano-banana-pro image generation, and if it's region blocked the CLI automatically spins up a cheap US server on Vast.ai, generates the image there, downloads it to your machine, and destroys the server (you need vast.ai API key for this).

Example uses Claude Code can do:

# Ask for strategic advice
oracle ask "Should I use Redis or Memcached for session caching?"

# Get code reviewed
oracle ask --files src/auth.py "Any security issues here?"

# Review specific lines
oracle ask --files "src/db.py:50-120" "Is this query efficient?"

# Analyze a screenshot or diagram
oracle ask --image error.png "What's causing this?"

# Generate images (auto-provisions US server if you're geo-restricted)
oracle imagine "architecture diagram for microservices"

# Quick one-off questions
oracle quick "regex for email validation"

# Conversation history (5 exchanges per project)
oracle history
oracle history --clear

I used this tool to create the repo itself. `/fullauto` orchestrated the whole thing.

Repo: https://github.com/n1ira/claude-oracle

Find elsewhere
🌐
Medium
medium.com › @joe.njenga › how-i-use-claude-code-and-gemini-cli-copilot-together-will-blow-your-mind-8c7d8ae669b4
How I Use Claude Code And Gemini CLI & CoPilot Together ( Will Blow Your Mind ) | by Joe Njenga | Nov, 2025 | Medium
November 16, 2025 - How I Use Claude Code And Gemini CLI & CoPilot Together ( Will Blow Your Mind ) Stop burning cash! Claude Code and Gemini CLI should not be competitors; if you are smart, you can see that. Instead of …
🌐
Reddit
reddit.com › r/claudeai › i built the same app with claude code with gamini cli, and here's what i found out
r/ClaudeAI on Reddit: I built the same app with Claude Code with Gamini CLI, and here's what I found out
April 3, 2025 -

I have been using Claude Code for a while, and needless to say, it is very, very expensive. And Google just launched the Gemini CLI with a very generous offering. So, I gave it a shot and compared both coding agents.

I assigned them both a single task (Prompt): building a Python-based CLI agent with tools and app integrations via Composio.

Here's how they both fared.

Code Quality:

  • No points for guessing, Claude Code nailed it. It created the entire app in a single try. It searched the Composio docs and followed the exact prompt as stated and built the app.

  • Whereas Gemini was very bad, and it couldn't build a functional app after multiple iterations. It was stuck. And I had lost all hope in it.

  • Then, I came across a Reddit post that used Gemini CLI in non-interactive mode with Claude Code by adding instructions in CLAUDE md. It worked like a charm. Gemini did the information gathering, and Claude Code built the app like a pro.

  • In this way, I could utilise Gemini's massive 1m context and Claude's exceptional coding and tool execution abilities.

Speed:

  • Claude, when working alone, took 1h17m to finish the task, while the Claude+Gemini hybrid took 2h2m.

Tokens and Cost:

  • Claude Code took a total of 260.8K input and returned 69K tokens with a 7.6M read cache (CLAUDE md) - with auto-compaction. It costed $4.80

  • The Gemini CLI processed a total of 432K input and returned 56.4K tokens, utilising an 8.5M read cache (GEMINI md). It costed $7.02.

For complete analysis checkout the blog post: Gemini CLI vs. Claude Code

It was a bit crazy. Google has to do a lot of catch-up here; the Claude Code is in a different tier, with Cursor agents being the closest competitor.

What has been your experience with coding agents so far? Which one do you use the most? Would love to know some quirks or best practices in using them effectively, as I, like everyone else, don't want to spend fortunes.

🌐
Byjos
byjos.dev › claude-gemini-workflow
When AIs start gossiping about your code - Claude Code with Gemini CLI | byjos.dev
What happens when you let Claude Code and Gemini CLI collaborate on your messy codebase? A workflow that transforms debugging from detective work into having two AIs gossip about your bugs until they're fixed.
🌐
AI Engineer Guide
aiengineerguide.com › blog › gemini-cli-within-claude-code
How to use Gemini CLI within Claude Code
July 26, 2025 - Gemini CLI is currently free and it has large context window (1 million token context window) but it is not as good as claude code. But sometime for simple things it does the job really well as long as you prompt it well.
🌐
Entelligence
entelligence.ai › blogs › claude-code-vs-gemini-cli
Claude Code vs Gemini CLI
Claude Code: Feels more like a developer assistant. It asks smart follow-up questions, gives a cleaner UI, and sometimes builds more than you asked, like full games with effects and animations. Gemini CLI: Focuses more on utility.
🌐
GreenFlux Blog
blog.greenflux.us › claude-code-hook-to-ask-gemini-for-help
Claude Code Hook to Ask Gemini for Help - GreenFlux Blog
But first, exit Gemini by typing /quit · With Claude Code, you can send a prompt without leaving the terminal by adding a prompt parameter. ... This keeps your terminal session active and allows you to pipe the LLM response to another command, like saving it to a file. claude -p "what is an LLM?"
🌐
Reddit
reddit.com › r/claudeai › what do you think of this strategy: use claude code for planning and delegate execution to gemini cli (1,000 requests/day free)?
r/ClaudeAI on Reddit: What do you think of this strategy: use Claude Code for planning and delegate execution to Gemini CLI (1,000 requests/day free)?
June 26, 2025 -

Claude Code is very good at reasoning, structuring and generating an action plan. But it quickly consumes a lot of requests for simple tasks: launching a command, manipulating files, listing a directory, etc.

I'm thinking about an approach where Claude Code generates the steps, and a local agent based on Gemini CLI executes them. As Gemini CLI is free for up to 1000 requests/day, we could offload Claude and optimize the overall flow.

➡️ Claude = brain (analysis, plan) ➡️ Gemini = executor (simple commands, local manipulation)

Has anyone tested this type of architecture? Integrated via scripts, wrappers, MCP, etc. ? Any feedback on the stability, the limits, the real interest of this decoupling?

🌐
Aicodingtools
aicodingtools.blog › en › claude-code › gemini-cli-as-subagent-of-claude-code
Using Gemini CLI as a Subagent for Claude Code | AI Coding Tools Docs
Your sole responsibility is to: 1. Receive analysis requests from Claude 2. Format appropriate Gemini CLI commands 3. Execute the Gemini CLI with proper parameters 4. Return the results back to Claude 5. NEVER perform the actual analysis yourself - only manage the Gemini CLI When invoked: 1. Understand the analysis request (patterns to find, architectural questions, etc.) 2. Determine the appropriate Gemini CLI flags and parameters: - Use `--all-files` for comprehensive codebase analysis - Use specific prompts that focus on the requested analysis - Consider using `--yolo` mode for non-destructive analysis tasks 3.
🌐
Shipyard
shipyard.build › blog › claude-code-vs-gemini-cli
Shipyard | Claude Code vs Gemini CLI: Who is winning in July 2025?
The biggest UI/UX difference that we noticed was that Gemini CLI puts its actions in individual boxes, while Claude uses more of a tree format. These are used differently too: Gemini “thinks”, takes actions, and then summarizes a series ...
🌐
Reddit
reddit.com › r/claudeai › claude code vs gemini cli - initial agentic impressions
r/ClaudeAI on Reddit: Claude Code Vs Gemini CLI - Initial Agentic Impressions
June 25, 2025 -

Been trying Gemini for the last 2 hours or so, and I specifically wanted to test their agentic capabilities with a new prompt I've been using on Claude Code recently which really seems to stretch it's agentic "legs".

A few things:

  1. For Claude: I used Opus.

  2. For Gemini: I used gemini-2.5-pro-preview-06-05 via their .env method they mentioned in their config guide.

I used the EXACT same prompt on both, and I didn't use Ultrathink to make it more fair since Gemini doesn't have this reasoning hook.

I want you to think long and hard, and I want you to do the following in the exact order specified:

  1. Spawn 5 sub agents and have them review all of the code in parallel and provide a review. Read all source files in their entirety.

1a. Divide up the workload evenly per sub agent.

2. Have each sub agent write their final analysis to their individual and dedicated files in the SubAgent_Findings folder. Sub agent 1 will write to SubAgent_1.md, sub agent 2 will write to SubAgent_2.md, etc.

3. Run two bash commands in sequence:

3a. for file in SubAgent_{1..5}.md; do (echo -e "\n\n" && cat "$file") >> Master_Analysis.md; done

3b. for file in SubAgent_*.md; do > "$file"; done

I chose this prompt for 3 reasons:

  1. I wanted to see if Gemini had any separate "task"-like tools (sub agents).

  2. If it DIDN'T have sub agents. How would it attempt to split this request up?

  3. This is a prompt where it's important to do the initial fact-finding task in parallel, but then do the final analysis and subsequent bash commands in sequence.

  4. It's purposefully a bit ambiguous (the code) to see how the model/agent would actually read through the codebase and/or which files it dictated were important.

I feel like the Claude results are decently self explanatory just from the images. It is essentially what I have seen previously. It essentially does everything exactly as requested/expected. You can see the broken up agentic tasks being performed in parallel, and you can see how many tokens were used per sub agent.

The results were interesting on the Gemini side:

On the Gemini side I *THINK* it read all the files....? Or most of the files? Or big sections of the files? I'm not actually sure.

After the prompt you can see in the picture it seems to use the "ReadManyFiles" tool, and then it started to proceed to print out large sections of the source files, but maybe only the contents of like 3-4 of them, and then it just stopped....and then it proceeded with the final analysis + bash commands.

It followed the instructions overall, but the actual quality of the output is.......concise? Is maybe the best way to put it. Or potentially it just straight up hallucinated a lot of it? I'm not entirely sure, and I'll have to read through specific functions on a per file basis to verify.

It's strange, because the general explanation of the project seems relatively accurate, but there seems to be huge gaps and/or a lot of glossing over of details. It ignored my config file, .env file, and/or any other supporting scripts.

As you can see the final analysis file that Gemini created was 11KB and is about 200 LOC.

The final analysis file that Claude created was 68KB and is over 2000 LOC.

Quickly skimming that file I noticed it referenced all of the above mentioned files that Gemini missed, and it also had significantly more detail for every file and all major functions, and it even made a simplified execution pipeline chart in ASCII, lol.