OmniscioGuidesClaude Code web search
Claude Code web search: how the WebSearch tool works
Web search is a tool that reaches outside the machine, and its behaviour is more particular than the name suggests: it returns links, not pages, and the number of searches a session may make is capped.
This page covers the tool, its permission rule and its cap. The tools guide covers the rule format every tool shares, and the environment variables guide covers where a variable such as the cap is set.
Sources read November 25, 2026. By the Omniscio team. Updated .
What WebSearch does, and what it returns
WebSearch runs a query against Anthropic's web search backend and returns result titles and URLs. It does not fetch the result pages, so reading one is a second step: Claude follows up with WebFetch on the URL it picked. The tool is part of the session on a supported provider, so there is no separate switch to find; Claude calls it when a lookup would help.
The 200-call cap counts calls, and one call may issue up to eight backend searches inside it, which is why a couple of dozen lookups can use up a session's budget. When scoping matters, Claude can restrict results with allowed_domains or exclude hosts with blocked_domains, though the two lists cannot be combined in a single call.
Failures are handled in two stages. An overloaded API is retried with backoff, and a call that still fails comes back as an error result rather than as a silent empty answer.
Turning web search on or off
Permission rules for WebSearch take no specifier. A bare WebSearch entry in allow or deny is the only form, so you cannot allow one kind of search and deny another through the rule itself.
{
"permissions": {
"deny": ["WebSearch"]
}
}That shape goes in any settings file.
Where it is available
WebSearch is available on the Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry. On Google Cloud's Agent Platform it works with Opus 4, Sonnet 4, Haiku 4.5 and later models.
Amazon Bedrock does not expose the server-side web search tool at all. A team on Bedrock that needs search has to reach it another way, which is the MCP route below.
The session limit, and the three ways past it
An interactive terminal session allows 200 WebSearch calls, and searches from the main conversation and from subagents such as a parallel research fan-out all count against that one number. At the limit, searches appear in the conversation as calls that did nothing, and Claude is told to continue with what it has and to ask you to raise the limit.
Raise the cap. Set CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION to a positive whole number, such as 500, in the environment of the session or in the env block of a settings file. The cap can be raised but never turned off.
Wait for the refill. On Claude Code v2.1.290 or later an interactive session's limit refills at about 100 calls an hour, and CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR changes that rate.
Start a new conversation. /clear at the prompt also resets the count. The exception is a clear that leaves work behind that can still spawn subagents, such as a running workflow: the count carries over with it.
Under -p, the limit is per turn
In non-interactive mode with -p and in the Agent SDK, the 200-call limit applies per turn rather than per session. A turn runs from the message you send until Claude finishes, and the count resets on your next message or a new claude -p run, even with --continue or --resume.
The two variables work there too. Raise the per-turn cap with CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION, or set a refill rate with CLAUDE_CODE_WEB_SEARCH_REFILLS_PER_HOUR.
Searching with a different provider
The search backend is not configurable. To search with another provider, add an MCP server that exposes its own search tool, and Claude can call that tool like any other MCP tool.
That route also answers the Bedrock case and any team that needs a provider with its own index.
When a search comes back with nothing
Four things produce a search that looks empty, and the transcript usually names which. At the 200-call cap the call appears as one that did nothing. A rule that denies WebSearch stops it before it runs at all. On Amazon Bedrock there is no server-side search tool to call. And when the search API is overloaded, Claude Code retries with backoff before returning an error result.
A query that simply found nothing is the fifth case: the tool returns titles and URLs, so no results is an answer rather than a failure, and rephrasing the query is the fix.
Sources
Every limit, variable and provider here is transcribed from that section of Anthropic's documentation, read November 25, 2026.
- Tools reference, for the WebSearch tool behavior section: what it returns, the backend-search count, domain scoping, permissions, availability and the session search limit. Read November 25, 2026.
Common questions
How does web search work in Claude Code?
The WebSearch tool runs a query against Anthropic's web search backend and returns result titles and URLs. It does not fetch the pages, so Claude follows up with WebFetch when it needs to read one.
Is there a limit on web searches in Claude Code?
An interactive terminal session allows 200 WebSearch calls, and searches from subagents count against the same limit. At the limit, searches appear as calls that did nothing.
How do I raise the web search limit?
Set CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION to a positive whole number such as 500. The cap can be raised but not turned off. On v2.1.290 or later the limit also refills at about 100 calls an hour.
Does web search work on Amazon Bedrock?
No. WebSearch is available on the Claude API, Claude Platform on AWS, Claude Models on Google Cloud (Anthropic managed) and Microsoft Foundry, but Amazon Bedrock does not expose the server-side web search tool.
Can I use a different search provider?
Not through WebSearch, whose backend is not configurable. Add an MCP server that exposes a search tool instead, and Claude can call that server's tool.
Research in one session, work in another
Omniscio runs several agent sessions side by side in one window, each with its own context and its own search budget, so a research fan-out never eats the budget of the session writing the code.