Porthole
A live preview of the app you are building, right beside the chat.
136 passingnone11Preview a local dev server beside Claude Code
Porthole takes a refreshable screenshot of a local dev server. It is not a clickable or scrollable browser: interact with the app in your browser, then inspect the updated picture in Claude Code.
When to use it
- Check a local page after Claude edits its files.
- Compare a 390px mobile screenshot with a 1280px desktop screenshot.
- Reopen the last detected local server without retyping its URL.
Try it in your session
Start your app’s own dev server first. Replace this example URL with the local address it actually reports.
/porthole http://localhost:5173Take a mobile-width screenshot at 390px.
/porthole mobileReturn to the 1280px desktop screenshot.
/porthole desktopReopen the last detected server. Local file edits debounce refresh by 2 seconds; remote pages require manual refresh.
/porthole
Choose the behavior
In /config, choose Porthole. Leave chromePath empty for automatic detection. On macOS, use /Applications/Google Chrome.app/Contents/MacOS/Google Chrome only if Chrome is installed there. Verify by opening your actual local server.
chromePathReviewed default:(empty)- Empty means auto-detect; provide only an installed executable path.
Where it works
Requires Chrome or Chromium on macOS or Linux; Windows is unsupported. Images need a compatible local terminal such as kitty or Ghostty. Desktop, VS Code and mobile do not launch Chrome for this mod; use built-in preview where available.
Check current platform versions and installation guidanceKnow the limits
- No model calls of its own, but loading page scripts and network dependencies is not zero network. Each shot uses a fresh browser profile without your login cookies.
- SSH, tmux and unsupported terminals can fall back to text and pause auto-refresh. The picture cannot receive clicks or scrolls.
- Remote http(s) pages require a full URL typed by a human; prohibited schemes are refused. No verified Porthole product capture is available here.
Reviewed version 0.1.1, source reviewed 2026-10-15. Read the pinned README (8628e8f). This walkthrough describes that version, not a new live Claude Code test. Catalogue updates may describe a newer version.
How it works
Slash commands
/portholePreview a local web page in a side pane (headless Chrome screenshot)
Settings
chromePathDefault:- Full path to a Chrome or Chromium executable. Leave empty to find one automatically.
Hook events
The prompt
Build me a Claude Code mod called "porthole": a live preview of the app I am building, drawn beside the chat in my terminal. What it does- /porthole <url> opens a side pane with a screenshot of the page, sized to the pane. /porthole with no URL uses the last dev-server address it saw.- Dev-server detection: when Claude's Bash output contains a local address (localhost or 127.0.0.1 with a port), offer "Open in porthole" as a toast.Details
A live preview of the app you are building, right beside the chat.
Use it
| You type | What happens |
|---|---|
/porthole http://localhost:5173 | Opens the Porthole pane with a screenshot of the page, sized to the pane. A site other than localhost opens only when you type the command yourself. |
/porthole | Opens the last dev-server address porthole saw (or the page already in the pane). |
/porthole mobile / /porthole desktop | Switches the viewport to 390 px or 1280 px wide and shoots again. |
/porthole 3000 or /porthole localhost:3000/app | Shorthands for a local address. |
/porthole runs at once even while Claude is working, so you can open or refresh the preview mid-turn.
When it works it says so in a toast and adds nothing to the conversation; a refusal (an address it will
not open, Chrome missing) stays visible as the command's output.
- Dev-server detection. When a Bash result from Claude names a local server
(
http://localhost:<port>orhttp://127.0.0.1:<port>), a toast saysReady to preview http://localhost:5173/ - type /porthole(Claude Code shows it under porthole's name). Each address is offered once per session. Only foreground Bash results are read: a server Claude starts in the background is offered once its log passes through a Bash result (for examplecatof the log). - Auto refresh. While the pane is open, a file edit by Claude (Edit, Write, MultiEdit, NotebookEdit)
refreshes the screenshot 2 seconds later. Edits inside that window share one refresh, so refreshes are
never closer than 2 seconds apart, and the dev server gets a moment to rebuild first. Only local pages
refresh this way; a remote page you opened refreshes when you press
Refresh. - In the pane. A status line (address, viewport, shot number), a
Refreshbutton and aMobile/Desktopbutton. Close it with the pane's own close mark; that also deletes the picture.
Settings
Every setting has a default, so the notice at install about options not yet set is expected; change them in /config.
| Field | Default | Meaning |
|---|---|---|
chromePath | empty | Full path to a Chrome or Chromium executable. Empty: porthole looks in /Applications (Google Chrome, Chromium) and then on PATH (google-chrome, google-chrome-stable, chromium, chromium-browser). |
What it can touch
- Processes. For each screenshot:
mktemp -dto make a private run folder in$TMPDIR(or/tmpwhenTMPDIRis unset or not an absolute path), then the Chrome you already have, headless:--headless=new --disable-gpu --hide-scrollbars --no-first-run --no-default-browser-check --disable-extensions --disable-background-networking --disable-sync --use-mock-keychain --force-device-scale-factor=1 --timeout=15000 --user-data-dir=<run folder>/profile --window-size=W,H --screenshot=<run folder>/shot.png -- <url>. Arguments are passed as a list, never through a shell. Chrome is stopped as soon as it reports the PNG written (30 second hard stop).rm -rfruns only on porthole's own run folders ($TMPDIR/porthole.XXXXXX, or/tmp/porthole.XXXXXXwithout an absoluteTMPDIR, and the profile inside), checked by an allow-list before every call. - Browser profile. A brand new profile every shot, deleted as soon as Chrome stops: no cookies, no signed-in accounts, nothing shared with your own Chrome.
- Files and environment. Checks that Chrome and the screenshot exist. Reads no project files. Reads
the
PATHandTMPDIRvariables. The screenshot is read by the terminal itself to draw it. - Network. Porthole itself makes no network calls. Chrome loads the page you asked for and everything that page loads in turn (scripts, fonts, images, API calls, which can be on other sites), and runs its JavaScript, as any browser would, once per screenshot. Headless Chrome itself may also make background requests of its own (component updates, safe browsing and similar), even for a localhost page: the flags above switch off the ones Chrome lets you switch off, but this is not verified to be zero.
- Who may open what. Porthole opens
localhostand127.0.0.1on its own. Any other site opens only when you type/porthole <full http:// or https:// URL>yourself, at the terminal or through Remote Control. The same command arriving from anywhere else (another plugin, a peer session, a channel relay, a task notification, a schedule, an SDK script) gets localhost only and a one-line refusal.file:,javascript:,data:,chrome:and every other scheme are always refused. - Model calls. None.
Limits
- Terminal only. The picture is a terminal
Image(kitty graphics protocol). The engine documents kitty and Ghostty; in a terminal it cannot draw in (or over ssh or tmux, where the terminal cannot read the file) the pane shows a text stand-in, a toast says so once, and auto refresh pauses. Manual refresh still works. - Desktop app, VS Code, mobile. The pane shows one line pointing you to the desktop app's built-in browser pane, and porthole does not start Chrome there. (Commands typed in the desktop app likely arrive as SDK turns, which count as not typed by you; with no terminal there is no screenshot either way.)
- A screenshot, not a browser. You cannot click or scroll the page; you see its top. Pages behind a login show the logged-out view, by design of the throwaway profile.
- The toast has no button. Toasts in this API carry text only, so the toast names the command to type.
- Detection reads Bash results only. A server Claude starts in the background is caught when its log
passes through a Bash result (for example
catof the log). Addresses like0.0.0.0,[::]or a LAN IP are not detected; type them in full. - Sizing. The first shot after opening is 1280 x 800 (the pane has not been measured yet); later desktop shots match the pane's shape. Pictures are fitted assuming a terminal cell about twice as tall as it is wide.
- macOS and Linux. Uses
mktempandrm; Windows is not supported.
Built from a prompt
This mod was built from prompts/porthole.md.
Pairs well with
Follow modmyclaude for new mods: TikTok · Instagram · YouTube · X · Threads · Facebook