← all posts

Share HTML from Claude Code

Claude Code is good at producing HTML — coverage reports, benchmark charts, generated docs, quick mockups. It is bad at showing that HTML to you. The file lands at /tmp/report.html on whatever machine the agent is running on, and the chat transcript can render exactly none of it.

This is a known gap, not a niche complaint. The Claude Code repo has open feature requests asking for a built-in way to preview or publish generated output (#27792, #29354, #58255). The workarounds people actually use are familiar:

  • python -m http.server plus an ngrok tunnel that dies with the session
  • committing a gist and viewing it through an htmlpreview proxy
  • scp-ing the file to a laptop and opening it with file://
  • asking the agent to "describe the chart" instead of looking at it

All of these work once. None of them work as a habit.

The one-tool-call version

pail is an MCP server that does one thing well: upload a file and get a URL. Once it's installed (install command at the bottom — it's one line), the workflow is a sentence:

> share report.html as a pail link

Claude Code calls the share tool, pail stores the file, and the agent replies with a URL:

https://pail.thalos.ai/aB3xQ9zKpL

Open that on any device. No tunnel, no gist, no server on your machine. The URL is public-with-secret-id: the random ~10-character id is the only bearer, so anyone with the link can view it and nobody without it can find it. Add an access_token if you want a gate on top.

What the URL actually serves

A shared .html file is rendered server-side through a sanitizer: scripts, styles, iframes, and embeds are stripped, and the remaining markup is wrapped in a clean article page. That is exactly right for the common case — reports, tables, generated documentation — where you want to read the output, not execute it. A raw link on the page serves the underlying source.

Markdown, notebooks, CSVs, code, and images get the same treatment: every file type renders as a readable page, not a download prompt. The share tool docs list the formats.

Multi-file output: share the folder

Coverage reports and generated doc sites are rarely one file. upload_folder takes a tarball of a directory and serves the whole tree under one URL, with index.html served at the root:

> run the coverage report and share the whole htmlcov folder with pail

You get one link; relative asset paths (CSS, images) inside the folder resolve normally.

When you need the real thing, JS included

Sanitized rendering is deliberately not a hosting platform. If the agent built an actual site — a React dashboard, an interactive chart, anything that needs its <script> tags — use the preview tool instead. It serves the bundle as a real static site: client-side routing, asset paths, and JavaScript all work. preview is a Pro feature; share is on every plan including free.

Rule of thumb: read it → share, click around in it → preview.

Make it the default

Add two lines to your project's AGENTS.md (or CLAUDE.md) so you stop asking:

When you produce an HTML report, chart, or generated doc, share it with
pail and give me the URL instead of telling me the file path.

From then on, "run the benchmarks" ends with a link, not a path.

Setup

Sign in at pail.thalos.ai, copy your API key, and run:

claude mcp add --transport http pail https://pail.thalos.ai/mcp \
  --header "Authorization: Bearer $PAIL_API_KEY"

That's the whole install. The free tier is 30 actions/day and 5 GB of storage — see pricing for the rest, and the docs for every client (Cursor, Codex CLI, Windsurf, Cline) and all ten tools.