◉CLAUDE LABJP
●CC 2.1.330 — Claude Code 2.1.330 fixes the multi-minute freeze right after compacting a long conversation●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 8 days left. The suggested replacement is claude-sonnet-5-5●MCP 401 — Users report MCP servers that return 401 time out silently instead of showing an error●NEW — New: Desktop creates a worktree for every session? Three places to check●OPUS 4.5 — The 11/24 date for Opus 4.5 is a not-sooner-than floor, not a retirement notice●SCHEMA — Same schema, different shape: compare structured output from the Agent SDK and the Messages API●CC 2.1.330 — Claude Code 2.1.330 fixes the multi-minute freeze right after compacting a long conversation●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 8 days left. The suggested replacement is claude-sonnet-5-5●MCP 401 — Users report MCP servers that return 401 time out silently instead of showing an error●NEW — New: Desktop creates a worktree for every session? Three places to check●OPUS 4.5 — The 11/24 date for Opus 4.5 is a not-sooner-than floor, not a retirement notice●SCHEMA — Same schema, different shape: compare structured output from the Agent SDK and the Messages API
Articles/API & SDK
⬡ API & SDK/2026-06-15Intermediate

Letting Claude Read Live Pages: Implementing web_fetch Without the Footguns

How to pull the actual text of official pages and PDFs straight into Claude's context with the web_fetch tool. Covers the URL-validation rule that trips everyone up, the settings that keep token costs down, and why fetch errors arrive as HTTP 200 — based on what I hit running it in production.

Claude API148web_fetchserver toolscost controlautomation pipeline

✦ Premium Article

I asked a scheduled job to "summarize the latest changes in Claude Code in three lines," and what came back was a tidy summary of features from several months ago. The model answers from its training-time knowledge, so that was expected behavior. The real problem was that the stale summary nearly slipped into an article draft before anyone noticed.

Official changelog pages change almost weekly. If you let Claude read that page itself, the summary is always grounded in the current text. That is exactly what the web_fetch tool does. Unlike web search, it takes a URL you specify and pulls the full page (and PDFs) straight into context — a server-side tool that does the retrieval for you.

As an indie developer running several sites under Dolice Labs on autopilot, I added a "read the official source directly" step into the pipeline, and factual errors in generation dropped noticeably. Here is what actually tripped me up while wiring it in.

web_fetch and web_search play different roles

The first thing people conflate is the difference from web_search. web_search is for "run a query and gather candidates from across the web"; web_fetch is for "open one page you already know about and read all of it."

The rule of thumb is simple: if a URL is already in the context, fetch it; if you do not yet know the URL, search first. Claude chooses to fetch when:

  • A URL appears in a user message or a previous tool result
  • The user names a specific resource (an article, a README, a pricing page) and web_search is also enabled, so it can locate the page first

By contrast, an open-ended question like "what are best practices for REST API design?" will not trigger a fetch, because it does not point at a specific page. Knowing this boundary makes it much easier to debug the two classic mismatches: "I gave it a URL but it won't fetch" and "it keeps running a search instead."

Get it running with the smallest call first

The minimal setup in the Python SDK is surprisingly short. You add a single web_fetch entry to the tools array, and the model handles retrieval and reading on its side.

import anthropic
 
client = anthropic.Anthropic()
 
resp = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[
        {
            "role": "user",
            "content": "Summarize the key points of this page in three bullets: "
                       "https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-fetch-tool",
        }
    ],
    tools=[
        {
            "type": "web_fetch_20250910",
            "name": "web_fetch",
            "max_uses": 3,
        }
    ],
)
 
for block in resp.content:
    if block.type == "text":
        print(block.text)

Because the feature is in beta, some environments require the beta header web-fetch-2025-09-10. With a recent SDK, passing the tool definition alone may just work, but when you see an unsupported-style error, the header is the first thing to check.

Keep in mind that web_fetch is a server tool. Unlike a client tool, where you receive a tool_use, run it yourself, and return the result, the retrieval happens entirely on Anthropic's side. You write no HTTP request. In exchange, the responsibility for which URLs get read stays firmly on your side, as we'll see next.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦When to use web_fetch_20250910 vs web_fetch_20260209, from a minimal call to reading the response
✦The validation rule that a URL must already appear in the conversation, and how to build around it safely
✦Using max_content_tokens, allowed_domains and max_uses to cap both token cost and attack surface in production
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ API & SDK2026-11-02
You Can't Put a Monthly Spend Limit on the Default Workspace — Splitting Workspaces to Cap a Solo Developer's API Bill
Monthly spend limits can't be set on the Default Workspace. Here is how I split workspaces by purpose, verify with a response header that requests land where I intend, and watch daily usage per workspace.
⬡ API & SDK2026-11-18
Before Your Customers Pay Through Linked Billing: Reading a 402 or 403 to Find Whose Wallet Is Empty
Linked billing, released in beta on November 17, lets you choose who pays on every Claude API request through billing_policy. When a request billed to a customer comes back as a 402 or 403, here is how I work out which wallet is the cause, when to pay for it myself, and a small Python wrapper that keeps that decision in one place.
⬡ API & SDK2026-11-17
If You Rely on Claude's Text Watermark, Check temperature in the Request Body, Not Your Code
Since November 16, text from Opus 4.6, Opus 4.5, Sonnet 4.5, and Haiku 4.5 carries Anthropic's text watermark, but non-default temperature, top_p, or top_k may drop it. Here is how I log the request body once and decide.