Claude Code Web Search Not Working? 4 Fixes & the Reliable Alternative

Claude Code web search permission denied, "Did 0 searches," or not working at all? 4 fixes — plus the external search alternative that never breaks.

by AnyCap

Broken search icon with glitch effects and red error indicators — dark cyberpunk terminal aesthetic

Claude Code web search not working? You're not alone. Between permission denials, "Did 0 searches" results, and silent failures, Anthropic's built-in WebSearch tool has been a persistent source of frustration for developers. This guide covers the four most common causes — and the fix for each, including the alternative that never breaks.


Why Claude Code Web Search Breaks

Claude Code's native WebSearch tool (web_search) is built into the Claude model itself — not an external integration. That means when it breaks, it breaks inside Claude's reasoning layer, making it harder to debug than a regular tool failure.

The four most common failure modes:

Issue What You See Root Cause
Permission denied "Permission denied" popup, even in --permissionless mode Settings.json conflict or Edit(*) override
Silent failure "Did 0 searches" with no results API bug or blocked_domains: [] malformed request
Missing tool Tool web_search not found / 422 error Model or API version mismatch
Wrong tool used Claude tries Chrome connector or web_fetch instead Model routing issue

None of these are your fault. They're documented bugs — some open on GitHub for months.


Fix 1: Check Your Permissions Configuration

Most common issue: The permissions block in your settings.json is blocking WebSearch without you realizing it.

Step 1: Find your settings file

cat ~/.claude/settings.json

Step 2: Look for these patterns

Problematic — Edit(*) blocks WebSearch:

{
  "permissions": {
    "allow": ["Edit(*)"],
    "deny": []
  }
}

The Edit(*) wildcard in the allow list can cause Claude Code to prompt for permission on every WebSearch call — and in some versions, silently deny it.

Fix:

{
  "permissions": {
    "allow": [
      "Edit(*)",
      "WebSearch(*)",
      "WebFetch(*)"
    ],
    "deny": []
  }
}

Step 3: Check for conflicting deny rules

If you have WebSearch(**) or WebFetch(**) in your deny block, remove them:

// ❌ This blocks web search AND breaks plugin loading
{
  "permissions": {
    "deny": ["WebSearch(**)", "WebFetch(**)"]
  }
}

