Skip to main content Show chat and tutor
Tracks / Claude Code / Web & External Data
Claude's training data goes stale the moment it's frozen. Library APIs change, CVEs drop, framework migrations happen. WebFetch, WebSearch, and Context7 give Claude Code real-time grounding — the difference between "plausibly correct" code and "currently correct" code.
Use `WebFetch` to pull a specific URL into Claude's context — docs, blog posts, API references Use `WebSearch` to discover current information when you don't know the URL Pick the right grounding source — WebFetch for known URLs, WebSearch for discovery, MCP for structured APIs, Context7 for library docs Avoid the four web-grounding pitfalls — stale data, hallucinated URLs, paywall failures, and over-fetching
Why This Matters
Claude's training cutoff means library docs, API specs, and recent CVEs are all out-of-date — grounding via web tools fixes this in real-time
The right grounding source varies : WebFetch when you know the URL, WebSearch when you don't, MCP for structured queries, Context7 for library docs
The 2026 update : WebFetch supports streaming for large pages, WebSearch returns structured snippets, Context7 MCP server is now the default for library docs
Build this → Ask Claude to "look up the latest Next.js 16 App Router caching changes" — Claude should use WebSearch (not its training data) to find current information
What’s one thing you learned? What’s still confusing?
How was the difficulty? Easy Just Right Hard
Discussion Ask questions, share insights
See AI think. Learn by watching machines learn — interactive ML visualizations from linear algebra to agents.
16 learning paths314 lessons
© 2026 RugvAI Labs. All rights reserved.
Interactive visualizations powered by D3.js · Three.js
WebFetch Specific URL you know "Read https://docs.anthropic.com/en/docs/build-with-claude " WebSearch Discovery — find current info "What's the latest Next.js caching behavior?" Context7 (MCP) Library docs (React, Prisma, FastAPI...) "How do I configure Drizzle migrations?"
Claude Code picks automatically based on prompt. You can also force a tool by referencing it explicitly.
# WebFetch: Pull a Known URL> Read this and summarize: https://anthropic.com/news/claude-code-2026-update
Claude Code calls WebFetch(url), retrieves the page (HTML → markdown), and reads it into context.
WebFetch(url="https://anthropic.com/news/claude-code-2026-update")What you get back: the page content as cleaned markdown. Images are referenced but not loaded by default.
Best for
Reading a specific blog post or RFC
Pulling an API reference page
Reviewing a GitHub issue or discussion
Quoting an official doc
Not great for
Discovering pages (use WebSearch)
Authenticated content (use MCP integration)
JS-heavy SPAs (content may not render server-side)
> What are the breaking changes in React 19 vs React 18?
Claude Code calls WebSearch(query) and gets back a structured result list:
json [
{ "title": "React 19 Migration Guide", "url": "react.dev/blog/2025/...", "snippet": "..." },
{ "title": "Breaking changes in React 19", "url": "github.com/...", "snippet": "..." },
{ "title": "What's new in React 19 - YouTube", "url": "youtube.com/...", "snippet": "..." }
]
Then typically Claude follows up with WebFetch on the most relevant URLs to read full content.
Best for
"What's the current state of X?"
"Are there known issues with library Y version Z?"
"How do other teams approach problem A?"
Recent CVE / security advisory lookup
# Context7 MCP: Library DocsFor any well-known library, the Context7 MCP server returns version-pinned, structured documentation — better than scraping web pages.
> Use context7 to get the latest Drizzle ORM migration syntax
Claude calls mcp__context7__resolve-library-id("drizzle") then mcp__context7__query-docs(...) and gets back curated docs.
Best for
React, Next.js, Vue, Angular hooks/components
Backend frameworks (FastAPI, Express, Spring Boot, Django, Rails)
ORMs (Prisma, Drizzle, SQLAlchemy)
Cloud SDKs (AWS, GCP, Azure)
AI/ML libraries (LangChain, LlamaIndex, Anthropic SDK)
Context7 is faster and more accurate than scraping for these cases. Use it before falling back to WebFetch.
# When to Ground vs When to Trust TrainingQuestion Type Ground? "How does Python's GIL work?" (stable, fundamental) ❌ trust training — well-established "Latest Next.js 16 caching behavior" ✅ ground — recent and changing "Best practice for X in 2026" ✅ ground — opinions evolve "Syntax of Python f-strings" ❌ trust training — stable "Available models on Anthropic API right now" ✅ ground — changes weekly "Migrating from React 18 to 19" ✅ ground — version-specific "What's a Hash table?" ❌ trust training — universal CS
Rule: if the answer could change between now and Claude's training cutoff, ground.
WebFetch pages may be cached by Claude or by intermediate layers. For rapidly-changing content (live docs, status pages), append a cache-buster or use --refresh:
> Fetch https://status.example.com/api/v1/incidents (force fresh, ignore cache)
Claude sometimes invents plausible-looking URLs that don't exist (e.g., docs.anthropic.com/api/v3/messages when v3 was never released). Mitigation:
Use WebSearch FIRST when you don't have a verified URL
Don't paste imagined URLs into the prompt — Claude will trust them
# 3. Paywall / Auth FailuresMany sites (NYTimes, Medium, Substack, LinkedIn) return paywalled or login-required content. WebFetch returns whatever the unauthenticated request gets — often an error page or stub.
Mitigation: for content behind auth, use a dedicated MCP server (e.g., GitHub MCP for private repos) or paste the content directly.
WebFetching 20 pages to answer a simple question wastes tokens and time. Be specific:
❌ "Search the web for everything about Drizzle ORM"
✅ "What's the current Drizzle ORM syntax for adding a foreign key?"
# Compare library versions> Use context7 to compare Tanstack Query v4 vs v5 — what's the migration path?
# Verify a library API exists> Before writing code with `prisma.user.findUniqueOrThrow`, verify this method exists in current Prisma docs (use context7)
# Pull a security advisory> Look up CVE-2025-XXXX — affected versions, mitigation, patch availability
> Read https://github.com/anthropics/claude-code/issues/142 — summarize the bug and current status
# Synthesize across multiple sources> Research best practices for Postgres connection pooling in 2026. Cross-reference at least 3 sources.
(Claude will likely use WebSearch + multiple WebFetch calls; consider using the research-investigator sub-agent from the Subagents lesson.)
For deep research, delegate to a research sub-agent so the multi-page reading happens in a separate context:
yaml # .claude/agents/research-investigator.yaml
name: research-investigator
description: Multi-source web research with synthesis
tools: [WebFetch, WebSearch, Read]
model: claude-opus-4-7
prompt: |
Research the user's question. Cross-reference at least 3 reputable sources.
Synthesize a focused answer with source links. Note version/date for time-sensitive claims.
> Use research-investigator to find the current best practice for React 19 server components data fetching
Main session gets a synthesized report; doesn't bloat with raw page content.
Three grounding tools : WebFetch (known URL), WebSearch (discovery), Context7 (library docs)
Ground for time-sensitive info. Library versions, recent CVEs, current API specs
Trust training for stable fundamentals. Language semantics, classic algorithms, well-established patterns
Avoid the pitfalls : stale cache, hallucinated URLs, paywall failures, over-fetching
Delegate deep research to sub-agents to keep main context clean
Quick Check 1 / 2
User asks 'what's the current Anthropic API model list?'. Best approach?
A Recall from training data B Tell user to check themselves C Guess based on known models D Use WebFetch on docs.anthropic.com/en/docs/about-claude/models — current model list changes frequently, must be grounded; Context7 also viable for SDK reference
Check Answer
Quick check
You ask Claude for the latest Stripe SDK API for webhook verification. Which grounding sequence gives the highest-fidelity answer?
A Context7 for SDK syntax (versioned) → WebFetch the official Stripe docs page for protocol details → WebSearch for recent CVEs and best practices B Recall from training and hope it's current C WebSearch only, take the first Stack Overflow answer D Ask the user to paste the SDK source
Nice work! You just learned when and how to ground Claude in current, external information with WebFetch, WebSearch, and Context7.
Progress 15 of 17 lessons to Python fluency
Up next: background tasks and monitoring — long-running work without blocking your session
Web grounding handled. Next: background tasks and monitoring — long-running work without blocking your session.