Currently Available: Need a skilled Software Developer for your next project?
Categories
Coding Agents

How Claude Code’s WebFetch Tool Works and Why It Returns a Summary Instead of the Full Page

When Claude Code uses WebFetch to read a webpage, the main conversation usually gets an answer to a question about the page, rather than the page’s full contents. WebFetch retrieves webpage content. Its extraction prompt, an instruction about what information to return, guides the answer.

That answer may be a summary, but it can also be a focused extraction, such as a page’s stated requirements or a particular passage. When you use Claude Code for research, an answer that leaves out a detail does not prove the webpage lacks it.

WebFetch processes the page before returning a result

Claude Code gives WebFetch a URL and an extraction prompt. WebFetch retrieves the page and turns HTML, the code that structures webpages, into Markdown, a text format with formatting marks. For most fetches, WebFetch makes a separate call to an AI model to apply the prompt. The main Claude conversation then receives that call’s answer rather than the raw page, according to the Claude Code tools reference.

For example, a prompt asking for a page’s refund deadline directs the extraction toward that detail. The returned answer may omit other terms on the page, even if WebFetch read them. The prompt determines what information reaches the conversation.

Anthropic describes this behavior as lossy: the result does not preserve every part of the fetched content. The documentation says “most” fetches use a separate model call; it does not specify which fetches fall outside that pattern.

The prompt controls what the answer includes

A focused prompt helps Claude Code avoid unrelated page content, but it also narrows the result. Anthropic warns that an answer saying a page does not mention something might only mean the prompt did not ask about it.

For research, ask for the exact information you need. If the claim matters, request relevant wording or supporting passages as part of the extraction. Then check the source page when the answer omits a detail or when you need to verify the wording. A negative result from WebFetch alone does not establish that the page lacks the information.

The separate call is part of Claude Code’s security design

A webpage can contain instructions that try to make an AI assistant ignore its existing instructions. This attack is called prompt injection. Anthropic lists webpage summaries among Claude Code’s safeguards and explains that, for most fetches, the main Claude conversation receives the separate model call’s answer instead of the raw page. This design reduces the main conversation’s direct exposure to page content. Anthropic also cautions that no system is completely immune to prompt injection in its Claude Code security guidance.

The separate call’s model and exact prompt are not identified in the Claude Code documentation. Claims about which model performs the extraction therefore go beyond the documented behavior.

Fetch limits do not mean Claude sees the whole page

Claude Code reads up to 100,000 characters of page content per WebFetch call. For a longer page, the result may indicate how much content remains unread. That limit describes how much WebFetch reads per call; it does not mean the main conversation receives that content verbatim. The tools reference also says HTML conversion to Markdown is not configurable.

Anthropic lists curl through Bash as an alternative for retrieving page content without WebFetch’s extraction step. In Manual mode, Claude Code requires approval to run network commands such as curl and wget, as it does for other Bash commands that are not read-only.

Claude Code’s WebFetch also differs from Anthropic’s API and Managed Agents web_fetch tool. The Platform documentation describes that separate tool as retrieving webpage text for Claude to analyze. Do not assume its documented behavior describes Claude Code’s tool.

What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Email updates

Usually a new article and a few links I found interesting.

No spam. Unsubscribe with one click.

Leave a Reply

Your email address will not be published. Required fields are marked *