Skip to content

Sideshow on Cloudflare: Give Your Coding Agent a Second Screen

How I run sideshow, a live browser surface for coding agents, on a Cloudflare Worker, and a standalone runbook your agent can follow to copy the setup.

• Matt Dennis

A terminal is a bad place to read a code review. It is a worse place to read an architecture diagram, a pricing table, or a 40-row comparison of fax pipeline failures. My agents kept producing exactly that kind of output, and I kept scrolling up through markdown tables that wrapped at 120 columns.


sideshow fixes that. It is an MIT-licensed tool by Ben Vinegar that gives a coding agent a live visual surface in the browser. The agent publishes an HTML fragment, a diff, a Mermaid diagram, or a markdown doc. It shows up in a browser tab within a second. I leave a comment on it, and the agent reads that comment and revises. The terminal stays for the conversation. The browser shows the results.


This post has two readers: you, and the agent you are about to point at it. Everything an agent needs to rebuild my setup is on this page. No other docs required. If you are the agent: follow the runbook top to bottom, and stop where it says to stop.


How I actually use it


Three habits, all driven by plain instructions in my global ~/.claude/CLAUDE.md:


  • Ask before dumping. When an agent has substantial output, like analysis, a summary, a code review, a diagram, or a multi-step explanation, it asks whether I want it in sideshow instead of the terminal. Usually I do.
  • Diffs get explained, not pasted. An explain-diff skill turns a branch or PR into a sideshow session: a background post, an intuition post with a diagram, and the native diff surface underneath. Reviewing a 600-line change on my phone is now a reasonable thing to do.
  • Links, not attachments. Every post has a stable URL at /p/<postId>. I paste that into Linear tickets and texts instead of screenshots.

The comment loop is the part that matters. sideshow wait blocks until I leave a comment in the browser, then hands it to the agent. Pointing at the third bar in a chart and typing “this one looks wrong” beats describing it in the terminal.


I drive all of it through the CLI, not MCP or the Claude Code plugin. Any agent with a shell can run sideshow publish, so the same setup works in Claude Code, Cursor, Codex, and a cloud sandbox without per-tool wiring.


Why it runs on Cloudflare


sideshow started on my Mac Mini as a launchd job on port 8228, reachable over Tailscale. That worked until agents stopped running on the Mac Mini. Cloud agents, a VPS, a laptop on hotel Wi-Fi, and a phone that is not on the tailnet all needed the same surface.


The same app ships as a Cloudflare Worker. The whole thing runs inside one Durable Object with SQLite storage: one instance per workspace, so the in-memory event bus stays authoritative and server-sent events and long-polling behave exactly like the local server. Cloudflare’s Browser Rendering binding adds one Workers-only feature: /s/<postId>.png renders a post to an image, which gives link unfurls a real preview card.


The free Workers plan covers the Worker and the SQLite-backed Durable Object at my volume. Browser Rendering has its own small free allowance. Everything else is a URL and a bearer token.


Auth, in one paragraph


A deployed instance requires SIDESHOW_TOKEN on every request. Agents send it as Authorization: Bearer <token>, and the CLI does that automatically when the variable is set. You open the viewer once as /?key=<token>, which sets an owner cookie, and after that you never type the token again. SIDESHOW_PUBLIC_READ loosens reads only: session makes direct session and post links readable without a token while keeping the root viewer and session list private, and full makes every read route public. Writes always need the token.


Pick session unless you have a reason not to. Anyone with a full URL can browse every session you have ever published, and agents publish whatever they are working on. If your work touches anything sensitive, like customer data, credentials, or in my case anything near patient records, the default should be private links, and agents should not publish raw records at all.


What parity looks like


When the runbook is done, you have the same five pieces I have:


