Skip to content
Search
Search
Learn
Glossary
Research
Platforms
News
Tools
About

AnthropicFeature

Claude web search and fetch tools add dynamic filtering

Apps built on the Claude API can now run code that keeps only the parts of a fetched page the model needs. Your page may reach Claude in pieces.

Published

#What is new

On February 17, 2026, alongside Claude Opus 4.6 and Sonnet 4.6, Anthropic released new versions of the web search and web fetch tools in the Claude API. The announcement says Claude can now write and run code during a search to filter results before they reach its context window. This affects the apps and agents developers build on the API.

#How dynamic filtering works

With basic web search, Claude loads search results and full HTML pages into context and reasons over all of it. Anthropic found that much of that content is irrelevant and lowers answer quality. With dynamic filtering, Claude writes code that parses the pages it retrieves, keeps the relevant parts and drops the rest. Only what the code returns reaches the model.

The filtering runs inside Anthropic's code execution tool. It is on by default in the first filtering versions, web_search_20260209 and web_fetch_20260209. The docs now list later versions as well (web_search_20260318, web_fetch_20260309 and web_fetch_20260318) and say filtering works with Claude 4.6 and later models. Developers can turn it off by setting allowed_callers to ["direct"].

Not every developer gets it. On Claude Models on Google Cloud (Google managed), and on Microsoft Foundry deployments hosted on Azure, only the basic tools run, with no filtering. Dynamic filtering is also not eligible for zero data retention or HIPAA, so apps that need either will keep reading whole pages.

#What Anthropic's benchmarks measured

Anthropic ran Sonnet 4.6 and Opus 4.6 with and without filtering on two benchmarks. Across both, filtering improved results by an average of 11% and used 24% fewer input tokens.

BenchmarkWhat it testsModelWithout filteringWith filtering
BrowseComp (accuracy)Finding one hard-to-find factSonnet 4.633.3%46.6%
BrowseComp (accuracy)Finding one hard-to-find factOpus 4.645.3%61.6%
DeepsearchQA (F1 score)Finding every answer to a question with manySonnet 4.652.6%59.4%
DeepsearchQA (F1 score)Finding every answer to a question with manyOpus 4.669.8%77.3%

Cost depends on how much code the model writes. Price-weighted tokens fell for Sonnet 4.6 on both benchmarks and rose for Opus 4.6. The figures measure answer quality and token use. They do not show which sites Claude cites.

#What reaches Claude from your page

The fetch tool reads text, HTML and PDF. Any other content type returns an error. It can only open a URL that already appeared in the conversation: in the user's message, in a tool result, or in earlier search or fetch results. So a page reaches Claude through search or because someone pasted the link.

Several limits apply before filtering starts:

  • Anthropic refuses URLs that robots.txt blocks, along with private addresses and URLs that seem to contain a credential.
  • Results are cached, so Claude may read an older copy of your page. Newer versions let developers skip the cache with use_cache: false.
  • Developers can cap page text with max_content_tokens, and anything over the cap is cut. The docs put an average 10 kB page at about 2,500 tokens.
  • Citations are always on for web search and quote up to 150 characters of the cited text. For web fetch they are off unless the developer turns them on.

Our read: once code picks the passages, a fact that only makes sense with the paragraph above it can reach the model without that context. A fact placed far from its heading is easier to miss.

#What to check

  • Open your key pages with scripts turned off and confirm that prices, specs and answers appear in the HTML text. The fetch tool handles text, HTML and PDF only.
  • Read your robots.txt rules for Anthropic's agents, such as Claude-User and Claude-SearchBot. We think a disallow there could stop the fetch tool from opening a page that a user pasted.
  • After you change a price or a fact, expect Claude-based apps to show the old version for a while, because fetch results are cached.
  • On long pages, put the answer in the first sentence under each heading. Our read: if a developer caps page length, the opening lines have the best chance of making it in.

#What Anthropic doesn't say

  • Which user agent the fetch tool sends, or which robots.txt rules it checks. The docs list robots.txt as a reason a URL is refused and stop there.
  • How long fetched pages stay in the cache. The docs say only that cache behavior is managed automatically and may change.