Known GitHub bug (#11812): Adding WebFetch/WebSearch to permissions.deny causes all plugins to fail loading. If your plugins broke after a settings change, this is likely why.

Step 4: Hot-reload settings

# Restart your Claude Code session for changes to take effect
# There is no hot-reload for settings.json changes

Fix 2: Try Permissionless Mode (With a Caveat)

If permission configuration isn't the issue, run Claude Code in permissionless mode:

claude --permissionless

But note GitHub issue #21091: Even in permissionless mode, WebSearch can be denied. This is a confirmed bug affecting Claude Max subscribers. If you're hitting this, the workaround is:

# Bypass the built-in WebSearch entirely and use an MCP server
# (see Fix 3)

When the built-in WebSearch is broken, the most reliable fix inside Claude Code is to use an MCP server that handles web search externally:

Option A: Brave Search MCP Server

# Install the Brave Search MCP server
claude mcp add brave-search -- npx -y @anthropic/mcp-server-brave-search \
  --env BRAVE_API_KEY=your_brave_api_key_here

The Brave Search MCP server is maintained by Anthropic and is the closest thing to an "official" web search tool. It returns structured search results that Claude Code can parse and cite.

Pros:

  • Maintained by Anthropic
  • Structured, citation-ready results
  • Free tier available (2,000 queries/month)

Cons:

  • Requires a separate Brave API key
  • Only provides search snippets — no full page content
  • Each call adds ~4,000 tokens of tool description overhead

Option B: Tavily Search MCP Server

claude mcp add tavily -- npx -y @tavily/mcp-server \
  --env TAVILY_API_KEY=your_tavily_key_here

Tavily is purpose-built for AI agent search — it returns full page content in addition to snippets.

Option C: SerpAPI MCP Server

claude mcp add serpapi -- npx -y @serpapi/mcp-server \
  --env SERPAPI_API_KEY=your_serpapi_key_here

SerpAPI provides Google search results. Most flexible but most expensive.


Fix 4: The Reliable Alternative — AnyCap Web Search (No MCP, No Permissions)

Best for: Developers who just want web search to work — every time, no debugging.

The real problem with Claude Code's built-in WebSearch isn't just the bugs. It's the underlying architecture: web search as a model-internal tool means it shares Claude's context window, permission model, and rate limits. When any of those fail, web search fails.

AnyCap takes a different approach: web search runs as an external capability outside Claude Code's context — with its own engine, its own API keys, and its own output formatting. Claude Code just calls it like any other CLI tool.

Setup (30 seconds — same install as image generation)

# If you already installed AnyCap for image generation, skip this
npx -y skills add anycap-ai/anycap -a claude-code -y
curl -fsSL https://anycap.ai/install.sh | sh
anycap login

Search the web from Claude Code

Basic web search:

anycap web search \
  --query "Claude Code web search permission denied fix" \
  --results 5

Output:

Searching for: Claude Code web search permission denied fix...
Found 5 results:

1. GitHub Issue #21091 — WebSearch Tool Blocked Despite Permissionless Mode
   https://github.com/anthropics/claude-code/issues/21091
   Relevant: Confirmed bug — WebSearch denied even with --permissionless flag

2. Reddit r/ClaudeCode — How to grant Claude Code web search permission
   https://reddit.com/r/ClaudeCode/comments/1kouc2z/
   Relevant: Edit(*) in settings.json blocks WebSearch

3-5. [additional results]

Claude Code can read and cite these results directly — no permission popup, no "Did 0 searches," no settings.json debugging.

Deep research (multi-source):

anycap web deep-research \
  --topic "State of AI coding agents 2026" \
  --depth 3 \
  --output research.md

This runs multiple search queries, follows links, extracts content, and compiles a cited research document — all outside Claude Code's context window.

Live web crawl (full page content):

anycap web crawl \
  --url "https://docs.anthropic.com/en/docs/claude-code/web-search" \
  --format markdown

Returns the full page as markdown that Claude Code can parse and reference.

Why This Approach Doesn't Break

Claude Code Built-in WebSearch AnyCap Web Search
Permission model Claude Code permissions (buggy) External — no Claude permissions needed
API routing Model-internal (subject to routing bugs) Dedicated search engine
Rate limits Shares Claude Code rate limits Separate API, independent limits
Output format Claude-formatted text Structured JSON with source URLs
Full page content No (snippets only) Yes (via web crawl)
Deep research No Yes (multi-query, multi-source)
Context overhead Variable (model-dependent) ~1,000 tokens per call
Credential Anthropic API key One AnyCap login

Comparison: Which Fix Should You Use?

Fix Works When Setup Time Reliability
Fix 1: Permissions config Settings.json is the problem 5 min Medium (may break again)
Fix 2: Permissionless mode Permission model is the problem 1 min Low (known bug #21091)
Fix 3: MCP server You have API keys and patience 15-30 min High (external engine)
Fix 4: AnyCap CLI You want search to just work 2 min Highest (dedicated engine)

FAQ

Why does Claude Code say "Did 0 searches"?

This is a known bug where Claude Code's internal WebSearch tool executes but returns no results — even for queries that would return results in a browser. It's caused by a malformed blocked_domains: [] parameter in the API request. The only reliable fix is to use an external search tool (Fix 3 or Fix 4).

Is Claude Code web search free?

Yes, Claude Code's built-in WebSearch is included with your Claude subscription (Pro, Max, or Team). However, MCP-based alternatives (Fix 3) typically require separate API keys with their own pricing. AnyCap web search is pay-as-you-go starting at $5 free credit.

Can I use Google Search from Claude Code?

Not with the built-in WebSearch tool — it uses Anthropic's own search backend. For Google results specifically, use the SerpAPI MCP server (Fix 3, Option C) or AnyCap's anycap web search which returns aggregated results from multiple sources.

Why does web search work in claude.ai but not in Claude Code?

Claude Code and claude.ai use different implementations of web search. The claude.ai web interface has a more mature search integration; Claude Code's terminal-based WebSearch is a newer tool that still has known bugs. If search works on the web but not in your terminal, you're hitting a Claude Code-specific issue — most commonly permission configuration or the "Did 0 searches" bug.

Does AnyCap web search work when Claude Code is offline?

No — but neither does anything else. AnyCap web search requires internet connectivity (it's making real HTTP requests to search engines). What it DOESN'T require is Claude Code's WebSearch tool to be functional, permission-approved, or rate-limit-free. If you have internet, AnyCap search works.


Next Steps


Claude Code is an Anthropic product. AnyCap is an independent agent capability runtime.