Dev-server preview
The agent brought up npm run dev on 5173 — you want to see the result right away, and not necessarily from that machine. The "Dev-server preview" item in the chat menu opens that server's page in a new tab (on Android — in the phone's browser): no VPN, no port forwarding, no tweaking the dev server's config.
How to open it
- Chat menu → "Dev-server preview".
- Pick a port from the list of what the machine is listening on right now, or type your own (on Windows there is no list — the port is typed in by hand).
- "Open".
Absolute paths (/@vite/client, /_next/…) and hot reload both work: the preview lives on a port of its own where the root / is the app's root, so the page doesn't notice it is being viewed through Clauder.
Access
You get in through a one-time link from Clauder: it lives for a minute, and after entering the browser keeps the session for 12 hours. Without it the preview answers "open the preview from Clauder". There is no separate page with a password.
The preview is owner only: it is access to any port on the machine's loopback. It only goes to the machine's own 127.0.0.1 — it is "look at your own stuff", not a proxy into the network.
Turning it on
The preview is off until PREVIEW_PORT is set.
| Variable | What it is |
|---|---|
PREVIEW_PORT | the preview listener's port; empty or 0 — preview is off |
PREVIEW_PUBLIC_PORT | the port the listener is reachable on from outside, if different (docker); the same by default |
PREVIEW_HOST | the listener's address, 0.0.0.0 by default |
In docker docker-compose.yml already forwards port 4250 — recreating the api container is enough (docker compose up -d api). In the app — the same keys in config.json.
The preview port has to be reachable from the device you look from — just like Clauder's main port. The link is built from the same address the client uses for Clauder plus the preview port: if Clauder is exposed to the outside through a tunnel or a proxy, the preview port doesn't get there by itself.