Claude Code skill for free Google AI Mode search with citations. Zero-config setup, persistent browser profile, query optimization. Token-efficient web research.
# Add to your Claude Code skills
git clone https://github.com/PleasePrompto/google-ai-mode-skillQuery Google's AI Search mode to retrieve comprehensive, source-grounded answers from across the web.
Trigger this skill when the user:
--debug - Enable comprehensive logging
python scripts/run.py search.py --query "..." --debug
logs/search_YYYY-MM-DD_HH-MM-SS.log--save - Save results to skill folder
python scripts/run.py search.py --query "..." --save
results/YYYY-MM-DD_HH-MM-SS_Query_Name.md--output for automatic namingCombined usage (recommended for debugging):
For: Claude Code CLI users only
Transform your LLM's online research capabilities by connecting Claude Code directly to Google's AI Mode—getting AI-synthesized answers from 100+ sources instead of scattered search results.
Most built-in web research is mediocre. This skill gives Claude Code professional-grade research by tapping into Google's AI Mode—the same technology that synthesizes information from dozens of websites into one cited answer.
Example Use Cases:
"Next.js 15 App Router best practices 2026 with server components examples"
→ AI-synthesized coding guide with inline citations [1][2][3]
"Compare PostgreSQL vs MySQL JSON performance 2026, include benchmarks"
→ Technical comparison table with real-world data
"Find the latest EU AI regulations 2026 and their impact on startups"
→ Legal overview with official government sources
"Best noise-cancelling headphones under €300, compare Sony vs Bose"
→ Product comparison with reviews and specs
"Intermittent fasting protocols 2026, include recent scientific studies"
→ Health guide with medical research citations
Result: Research on ANY topic—coding, tech comparisons, regulations, product reviews, health, finance, travel. Curated answers with sources. Saves tokens. Superior to generic web search.
No comments yet. Be the first to share your thoughts!
python scripts/run.py search.py --query "..." --debug --save
--show-browser - Show browser window (for CAPTCHA solving)
python scripts/run.py search.py --query "..." --show-browser
--output <path> - Custom output file path
python scripts/run.py search.py --query "..." --output result.md
--json - Include JSON metadata in output
python scripts/run.py search.py --query "..." --output result.md --json
CRITICAL: Always optimize user queries before execution. Google AI Mode's quality depends on query precision.
[Technology/Topic] [Version] [Year] ([Specific Aspect 1], [Aspect 2], [Aspect 3]). [Output format request].
| User Query | Optimized Query | |-----------|----------------| | "React hooks" | "React hooks best practices 2026 (useState, useEffect, custom hooks, common pitfalls). Provide code examples." | | "What's new in Rust?" | "Rust 1.75 new features 2026 (async traits, impl Trait improvements, const generics, stabilized APIs). Include migration guide and code examples." | | "PostgreSQL vs MySQL performance?" | "PostgreSQL vs MySQL performance comparison 2026 (query optimization, indexing strategies, concurrent writes, JSON handling, scaling patterns). Provide benchmark data and use case recommendations." | | "How to handle errors in Go?" | "Go error handling patterns 2026 (error wrapping, custom errors, sentinel errors, panic vs error, testing error cases). Provide code examples and best practices comparison." | | "Learn FastAPI basics" | "FastAPI tutorial 2026 (routing, dependency injection, async endpoints, request validation with Pydantic, OpenAPI documentation, testing). Include step-by-step implementation guide." |
Note: If user provides an already detailed query with version numbers and requirements, use it as-is.
--save --debug flagsCRITICAL: Always use the run.py wrapper. Direct script execution will fail.
python scripts/run.py search.py --query "Your search query"
python scripts/run.py search.py --query "..." --save --debug
The run.py wrapper automatically:
.venv on first run~/.cache/google-ai-mode-skill/chrome_profile to preserve cookies/session between searchesWith persistent context, CAPTCHAs are rare. If encountered:
/sorry/index, page text, content length)CAPTCHA_REQUIRED error--show-browser flag, solve CAPTCHA in browser, script continues automaticallyNote: After CAPTCHA is solved once, persistent context preserves the session → future searches won't require CAPTCHA.
Returns markdown with inline citations and source list. Example:
React 18 introduces concurrent features including Suspense for data fetching[1],
automatic batching for state updates[2], and transitions for non-urgent updates[3].
---
## Sources:
[1] React 18 Release Notes
https://react.dev/blog/2022/03/29/react-v18
[2] Automatic Batching Explained
https://github.com/reactwg/react-18/discussions/21
[3] Transitions API Documentation
https://react.dev/reference/react/useTransition
python scripts/run.py search.py --query "Prisma ORM 2026 (schema definition, migrations, client API, relation queries, transactions). Include TypeScript examples." --save --debug
python scripts/run.py search.py --query "WebSocket implementation Node.js 2026 (server setup, client connection, message handling, authentication, reconnection logic). Production-ready code examples." --save
python scripts/run.py search.py --query "GraphQL vs REST API 2026 (performance, caching, tooling, type safety, learning curve). Comparison table with use case recommendations." --save
python scripts/run.py search.py --query "Microservices security patterns 2026 (API gateway authentication, service mesh, mutual TLS, secret management, observability). Architecture diagrams and implementation guide." --save --debug
| Issue | Solution |
|-------|----------|
| ModuleNotFoundError | Use run.py wrapper, never execute scripts directly |
| CAPTCHA every time | First-time setup: solve CAPTCHA once with --show-browser, then persistent context preserves session |
| No AI overview found | Rephrase query with more specificity using optimization template |
| Browser fails to start | Verify internet connection and Chrome installation |
| Need detailed logs | Use --debug flag - log saved to logs/ folder |
| AI Mode not available | Your region/country doesn't support Google AI Mode. Use a proxy/VPN to access from supported regions (US, UK, Germany, etc.) |
Exit Codes:
0 - Success1 - General error2 - CAPTCHA required (retry with --show-browser)3 - Browser closed by user4 - AI Mode not available in region (use proxy/VPN)130 - User interrupted (Ctrl+C)--save --debug for important searches - Preserves results and provides audit trailv2.0 - Multi-Language & Detection Overhaul
✅ 4-Stage Completion Detection - SVG thumbs-up → aria-label → text → 40s timeout ✅ Multi-Language Support - Works in DE/EN/NL/ES/FR/IT browser locales ✅ 87% Faster - Average 4s detection (was 30s+) ✅ AI Mode Availability Check - Detects region restrictions with proxy suggestion ✅ 17 Citation Selectors - Language-agnostic fallback chain ✅ 15 Cutoff Markers - Cleaner content extraction across languages
v1.5 - Persistent browser profile, CAPTCHA elimination v1.0 - Initial release with basic Google AI Mode integration
This skill works ONLY with local Claude Code installations, NOT in the web UI.
The web UI runs skills in a sandbox without network access, which this skill requires for browser automation. You must use Claude Code locally on your machine.
A Claude Code skill that connects your agent to Google AI Mode—Google's AI-powered search that synthesizes information from dozens of web sources into a single, cited answer.
Instead of Claude reading page after page, Google does the heavy lifting. Claude gets one clean, structured response with inline citations.
The advantage: Free, token-efficient research with grounded sources. No API keys needed.
Claude asks a question
↓
Skill launches stealth browser
↓
Google AI Mode searches & synthesizes dozens of sources
↓
Skill extracts AI answer + citations
↓
Converts to clean Markdown with [1][2][3] references
↓
Claude receives final answer
The key difference:
Traditional web research:
With this skill:
Google AI Mode (the udm=50 parameter) makes Google search work like a research assistant. It:
Claude gets the benefits without doing the work—or burning the tokens.
# 1. Create skills directory (if it doesn't exist)
mkdir -p ~/.claude/skills
# 2. Clone this repository
cd ~/.claude/skills
git clone https://github.com/PleasePrompto/google-ai-mode-skill google-ai-mode
# 3. That's it! Open Claude Code and say:
"What are my skills?"
When you first use the skill, it automatically:
.venv)Note: The setup uses real Chrome (not Chromium) for cross-platform reliability, consistent browser fingerprinting, and better anti-detection with Google services.
Say in Claude Code:
"What skills do I have?"
Claude will list your available skills including Google AI Mode.
"Search Google AI Mode for: Next.js 15 App Router best practices"
"What are the new features in Astro 4.0?"
"Research React Server Components"
Claude will automatically use the skill to query Google AI Mode and return a clean, cited answer.
Be specific with your queries:
Instead of: "React hooks" Try: "React hooks best practices 2026 (useState, useEffect, custom hooks). Include code examples."
Instead of: "PostgreSQL features" Try: "PostgreSQL 16 JSON features and performance improvements 2026"
On your first query, Google may show a CAPTCHA to verify you're human. This is normal when the browser profile is created.
If Claude reports a CAPTCHA error:
After the first CAPTCHA, searches typically run smoothly. The skill uses a persistent browser profile to eliminate future CAPTCHAs.
This is a Claude Code Skill—a local folder containing instructions and scripts that Claude Code can use when needed. Unlike the MCP server version, this runs directly in Claude Code without needing a separate server.
| Feature | This Skill | MCP Server |
|---------|------------|------------|
| Protocol | Claude Skills | Model Context Protocol |
| Installation | Clone to ~/.claude/skills | claude mcp add ... |
| Compatibility | Claude Code only (local) | Claude Code, Codex, Cursor, Cline, etc. |
| Language | Python | TypeScript |
| Browser Profile | Persistent (eliminates CAPTCHAs) | Per-request context |
| Distribution | Git clone | npm package |
~/.claude/skills/google-ai-mode/
├── SKILL.md # Instructions for Claude
├── scripts/ # Python automation scripts
│ ├── run.py # Universal venv wrapper
│ ├── search.py # Main search implementation
│ ├── browser_utils.py # Browser automation
│ └── config.py # Configuration
├── .venv/ # Isolated Python environment (auto-created)
└── results/ # Saved search results (optional)
When Claude needs web research:
Source-Grounded Responses: Google AI Mode synthesizes information from dozens of sources with inline citations. Every claim is backed by a source link.
Direct Integration: No copy-paste between browser and editor. Claude queries and receives answers programmatically.
Persistent Browser Profile: After solving the first CAPTCHA (if any), the browser profile is saved. Future searches run smoothly without interruption.
Zero Configuration: Works out of the box. No API keys, no external services, no configuration files needed.
Self-Contained: Everything runs in the skill folder with an isolated Python environment. No global installations.
Token Efficient: One query returns one synthesized answer instead of Claude reading 5-10 full pages.
Skill not found:
# Make sure it's in the right location
ls ~/.claude/skills/google-ai-mode/
# Should show: SKILL.md, scripts/, requirements.txt, etc.
Repeated CAPTCHAs:
If Google keeps showing CAPTCHAs:
Browser won't launch:
Clear the browser profile:
# Linux/macOS
rm -rf ~/.cache/google-ai-mode-skill/chrome_profile
# Windows
rmdir /s "%LOCALAPPDATA%\google-ai-mode-skill\chrome_profile"
Dependencies issues:
# Manual reinstall if needed
cd ~/.claude/skills/google-ai-mode
rm -rf .venv
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
python -m patchright install chrome
Wrong language results:
The skill fo