How-to ·

Claude Code: How to Test Web Pages for AI Agents

Testing web pages with Claude Code reveals exactly what data AI agents extract from site changes. Teams run prompts inside isolated Docker containers using a forward proxy to route requests between live pages and preview deployments.

In short
  • Docker containers and a forward proxy keep Claude Code test environments identical across page variants.
  • WebFetch requests Markdown mirrors ahead of standard HTML when evaluating page content.
  • A secondary model processes scraped content under strict quotation limits before Claude answers.
  • Running multiple iterations accounts for the non-deterministic responses of Claude Code.
In this guide
  1. What is the Claude Code page testing workflow?
  2. How to test web pages with Claude Code
  3. How Claude Code retrieves and filters web content
  4. Tips and pitfalls when testing pages for Claude Code
  5. Frequently asked questions

What is the Claude Code page testing workflow?

The Claude Code testing workflow allows engineering and marketing teams to observe how autonomous agents read and interpret web pages. Zapier created this framework, called Agent Arm Runner, to test website adjustments without waiting weeks for conventional search engine feedback loops.

What you'll get

Running this testing harness reveals whether changes to your live site, Markdown alternate versions, or intermediate model instructions alter what Claude Code reports to users.

Claude Code testing harness at a glance
Primary model
Opus 5
WebFetch parsing model
Haiku 4.5
Isolation method
Docker container
Traffic routing
Forward proxy
Test setup file
JSON configuration
Preferred content header
text/markdown

How to test web pages with Claude Code

Testing web pages with Claude Code requires running controlled experiments that isolate page content while keeping prompts and addresses identical. Zapier uses this step-by-step setup to evaluate how model responses change between experimental page variants.

  1. Package Claude Code inside a Docker container configured with a forward proxy to monitor and manage all outbound requests.
  2. Write a JSON configuration file specifying the prompt to execute, the experimental arms to test, and the required number of repetitions.
  3. Route the control arm directly to the production website path through the forward proxy.
  4. Configure the proxy to intercept requests for the test path on variant runs and redirect them to a preview deployment.
  5. Provide Claude Code with the exact same user prompt and production URL across every experimental arm.
  6. Start every test iteration inside a fresh Docker container to ensure session state does not carry over between runs.
  7. Repeat each experimental arm several times to account for the non-deterministic output of Claude Code.

How Claude Code retrieves and filters web content

Claude Code does not simply dump raw HTML into the primary conversation model when browsing the web. Zapier discovered that the internal WebFetch tool requests Markdown alternatives before HTML, using the header accept: text/markdown, text/html, */*.

Once WebFetch captures a page, Claude Code forwards the raw text to a secondary model rather than the primary reasoning engine. In tests where Opus 5 acted as the calling model, Zapier observed that Haiku 4.5 received the retrieved content with no external tools attached.

Components of the Claude Code web retrieval process
StageComponentFunction in workflow
Task executionOpus 5Acts as the calling model that triggers tools and delivers answers
Page retrievalWebFetchPulls web data, prioritizing text/markdown ahead of text/html
Content parsingHaiku 4.5Summarizes fetched pages under strict length and quotation limits

Tips and pitfalls when testing pages for Claude Code

Evaluating page visibility for Claude Code requires accounting for how background models alter content before answering queries. Overlooking alternate text formats or filtering instructions can lead to invalid conclusions during agent testing.

Tip

Insert a unique canary comment code into your test documents. If the canary code appears in the output of Claude Code, you can confirm exactly which page version the tool retrieved.

Watch out

Editing HTML alone is insufficient if your domain serves Markdown mirrors. Claude Code prioritizes Markdown representations, so unedited Markdown files will bypass HTML changes completely.

Zapier found that the intermediate Haiku 4.5 request enforces strict rules on source text. These include a 125-character maximum for direct quotes, compulsory quotation marks for exact phrasing, and a complete prohibition on reproducing song lyrics.

Frequently asked questions

How does Claude Code fetch web page content?
Claude Code retrieves external pages using a tool called WebFetch. WebFetch sends a request header prioritizing text/markdown ahead of text/html, consuming Markdown mirrors if the server provides them.
Which model processes web pages inside Claude Code?
Zapier found that while Opus 5 serves as the top-level calling model, WebFetch passes retrieved page text to Haiku 4.5. This secondary Haiku model processes the text under its own system instructions before returning data to Opus 5.
Why should tests on Claude Code run in clean Docker containers?
Running Claude Code in a fresh Docker container prevents residual session data and cached states from bleeding into subsequent experiments. This guarantees that variations in responses stem only from differences between the tested pages.
What quoting restrictions does Claude Code apply to web text?
The Haiku 4.5 parsing step inside Claude Code enforces a strict limit of 125 characters on direct source quotes. Any language outside quotation marks must be paraphrased rather than copied word-for-word.
How can teams test page variations in Claude Code without changing live URLs?
Teams can pair Claude Code with an intercepting forward proxy in Docker. The proxy serves the live site for control runs and quietly routes requests to a preview deployment for variant runs while keeping the target URL identical.

Sources: zapier.com

Want your brand to be the answer AI gives?

See how ready your website is for ChatGPT, Gemini and Perplexity, free, in about ten seconds.

Related: How to get your brand cited by ChatGPT