Porthole

Built by modmyclaude

A live preview of the app you are building, right beside the chat.

Workflowv0.1.1
Tests136 passing
Model callsnone
Commands1
Settings1

Preview 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

  1. Start your app’s own dev server first. Replace this example URL with the local address it actually reports.

    /porthole http://localhost:5173
  2. Take a mobile-width screenshot at 390px.

    /porthole mobile
  3. Return to the 1280px desktop screenshot.

    /porthole desktop
  4. Reopen 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 guidance

Know 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.

Reported behavior and access

Files Temporary screenshots and browser profiles

Chrome loads the requested page and its resources, runs page JavaScript, and creates temporary files. Localhost does not guarantee that every request stays local.

Shell commands Subprocesses used

Chrome loads the requested page and its resources, runs page JavaScript, and creates temporary files. Localhost does not guarantee that every request stays local.

Network Used by Chrome

Chrome loads the requested page and its resources, runs page JavaScript, and creates temporary files. Localhost does not guarantee that every request stays local.

Added model calls None reported

The reviewed README reports no model calls of its own. Ordinary Claude Code work still uses your model.

Sound Not reviewed

Behavior has not been source-reviewed for this version. Check the README before relying on its access.

Handled events session.start, command.run /porthole, tool.call Bash, tool.call /"^(Edit|Write|MultiEdit|NotebookEdit)$"/, ui.close porthole, session.end, ui.render Pane

Event registration does not mean blocking. Read the source for whether an event observes, changes or holds an action.

README-reported behavior, not a sandbox guarantee. Source v0.1.1, 6dee58f, reviewed 22 Oct 2026

Original Claude Code validator report

reads files

Can read files, but cannot write them.

commands

Can run commands.

network

Does not make network requests.

model

Does not call a model.

sound

Does not play sound.

Validator hook registrations

Uses hooks: tool.call, ui.close.

Static validator signals can miss indirect effects, optional configuration and engine-managed storage.

How it works

Slash commands

/porthole

Preview 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

session.startcommand.run /portholetool.call Bashtool.call /"^(Edit|Write|MultiEdit|NotebookEdit)$"/ui.close portholesession.endui.render Pane

The prompt

Details

A live preview of the app you are building, right beside the chat.

Use it

You typeWhat happens
/porthole http://localhost:5173Opens 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.
/portholeOpens the last dev-server address porthole saw (or the page already in the pane).
/porthole mobile / /porthole desktopSwitches the viewport to 390 px or 1280 px wide and shoots again.
/porthole 3000 or /porthole localhost:3000/appShorthands 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> or http://127.0.0.1:<port>), a toast says Ready 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 example cat of 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 Refresh button and a Mobile / Desktop button. 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.

FieldDefaultMeaning
chromePathemptyFull 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 -d to make a private run folder in $TMPDIR (or /tmp when TMPDIR is 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 -rf runs only on porthole's own run folders ($TMPDIR/porthole.XXXXXX, or /tmp/porthole.XXXXXX without an absolute TMPDIR, 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 PATH and TMPDIR variables. 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 localhost and 127.0.0.1 on 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 cat of the log). Addresses like 0.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 mktemp and rm; Windows is not supported.

Built from a prompt

This mod was built from prompts/porthole.md.

added 9 Oct 2026updated 13 Oct 2026MITSource on GitHub

Pairs well with