If you already use Claude Code, you’ve probably noticed this: the real ceiling of the experience is set by the model behind it, not just the tool itself.
This guide focuses on two things:
- Why I prefer Gemini 3 Pro as my first choice for local development, rather than only using the default Claude / GPT models.
- How to connect
gemini-3-pro-previewto Claude Code via TokHub, step by step.
All Gemini 3 performance numbers here come from the official Google DeepMind Gemini 3 model page (https://deepmind.google/models/gemini/). I’ve reorganized them into a single table so you can quickly judge whether it’s worth the switch.
Note: This is a “hands-on + model selection” article, aimed at developers who already use Claude Code and want to bring Gemini 3 into their day-to-day workflow.
1. Why use Gemini 3?
1. Official positioning: the most capable Gemini so far
According to Google DeepMind:
- Gemini 1 introduced native multimodality and long context.
- Gemini 2 pushed deeper into reasoning, planning, and tool use, laying the groundwork for agents.
- Gemini 3 brings these strengths together, with the explicit goal of helping you “learn, build, and plan anything”.
In practice, the lineup looks like this:
- Gemini 3 Pro – for complex tasks and high-value code/projects.
- Gemini 2.5 Flash / Flash-Lite – for high-throughput, everyday and cost-sensitive workloads.
- And a set of developer tools built around them, such as Google Antigravity / AI Studio.
From a developer’s point of view, the real question is: where is it clearly stronger than Claude / GPT?
2. Hard numbers from the official benchmarks
The table below is based on the benchmark section of the official Gemini 3 page. It compares Gemini 3 Pro, Gemini 2.5 Pro, Claude Sonnet 4.5, and GPT-5.1, keeping only the parts that matter most for coding and agents:
Data source: Google DeepMind – Gemini 3 model overview
Link:https://deepmind.google/models/gemini/
| Benchmark | Scenario description | Gemini 3 Pro | Gemini 2.5 Pro | Claude Sonnet 4.5 | GPT-5.1 |
|---|---|---|---|---|---|
| Humanity’s Last Exam | Academic reasoning, no tools | 37.5% | 21.6% | 13.7% | 26.5% |
| ARC-AGI-2 | Visual reasoning puzzles | 31.1% | 4.9% | 13.6% | 17.6% |
| GPQA Diamond | Difficult scientific knowledge | 91.9% | 86.4% | 83.4% | 88.1% |
| AIME 2025 | Hard math, no tools | 95.0% | 88.0% | 87.0% | 94.0% |
| MMMU-Pro | Multimodal understanding and reasoning | 81.0% | 68.0% | 68.0% | 76.0% |
| ScreenSpot-Pro | Screen understanding and operation | 72.7% | 11.4% | 36.2% | 3.5% |
| Video-MMMU | Video understanding and knowledge acquisition | 87.6% | 83.6% | 77.8% | 80.4% |
| LiveCodeBench Pro | Coding problems, Elo (higher is better) | 2439 | 1775 | 1418 | 2243 |
| Terminal-Bench 2.0 | Terminal agent coding success rate | 54.2% | 32.6% | 42.8% | 47.6% |
| SWE-Bench Verified | Real project bug fixing (single attempt) | 76.2% | 59.6% | 77.2% | 76.3% |
| MRCR v2 (8-needle) 128k | Long-context retrieval | 77.0% | 58.0% | 47.1% | 61.6% |
| MRCR v2 1M | 1‑million‑token‑level context | 26.3% | 16.4% | not supported | not supported |
A few highlights that matter most in everyday development:
Code & agent performance
- Taken together,
LiveCodeBench Pro,Terminal-Bench 2.0, andSWE-Bench Verifiedmeasure how well a model can write code, call tools, and survive long workflows. - On agent-style benchmarks, Gemini 3 Pro is generally slightly ahead of GPT-5.1 and clearly ahead of Claude Sonnet 4.5, while staying competitive on SWE-Bench.
- Taken together,
Multimodal + screen understanding
- On
ScreenSpot-Pro, Gemini 3 Pro scores 72.7%, versus 11.4% for Gemini 2.5 Pro and 3.5% for GPT-5.1. Put simply: it’s particularly strong at tasks like “look at a UI screenshot and figure out what to do next”.
- On
Long-context strength
- On
MRCR v2128k / 1M tests, Gemini 3 Pro’s long-context retrieval is clearly stronger than 2.5 and its peers. That matters when you ask it to understand large codebases and multi-service systems through Claude Code.
- On
Summed up in one line:
If you want a model that can write code, reason over multimodal inputs, and act as a long-running agent, Gemini 3 Pro is currently one of the strongest options according to DeepMind’s own numbers.
Now let’s actually put it behind Claude Code.
2. Overall plan: TokHub + Gemini 3 + Claude Code
Claude Code talks to Anthropic by default, but it also lets you swap the backend via environment variables or config.
TokHub plugs into this by:
- Exposing an Anthropic-compatible API gateway (base URL).
- Forwarding requests to a target model such as
gemini-3-pro-preview. - Letting you control everything from local env vars or
~/.claude/settings.json.
At a high level, the setup looks like this:
- Create a TokHub account and API key.
- Configure environment variables or
~/.claude/settings.json. - Start Claude Code and use
/modelto switch toopus(which we map to Gemini 3 Pro). - Validate the behavior in a real project.
We’ll walk through these steps next.
3. Step one: register a TokHub account and get a token
Note: This step follows the official Ctok “Gemini 3 + Claude Code” tutorial, adapted for this specific setup.
- Open the registration page:
- After verifying your email and logging in, open the token console:
- Create a new API key and keep it somewhere safe (you’ll plug it into env vars or config shortly).
Tips:
- Use a dedicated key just for Claude Code so you can track usage and quotas cleanly in the TokHub console.
- Never commit the key to Git; manage it with local environment variables or a
.envhelper.
4. Step two: start Claude Code with environment variables (fast)
If you just want to quickly experience the combination of Gemini 3 + Claude Code, it is recommended to start directly with environment variables.
Run the following in the terminal:
export ANTHROPIC_AUTH_TOKEN="your_tokhub_key"
export ANTHROPIC_BASE_URL="https://tokhub.ai"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
# Configure default models as needed
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-5-20250929"
export ANTHROPIC_DEFAULT_OPUS_MODEL="gemini-3-pro-preview"
# Start the Claude Code CLI
claude
What these flags do:
ANTHROPIC_AUTH_TOKEN: your API key from the TokHub console.ANTHROPIC_BASE_URL: points Claude Code at the TokHub gateway, which forwards requests to Gemini 3.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1: disables non-essential network calls to improve privacy and control.ANTHROPIC_DEFAULT_OPUS_MODEL: the critical line—this swaps the original Opus model forgemini-3-pro-preview. After this,/model opusin Claude Code effectively means “use Gemini 3 Pro”.
Once Claude Code starts, run:
/model opus
Claude Code will now route “Opus” sessions through Gemini 3 Pro. A good first test is to point it at a familiar repo and ask for a “from-scratch explanation + refactor plan” to feel how it compares to your previous model.
5. Step three: write to ~/.claude/settings.json (for long-term use)
If you’re going to keep this setup, it’s better to commit it to ~/.claude/settings.json instead of exporting the variables by hand each time.
Here’s a minimal snippet focusing on the environment:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your_tokhub_key",
"ANTHROPIC_BASE_URL": "https://tokhub.ai",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-20250929",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-3-pro-preview"
}
}
After saving:
- Exit your current Claude Code session.
- Restart it with
claude. - Run
/model opusagain and confirm it’s hitting the TokHub + Gemini 3 backend.
To temporarily switch back to Anthropic’s own endpoint, you can start a new shell without these env vars, or maintain multiple profiles in settings.json and swap them as needed.
6. Practical tips: using Gemini 3 effectively inside Claude Code
Getting the setup working is only the first step. The real question is: how do you use Gemini 3 without wasting its strengths or your budget? Based on the official benchmarks and real-world use, here are a few practical patterns:
1. Reserve Gemini 3 Pro for “high-value” work
Gemini 3 Pro shines on:
- Hard reasoning (Humanity’s Last Exam, AIME 2025).
- Long-horizon agent tasks (Terminal-Bench, SWE-Bench, τ2-bench).
- Long-context workloads (MRCR v2 128k / 1M).
So it’s well suited for:
- Large refactors (across multiple repos or mixed-language projects).
- Business-critical modules where correctness really matters (settlement, auth, risk, compliance).
- Long sessions where it needs to read docs + read code + call tools repeatedly.
For simple “write a quick script” or “tweak a config line” work, cheaper models like 2.5 Flash / Haiku are usually enough.
2. Lean into multimodality: send screenshots + logs
With strong results on ScreenSpot-Pro and Video-MMMU, it makes sense to use Gemini 3 like this inside Claude Code:
- Send terminal screenshots, DevTools panels, and monitoring graphs together with relevant code and let it diagnose issues end-to-end.
- Paste screenshots of complex performance dashboards (Prometheus, Grafana, etc.) and ask it to connect them to specific modules or call paths.
This multimodal workflow is often much faster than trying to describe your environment and metrics purely in text.
3. Use long context for “whole-repo understanding”
MRCR v2 suggests Gemini 3 Pro handles large contexts well, which is ideal when you:
- Ask it to scan an entire repo and draw out a high-level architecture and dependency graph.
- Have it check requirements → design → implementation → tests for consistency in a large system.
- Want it to detect repeated or inconsistent implementations of the same business rules across services.
In practice, it’s worth wrapping these into a few reusable prompts so Claude Code + Gemini 3 serves as a “senior reviewer” for your codebase.
7. Summary: when is Gemini 3 worth it?
Putting DeepMind’s benchmarks and real usage together, here’s how I’d position the Gemini 3 + Claude Code stack:
- If you mainly write small utilities and scripts, your existing Claude / GPT setup is probably fine, and you can skip the extra complexity.
- If you regularly run mid- to large-scale projects, rely on agent-style automation, or have real needs around multimodality and long context, swapping Claude Code’s “top-tier engine” to Gemini 3 Pro via TokHub is very much worth it.
Everything in this guide is based on public interfaces plus TokHub’s Anthropic-compatible gateway, so you can safely try it locally, step by step.
With stronger reasoning and agent capabilities, Claude Code finally feels like it has its “ceiling” unlocked.
If you’re already running this setup, consider sharing your experience and pitfalls. We can refine prompts and workflows over time and turn them into deeper follow-up guides.
Related tutorials:
- “Claude Code: This AI coding assistant feels like hiring a 24-hour personal butler for your code” – a broad overview of what Claude Code can do and how pricing/tiers work. Path:
/en/news/claude-code-ai-programming-assistant/- “Claude 4.5 Sonnet released, claiming to be the world’s strongest coding model” – focused on Anthropic’s official benchmarks and Sonnet 4.5’s coding performance. Path:
/en/news/claude-4-5-sonnet-worlds-strongest-coding-model/
