Skip to content
Claude Code & Tools

Claude Code WebSearch Limits and Silent Failures

Claude Code WebSearch limits apply across subagents. Learn how to raise the cap, budget searches, and handle empty results with API fallbacks.

An empty WebSearch result doesn't mean there are no sources. In Claude Code, exceeding the session limit doesn't trigger an error, so an exhausted search budget can look like a search that found nothing. For parallel research, raising the cap is only part of the job: each agent also needs a budget and a rule for handling empty results.

Main and subagents share one search budget

During a research run with five parallel subagents, all five reported that they'd exhausted the WebSearch limit at the same time. That would be hard to explain if each agent had its own allowance. But there's only one counter: searches from the main conversation and every subagent it creates are added together.

Applies to Claude Code v2.1.212 and later
ItemBehavior
Default limit200 WebSearch calls per session
ScopeShared across the main conversation and all subagents
Reset/clear resets the counter
Reset trade-offThe research context is also cleared

Creating more agents doesn't buy you more searches. Without an allocation, an agent that starts searching first can consume the entire shared budget. You can reset the counter with /clear, but you'll lose the context of the research in progress.

A spent budget can look like missing evidence

Once the limit is reached, WebSearch returns guidance to continue with the information already collected rather than an error. The user doesn't see that guidance; in the conversation, the search appears to have returned zero results. If an agent reads that as “there's no material on this topic,” it can leave evidence out of the report without having checked it.

In my research, an agent that switched to direct API lookups after the budget ran out actually became more accurate at verifying bibliographic details. The catch is that it hadn't recognized the exhausted limit. Its choice happened to be right, but I can't count on that happening next time, so the prompt needs to say when to switch lookup methods.

A spent budget can look like missing evidence

Raise the WebSearch limit and check the setting

You can raise the limit with CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION. It accepts a positive integer, not a setting that removes the limit altogether.

The agent I asked to investigate initially concluded that there was no setting for changing the cap. It had searched only the settings reference. The explanation was under environment variables in the tool reference's WebSearch section.

JSON
{
  "env": {
    "CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION": "500"
  }
}
An example raising the cap to 500 calls through the env section of ~/.claude/settings.json

For a temporary change, use a shell environment variable instead. You can set it for the terminal session or pass it to a single invocation.

Shell
export CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION="500" && claude
CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION=500 claude
The first line sets the variable for the terminal session; the second applies it to one invocation

If the variable is set in both places, the settings.json value overrides the value inherited from the shell. To raise the cap temporarily through the shell, remove that entry from the settings file or keep the setting in just one place. The Claude API's per-request web search parameter, max_uses, is a separate control.

Shell
echo $CLAUDE_CODE_MAX_WEB_SEARCHES_PER_SESSION
Check the environment variable set in the shell

That command checks the shell variable, not whether Claude Code has applied the value internally. There have been reports of values in the settings.json env section not taking effect in the app. If you suspect that, try a shell export as a cross-check, and check whether the same variable is still present in the settings file.

Raise the WebSearch limit and check the setting

Use APIs once you've identified the paper

Bash and WebFetch don't use the WebSearch counter. Once you know a paper's title or DOI, you can query scholarly sources such as Crossref, OpenAlex, KCI, and ScienceON through their APIs. Use WebSearch to work out what to look for, then switch to API lookups to verify the bibliographic details.

WebSearch compared with direct scholarly API lookups
ItemWebSearchDirect API lookup
Session search limit200 shared calls by default; can be raisedBash and WebFetch don't use the search counter
CoverageNews, institutional material, industry reports, and gray literatureIndexed scholarly literature
Bibliographic accuracyRelies on snippets, with a risk of errors in years, pages, and DOIsStructured records and original DOI records
Query interpretationUnderstands natural-language intentMatches queries literally, so query design matters
FilteringAlmost noneFilters by year, journal, citation count, and author fields
ReproducibilityNot reproducibleQueries can be logged and rerun
Citation networksCan't trace themCan trace them with the OpenAlex cites filter
Bulk collectionEach search consumes one callPagination can collect hundreds of records
Full textSnippets onlyPrimarily abstracts; no full text for material that isn't open access
Mermaid
flowchart LR
  A[Find sources] -->|Small WebSearch budget| B[Collect metadata]
  B -->|API lookup and expansion| C[Check full text]
  C -->|WebFetch| D[Find gray literature]
  D -->|Remaining WebSearch budget| E[Fill evidence gaps]
Spend a little search budget on discovery, use direct lookups next, and reserve the remaining searches for gray literature.

Replacing every search with an API lookup would miss material outside scholarly indexes. If your research needs gray literature such as agency notices, standard specifications, procurement documents, and industry reports, reserve a separate WebSearch budget for it. Use WebFetch to check the text at URLs returned by the APIs, and don't count an abstract as a full-text reading.

Put search budgets and fallback rules in the prompt

For academic research, the example budget in the operating guidelines is no more than 10 WebSearch calls per agent. For research focused on gray literature, it's 30–50. Those are task budgets, not product limits, and the main conversation needs its own share of the same counter.

Text
Each subagent may use WebSearch at most N times.
For bibliographic checks and verification of DOIs, authors, and years,
do not use WebSearch. Query the Crossref/OpenAlex/KCI/ScienceON APIs
directly with curl. Use WebFetch to check full text.

If WebSearch returns zero results, do not conclude that no material exists.
Suspect that the session search budget has been exhausted.
Retry the same topic through an API or WebFetch.
If that also returns zero results, conclude that no material was found
and report the lookup routes checked.
After two consecutive searches with zero results, treat the budget as exhausted,
switch to API-only mode, and report the switch immediately.
Replace N with the search budget assigned to each agent

Two consecutive empty results can be your rule for switching lookup methods. That's an operating rule for deciding whether to keep searching, not proof that the limit has been reached. An agent in API-only mode hasn't necessarily checked gray literature, so it also needs to report what it verified and which routes it used.

The order matters, too: handle material that APIs can verify first, then look for sources that need WebSearch. Reverse that order and you can spend the search budget checking academic references, only to hit the cap when you need industry reports.

On my next research run, I'll check one thing: does the agent actually switch to another lookup method when WebSearch returns no results?

Joy

Leads AI adoption at a large Korean enterprise. Uses AI firsthand, at work and in everyday life, and writes down what ran, what stalled, and how it changes the way we work and think.

Need help rolling out tools or training your team?

Talks and advisory

Share this postXFacebookThreads