Haruspex

Web preview

The Web preview helper shows an HTML page from a Code session's folder in a window of its own, with its CSS, scripts and images. It's on by default.

See a page the agent made

Ask for a mockup or a page as usual ("mock up a sign-up page in site/"). When the agent has written it, it calls show_preview and the session's preview window opens on it. The window reloads by itself whenever a file the page loaded changes: an edit by the agent, a command it ran, or your own edit in an editor window.

Each session has one preview window. Previewing another page in the same session shows it in that window.

Open a preview yourself

A Preview button sits beside .html files the agent names in its answers, on the diff card of an .html file it wrote, and on each "Previewed" step where the agent showed you a page. Click it to open the page in the session's preview window, or bring that window forward. That is also how you get a preview back after closing its window.

Check a page at phone or tablet width

The toolbar above the page has:

The window follows the app's zoom (see the shortcuts page), so the page is zoomed by the same amount.

Let the agent see the page

show_preview gives the agent the page's address. With Browser (Playwright) installed from Settings → MCP servers → Add from the catalog (see the mcp-servers page), the agent can open that address without asking you, take screenshots and read the page's console. Without it, the agent can't see the page; only you can.

How the page is served

Haruspex serves the session's folder at a private address on this computer only (http://127.0.0.1:…), with a random part no other program knows. The page runs apart from the app and can't reach Haruspex itself. It can still load scripts and fonts from the internet, like any web page.

The address works while the preview window is open. Closing the window stops serving the folder; the next preview gets a new address.

Turn it off

Switch off Settings → Code → Helpers → Web preview, or untick it in a session's Extras menu. The agent then has no show_preview and the Preview buttons go away.

What it doesn't do