<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394" -->

---
title: Make Claude Code Opus talk to Gemini Pro | daily.dev
description: Claude Code Opus 4.5 and Gemini 3 Pro each miss things when working independently, but combining them improves decision-making significantly. This guide shows...
canonical: https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Make Claude Code Opus talk to Gemini Pro | daily.dev
og:description: Claude Code Opus 4.5 and Gemini 3 Pro each miss things when working independently, but combining them improves decision-making significantly. This guide shows...
og:url: https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394
og:image: https://api.daily.dev/og/posts/B7pyiq394.png
og:image:alt: Make Claude Code Opus talk to Gemini Pro
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Make Claude Code Opus talk to Gemini Pro

**[Pierre](https://daily.dev/sources/0x5ger8743vws6pnvafxr)** · [@pierrebaz](https://daily.dev/pierrebaz) · 3 min read · 13 upvotes · 2 comments

## Summary

Claude Code Opus 4.5 and Gemini 3 Pro each miss things when working independently, but combining them improves decision-making significantly. This guide shows how to integrate Gemini into Claude Code using a bash script that calls the Gemini API and a Claude Code agent that formats prompts and executes the script. The setup involves creating two files in your project's `.claude/` directory: a bash script for API calls and an agent definition that handles consultation requests.

## Content

## Why?

When Claude Code Opus 4.5 works alone it misses things.

When Gemini 3 Pro works alone it misses things.

But when Claude Code asks Gemini critics about highly technical decisions they suddenly get 10x smarter. It's like teleporting in 2028.

## How?

There are 2 ways to connect Claude Code with Gemini:
- MCP server
- Claude Code Agent

Sadly there is no official MCP server for Gemini and I didn't find a serious up-to-date Github repo providing it.

So we gonna use the safe Claude Code agent way:
1. Create a bash script that calls the Google Gemini API
2. Create a Claude Code agent that generate proper prompt for Gemini and execs the bash script

We can then prompt Claude Code with `ask gemini critics about this plan` and it will significantly improve your work, and often save you from unseen edge-cases.

## The code

The following files should be stored in your project root folder in:
```
.claude/
    agents/
        gemini.md
    scripts/
        gemini.sh
```

## The bash script

Stored in `.claude/scripts/gemini.sh`. 
Make it executable with: `chmod +x gemini.sh`.
And store your GEMINI_API_KEY in your bash/zsh profile.

```bash
#!/bin/bash
# Gemini API script for Claude Code agents
# Usage: ./gemini.sh "Your prompt here"
# Requires: GEMINI_API_KEY environment variable

set -e

MODEL="gemini-3-pro-preview"
API_URL="https://generativelanguage.googleapis.com/v1beta/models/${MODEL}:generateContent"

if [ -z "$GEMINI_API_KEY" ]; then
  echo "Error: GEMINI_API_KEY environment variable is not set" >&2
  exit 1
fi

if [ -z "$1" ]; then
  echo "Usage: $0 \"Your prompt here\"" >&2
  exit 1
fi

PROMPT="$1"

response=$(curl -s "${API_URL}?key=${GEMINI_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{
    \"contents\": [{
      \"parts\": [{
        \"text\": $(echo "$PROMPT" | jq -Rs .)
      }]
    }],
    \"generationConfig\": {
      \"temperature\": 0.7,
      \"maxOutputTokens\": 8192
    }
  }")

# Check for errors
error=$(echo "$response" | jq -r '.error.message // empty')
if [ -n "$error" ]; then
  echo "API Error: $error" >&2
  exit 1
fi

# Extract and print the response text
echo "$response" | jq -r '.candidates[0].content.parts[0].text // "No response"'
```

## The Claude Code agent

Stored in `.claude/agents/gemini.md`. Feel free to tweak the instructions there:

```md
---
name: gemini
description: Consults Gemini 3 Pro for a second opinion on code, architecture, or technical questions
tools:
  - Bash
  - Read
  - Glob
  - Grep
---

You are a Gemini consultant agent. When the user asks you to consult Gemini, get a second opinion, or compare perspectives:

1. Read any relevant code or context the user is asking about
2. Formulate a clear prompt for Gemini
3. Call the Gemini API using the script:

.claude/scripts/gemini.sh "Your prompt here"

4. Summarize Gemini's response and present it to the user

Tips:
- For code review, include the actual code in your prompt
- Be specific in your prompts to get useful responses
- Compare Gemini's perspective with your own analysis when relevant
```

## Community discussion

Top comments from developers on daily.dev.

**@amirakrari** · 1 upvotes

> Thanks for sharing.
> There also is llm counsil plugin you might wanna take a look at

## Similar posts on daily.dev

- [Gemini CLI vs Claude Code: Which to Choose for Python Tasks – Real Python](https://daily.dev/posts/gemini-cli-vs-claude-code-which-to-choose-for-python-tasks-real-python-umbuywdgk) · Real Python · 0 upvotes · 0 comments
- [Gemini is catching up to Claude, but it still struggles with the nuance that matters most](https://daily.dev/posts/gemini-is-catching-up-to-claude-but-it-still-struggles-with-the-nuance-that-matters-most-sibpxwkww) · XDA Developers · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#bash](https://daily.dev/tags/bash), [#google-gemini](https://daily.dev/tags/google-gemini), [#claude](https://daily.dev/tags/claude)

[View this post on daily.dev](https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394","headline":"Make Claude Code Opus talk to Gemini Pro","text":"Claude Code Opus 4.5 and Gemini 3 Pro each miss things when working independently, but combining them improves decision-making significantly. This guide shows how to integrate Gemini into Claude Code using a bash script that calls the Gemini API and a Claude Code agent that formats prompts and executes the script. The setup involves creating two files in your project's `.claude/` directory: a bash script for API calls and an agent definition that handles consultation requests.","url":"https://daily.dev/posts/make-claude-code-opus-talk-to-gemini-pro-b7pyiq394","datePublished":"2026-01-01T10:50:35.585Z","dateModified":"2026-01-01T10:53:34.406Z","author":{"@type":"Person","name":"Pierre","url":"https://daily.dev/pierrebaz","image":"https://avatars.githubusercontent.com/u/1058531?v=4","description":"Building Notifuse: open-source modern alternative to Resend/Mailchimp.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":390}},"image":"https://media.daily.dev/image/upload/s--HNJH1XyB--/f_auto/v1767264635/posts/B7pyiq394?_a=BAMAK+ZW0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":13},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"comment":[{"@type":"Comment","text":"Thanks for sharing.\nThere also is llm counsil plugin you might wanna take a look at","datePublished":"2026-01-20T11:06:43.396Z","url":"https://daily.dev/posts/B7pyiq394#c-N8I2gFxbC","author":{"@type":"Person","name":"Amir Akrari","url":"https://daily.dev/amirakrari","image":"https://media.daily.dev/image/upload/s--7_CzKxRf--/f_auto/v1767743051/avatars/avatar_aElrZ8dbeZcAUjCy9rgnM?_a=BAMAK+ZW0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/0x5ger8743vws6pnvafxr","name":"Pierre"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Pierre","item":"https://daily.dev/sources/0x5ger8743vws6pnvafxr"},{"@type":"ListItem","position":3,"name":"Make Claude Code Opus talk to Gemini Pro"}]}
```

