Create Shareable HTML Previews with Claude Code and AgentPatch Paste
Claude Code can write HTML. What it can’t do on its own is put that HTML somewhere a browser can open it without a local server. The AgentPatch Paste tool supports text/html as a content type, which means Claude Code can generate an HTML document and immediately produce a public preview link. No deployment, no hosting setup, no dev server.
Why This Matters
There are a lot of situations where you want to preview something rendered — a report layout, a generated email template, a UI snippet, a dashboard mockup — and sharing raw HTML is awkward. You’d normally have to save it to a file, open it locally, or push it somewhere to get a shareable link.
When Claude Code has the Paste tool available, it can skip all of that. It generates the HTML, uploads it with text/html as the content type, and returns a URL. Anyone who opens that URL sees the rendered page. The paste expires in up to 7 days, so it works well for review cycles and quick handoffs. Each call costs 25 credits.
Setup
Alternatively, you can install the AgentPatch plugin for Claude Code:
/plugin marketplace add fullthom/agentpatch-claude-skill
/plugin install agentpatch@agentpatch
This teaches Claude Code how to discover and use AgentPatch tools automatically.
Example
You’re building a weekly metrics email for internal use and want to preview how it looks before sending.
“Generate an HTML email template for a weekly engineering metrics report. Include sections for deploys, incidents, and open PRs. Use a clean, minimal style with a table layout. Use placeholder data.”
Claude Code produces a full HTML document with inline styles suitable for email clients. Then:
“Upload that as an HTML paste with a 3-day expiry and give me the preview link.”
Claude Code calls the AgentPatch Paste tool with the HTML content, content type text/html, and TTL of 3 days. The tool returns:
https://agentpatch.ai/paste/a1b2c3d4e5f6
You open the link in your browser and see the rendered email template. You share it with your team lead for feedback. They open the same URL on their end — no local environment needed, no file to download.
You get feedback and follow up:
“Add a fourth section for test coverage trend. Use a two-column layout for the numbers. Update the paste.”
Claude Code revises the HTML and calls the Paste tool again with the updated content. You get a new URL with the revised version.
The same pattern works for other HTML use cases:
“Generate a simple dashboard page showing the JSON data in api-response.json as a formatted table with sortable columns. Upload it as an HTML paste.”
Claude Code reads the JSON file, generates a self-contained HTML page with JavaScript for sorting, and uploads it. You get a working interactive preview URL without deploying anything.
“Create an HTML report summarizing the test results in results.json. Include pass/fail counts, a list of failures with file and line number, and a color-coded status banner. Make it easy to read on mobile.”
Claude Code parses the results, generates the HTML, and uploads it. The URL is ready to drop into a Slack message or a CI summary comment.
Wrapping Up
HTML paste previews work well anywhere you want rendered output shareable without a server. It fits into Claude Code’s workflow because the agent already writes the HTML — uploading it and returning a link is one extra tool call. The same AgentPatch connection also gives Claude Code access to web search, email, news, image generation, and more. Visit agentpatch.ai to explore the full marketplace.