/ui-screenshot:ui-screenshotfrom ui-screenshot
Captures PNG screenshots of any URL using a headless Chromium-family browser over CDP. Supports mobile viewports, language redirect testing, click/type/eval interactions, and layout checks.
Ships in ui-screenshot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Takes a screenshot of any URL with a headless browser driven over the Chrome DevTools Protocol. It uses the first installed Chromium-family browser in this order: $BROWSER_BIN, Brave, Chromium, Google Chrome, Microsoft Edge, Vivaldi (macOS app bundles first, then binaries on PATH for Linux). It prints the browser it picked on stderr. If none is installed it exits with an error that lists every place it looked.
bun ~/.claude/skills/ui-screenshot/shot.ts <url> [out.png] [--wait=3500] [--width=1440] [--height=900] [--full] [--mobile] [--lang=pt-BR,en-US] [--clear-storage] [--check]
Defaults: out=/tmp/ui-shot.png, wait=3500ms, 1440x900, viewport only.
| Flag | What it does |
|---|---|
--full | Capture the full scrollable page |
--mobile | Phone viewport (390x844, scale 2, touch) unless --width or --height is given |
--lang=pt-BR,en-US | Set navigator.languages and the locale before the page loads, to test language redirects |
--clear-storage | Clear localStorage, cookies and IndexedDB for the URL's origin first. The profile is shared between runs, so use it for any redirect or first-visit test |
--click=<selector> | Click the first element matching the CSS selector. Prints clicked or not found on stderr |
--type=<selector>=<text> | Set the value of an input and fire input and change events |
--eval=<js> | Run JavaScript in the page and print the result on stderr (for example --eval='document.title') |
--step-wait=1500 | Milliseconds to wait after each click, type or eval, so a navigation can finish |
--check | Print JSON with the final URL after redirects, horizontal overflow, scroll width and header height |
--click, --type and --eval can repeat and run in the order given, after the page loads. Example, clicking a language switch and checking where it lands:
bun ~/.claude/skills/ui-screenshot/shot.ts http://127.0.0.1:1111/ /tmp/switch.png --clear-storage --click='a[hreflang="pt"]' --check
The user agent is sent without HeadlessChrome, because some sites (x.com among them) answer 403 to a headless browser. Pages behind a login still need that login in the automation profile.
Example: a Portuguese phone browser should land on /pt/ without sideways scrolling.
bun ~/.claude/skills/ui-screenshot/shot.ts http://127.0.0.1:1111/ /tmp/pt-mobile.png --mobile --lang=pt-BR --clear-storage --check
The script starts the headless browser on CDP port 18801 if nothing is listening there, with the profile at ~/.claude/browser/Default/user-data.
After the script writes the PNG, view it with the Read tool, which renders it as an image.
~/.claude/browser/Default/user-data as a dedicated automation profile.18801) so several skills can share one browser instance.BROWSER_BIN=/path/to/binary.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gabrielkoerich/skills --plugin ui-screenshot