How to Add Google Search to Claude Code

Claude Code is a capable coding agent, but it works from training data that has a cutoff date. When you need it to check current docs, look up a package version, or find a recent Stack Overflow answer, it’s guessing. Adding Google Search through AgentPatch fixes that.

Why This Matters

A lot of coding work involves looking things up: API docs, error messages, library changelogs, deprecation notices. Claude Code handles most of it from memory, but for anything recent it either hallucinates or tells you to check yourself.

With Google Search available as a tool, Claude Code can look things up directly during a task. Ask it to figure out why a build is failing and it can search for the error message. Ask it to update a dependency and it can check what the latest version actually is.

Setup

The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.

Install (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Example commands your agent will use:

ap search "web search"
ap run google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Install the AgentPatch skill — it teaches Claude Code when to use AgentPatch and how to use the CLI:

/plugin marketplace add fullthom/agentpatch-claude-skill
/plugin install agentpatch@agentpatch

MCP Server (Alternative)

If you prefer raw MCP tool access instead of the skill:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard.

Example

You’re in a Claude Code session and run into an error:

“This ESLint rule is throwing on valid code. Can you look up whether this is a known bug?”

Claude Code searches Google directly:

Searching Google for "eslint no-unused-vars false positive destructuring 2025"...

Found a relevant GitHub issue (#16304). This is a known bug in eslint@8.x with
destructured imports — fixed in eslint@9.0. Your config pins "eslint": "^8.50.0".
I can bump that to ^9.0.0 if you want.

Claude Code found the issue, traced it back to a version constraint in your config, and offered to fix it — all without you opening a browser tab.

This also works for checking library compatibility, verifying deprecation timelines, or finding the right import path for a package that reorganized its exports.

Wrapping Up

Adding AgentPatch to Claude Code gives it a real-time connection to the web during any coding session. Google Search is one tool; the same config also gives access to image search, email, maps, and everything else on the marketplace. Visit agentpatch.ai to explore what’s available.