[DOCS] WebFetch docs omit HTML preprocessing and style/script stripping behavior

Open 💬 3 comments Opened Apr 13, 2026 by coygeek

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/tools-reference

Section/Topic

WebFetch tool behavior and Agent SDK WebFetch reference

Current Documentation

The current docs only describe WebFetch at a high level:

| WebFetch | Fetches content from a specified URL | Yes |

From the Agent SDK overview:

| WebFetch | Fetch and parse web page content |

From the Agent SDK TypeScript reference:

Fetches content from a URL and processes it with an AI model.

None of these pages explain how HTML is preprocessed before Claude sees the fetched page content.

What's Wrong or Missing?

Claude Code changelog v2.1.105 says:

Improved WebFetch to strip <style> and <script> contents from fetched pages so CSS-heavy pages no longer exhaust the content budget before reaching actual text

The documentation does not explain that WebFetch strips stylesheet and script contents before processing HTML pages. That leaves an important part of the tool's behavior undocumented:

  • users cannot tell why CSS/JS from a fetched page is missing from the returned content
  • users cannot tell why WebFetch now works better on CSS-heavy pages
  • SDK users do not have a clear description of what WebFetch extracts versus what raw-page fetching would return

Suggested Improvement

Add a short behavior note to the main WebFetch documentation and SDK references clarifying that, for HTML pages, Claude Code preprocesses the page content before prompting the model and strips <style> and <script> blocks so CSS and JavaScript do not consume the content budget.

A minimal fix would be to add wording such as:

For HTML pages, WebFetch extracts page content for model processing and strips <style> and <script> contents so large CSS/JavaScript blocks do not crowd out the visible page text.

If there are cases where users should fetch raw source instead, the docs should mention that distinction explicitly.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Context |
|------|---------|
| https://code.claude.com/docs/en/tools-reference | Main built-in tools table only says WebFetch fetches content from a URL |
| https://code.claude.com/docs/en/agent-sdk/overview | SDK tool overview says only "Fetch and parse web page content" |
| https://code.claude.com/docs/en/agent-sdk/agent-loop | SDK tool category table summarizes WebFetch behavior |
| https://code.claude.com/docs/en/agent-sdk/typescript | WebFetch input/output reference lacks HTML preprocessing details |
| https://code.claude.com/docs/en/agent-sdk/python | WebFetch input/output reference lacks HTML preprocessing details |

Total scope: 5 pages affected

Source: Changelog v2.1.105

Exact changelog entry:

Improved WebFetch to strip <style> and <script> contents from fetched pages so CSS-heavy pages no longer exhaust the content budget before reaching actual text

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