PieceWhere it lives
sideshow Workerhttps://sideshow.<subdomain>.workers.dev, deployed from a clone of modem-dev/sideshow
sideshow CLInpm install -g sideshow on every machine and in every cloud environment
SIDESHOW_URL + SIDESHOW_TOKENShell rc file locally; environment variables or secrets in each cloud environment
"Presenting information" ruleGlobal agent instructions (~/.claude/CLAUDE.md, AGENTS.md, or your tool's equivalent)
explain-diff skill~/.claude/skills/explain-diff/SKILL.md (or your tool's skills or rules folder)

The runbook


Prerequisites: Node 22 or newer, npm, git, openssl, and a Cloudflare account. The Worker name sideshow becomes the subdomain, so the URL will be https://sideshow.<your-account-subdomain>.workers.dev.


Step 1: Install the CLI

It has no runtime dependencies and talks to whichever server SIDESHOW_URL points at. Without that variable it falls back to http://localhost:8228.

npm install -g sideshow
sideshow --version

Step 2: Log in to Cloudflare (human step)

git clone https://github.com/modem-dev/sideshow.git ~/sideshow
cd ~/sideshow
npm ci
npx wrangler whoami

If whoami says you are not logged in, the agent stops here. Wrangler’s OAuth login needs a browser and an interactive terminal, and an agent shell is neither. The human either runs npx wrangler login in their own terminal, or creates a Cloudflare API token with the “Edit Cloudflare Workers” template and exports it as CLOUDFLARE_API_TOKEN in the agent’s environment. Expired logins look the same as missing ones, so check every time.


Step 3: Deploy the Worker

cd ~/sideshow
openssl rand -hex 32 > ~/.sideshow-token && chmod 600 ~/.sideshow-token
npx wrangler secret put SIDESHOW_TOKEN < ~/.sideshow-token
printf session | npx wrangler secret put SIDESHOW_PUBLIC_READ
npm run deploy

npm run deploy builds the viewer and runs wrangler deploy, then prints the workers.dev URL. Save it. wrangler.jsonc already declares everything the Worker needs: the SideshowBoard Durable Object, its SQLite migration, and the BROWSER binding. Do not edit it.


Set SIDESHOW_PUBLIC_READ as a secret, not as a variable in the Cloudflare dashboard. wrangler deploy replaces dashboard variables that are not in the config file, so the next deploy would silently reset it. Secrets survive deploys.


Verify:

curl -s -o /dev/null -w "%{http_code}\n" https://sideshow.<subdomain>.workers.dev/agent-howto   # 200

Step 4: Export the variables locally

Append to ~/.zshrc (or ~/.bashrc):

export SIDESHOW_URL="https://sideshow.<subdomain>.workers.dev"
export SIDESHOW_TOKEN="$(cat ~/.sideshow-token)"

Agent shells are often non-interactive and skip the rc file. If sideshow publish tries to reach localhost:8228, the variables did not load. source ~/.zshrc fixes it for that session. Never write the token into a file inside a git repository.


Step 5: Set up every cloud environment (human step)

This is the step people miss. A cloud agent, whether Claude Code on the web, Cursor background agents, Codex cloud, or a CI runner, starts from a fresh container. It has none of your dotfiles, none of your global npm packages, and none of your environment. Each cloud environment needs three things, configured in that product’s environment settings:


  1. Environment variables. Add SIDESHOW_URL and SIDESHOW_TOKEN as environment variables or secrets in the environment config. Use the secret store if the product has one. These are per-environment: set them in every environment you use, and again whenever you create a new one.
  2. The CLI. Add npm install -g sideshow to the environment’s setup script so it is installed before the agent starts. If you skip this, the agent can still publish with plain curl against the HTTP API; $SIDESHOW_URL/agent-howto explains how.
  3. Network access. The sandbox must be allowed to reach your workers.dev host. Products that restrict outbound traffic to an allowlist of package registries will block it until you add sideshow.<subdomain>.workers.dev (or *.workers.dev) to the allowed domains, or switch that environment to full network access.

An agent cannot do this step for you from inside the sandbox, because the settings live in the product’s UI. The agent’s job is to tell you exactly what to paste and where. A cloud agent also cannot open a browser, so it publishes and hands you the /p/<postId> link. You open it on whatever screen you have.


Check from inside the cloud environment:

test -n "$SIDESHOW_URL" && test -n "$SIDESHOW_TOKEN" && sideshow --version \
  && curl -s -o /dev/null -w "%{http_code}\n" -H "Authorization: Bearer $SIDESHOW_TOKEN" "$SIDESHOW_URL/agent-howto"

A 200 means it works. “Could not resolve host” or a proxy error means the network allowlist is blocking it. An empty variable means step 1 did not take.


Step 6: Open the viewer once (human step)

Visit https://sideshow.<subdomain>.workers.dev/?key=<token> in every browser you will watch from, including your phone. The cookie gives you the full owner UI. After that, share post links without the key.


Step 7: Add the agent instructions

Add this to your global agent instructions file: ~/.claude/CLAUDE.md for Claude Code, AGENTS.md for Codex and others, or a user rule in Cursor. This is my exact paragraph, minus my URL and token:

## Presenting information

When you have substantial information to share (analysis, summaries, code reviews,
diagrams, multi-step explanations), ask the user if they want it presented in sideshow.

sideshow is a CLI tool that creates a live visual surface in the browser.
Run `sideshow agent-howto` to learn how to use it, and `sideshow guide` once
before the first HTML publish.

`SIDESHOW_URL` and `SIDESHOW_TOKEN` are exported in the shell rc file locally and
set as environment variables in cloud environments. If a local session doesn't have
them (e.g. a non-interactive shell), source the rc file before using `sideshow`.
If a cloud session doesn't have them, tell the user to add them to that
environment's settings; don't guess a URL.

Share post links as `$SIDESHOW_URL/p/<postId>`. Never include `?key=` or the token
in a link, a file, or a commit.

sideshow agent-howto and sideshow guide are served by your own Worker, so the operating instructions improve whenever you redeploy a newer sideshow. Nothing to reinstall.


Step 8: Install the explain-diff skill

Save this as ~/.claude/skills/explain-diff/SKILL.md for Claude Code. For other tools, put the body in whatever holds reusable instructions.

---
name: explain-diff
description: >
  Explain a code change, diff, branch, or PR as a rich interactive sideshow
  session (HTML + diagrams + native diff). Use when the user asks to explain a
  change, walk through a PR/diff/branch, or says "/explain-diff", "explain this
  diff", "explain this PR", or "walk me through this change".
---

# Explain Diff

Build an interactive explanation of a code change and publish it with the
`sideshow` CLI. One concept per post; a short series beats one giant page.

## Preconditions

1. Run `sideshow agent-howto` once per session.
2. Run `sideshow guide` once per session before the first HTML publish.
3. If `SIDESHOW_URL` is unset, source the shell rc file. If it is still unset,
   run a local surface with `sideshow serve` (http://localhost:8228).

## Resolve the change

| Input | How to get the diff |
|-------|---------------------|
| Working tree / staged | `git diff` / `git diff --cached` |
| Branch vs base | `git diff main...HEAD` |
| Commit range | `git diff A..B` / `git show <sha>` |
| PR | `gh pr diff <n>` + `gh pr view <n>` |

Also gather the PR or commit message, linked issues, and enough surrounding code
to teach the before-state. Explore callers, data flow, and invariants before
narrowing to the touched files.

## Publish

Publish one session of small posts. On the first publish, set `--session-title`
to the task ("Explain: retry backoff"). Iterate with `sideshow update <id>`, not
near-duplicate republishes. HTML surfaces are body fragments only: no doctype,
html, head, or body tags.

```sh
sideshow markdown background.md --title "Background" --session-title "Explain: <topic>"
sideshow publish intuition.html --diff change.patch --title "Intuition"
```

Also write a standalone HTML archive to `/tmp/YYYY-MM-DD-explanation-<slug>.html`
and tell the user the path.

## Required posts

1. **Background.** A skippable beginner section (what the subsystem is for, key
   types and vocabulary), then a narrow section with only what this diff needs.
2. **Intuition.** The before-to-after idea in one or two sentences, concrete toy
   data over abstract prose, and at least one diagram (Mermaid or inline SVG).
   Leave line-by-line review to the diff surface.

## Feedback

After publishing, check for comments with
`sideshow wait --session <sessionId> --timeout 1`. Acknowledge with
`sideshow comment`; put real revisions into `sideshow update`.

Step 9: Smoke test

echo '<h2>Hello from my agent</h2><p>If you can read this, it works.</p>' \
  | sideshow publish - --title "Smoke test" --session-title "sideshow setup"
sideshow wait --timeout 300

The publish prints a post URL. Open it, leave a comment, and the wait returns with your comment text. Run the same two commands from one cloud environment to prove step 5 worked.


Optional: Claude Code plugin or MCP

I don’t use these, but they work. The plugin bundles an MCP server, a skill, and a background monitor that streams browser comments to the agent as notifications, so feedback arrives without the agent calling wait. It needs Claude Code 2.1.105 or newer.

/plugin marketplace add modem-dev/sideshow
/plugin install sideshow@sideshow

Or plain MCP over HTTP, with no local process:

claude mcp add --scope user --transport http sideshow \
  "$SIDESHOW_URL/mcp" --header "Authorization: Bearer $SIDESHOW_TOKEN"

Updating later

The Worker and the CLI version separately. To upgrade both:

npm install -g sideshow@latest
cd ~/sideshow && git pull && npm ci && npm run deploy

Secrets and stored sessions survive the redeploy.


Hand this to your agent


Paste this into Claude Code, Cursor, Codex, or anything with a shell:

Read https://mattdennis.dev/blog/sideshow-on-cloudflare and follow its runbook
end to end so my setup matches the author's: a sideshow Worker on my Cloudflare
account, the CLI installed, SIDESHOW_URL and SIDESHOW_TOKEN exported, the
"Presenting information" instructions in my global agent instructions file, and
the explain-diff skill installed.

Stop and ask me at each human step: Cloudflare login, cloud environment settings,
and opening the viewer with ?key=. For the cloud environment step, give me the
exact variable names, values, setup-script line, and domain to allowlist.
Never write the token into a git repository or print it in a link.
Finish with the smoke test and give me the post link.

The terminal is still where I talk to my agents. It is just no longer where I have to look at what they made.