Skip to content
SnapDOMTry SnapStudioGitHub★ 8K
Agents · Tutorial

Claude Code capture skill: visual checks without writing Playwright scripts

A downloadable Claude Code skill and billing-card fixture. Route app capture to SnapEye, visual review to SnapDiff and browser interaction to SnapSurf.

Capture before editing, compare afterward

The skill below tells Claude Code which component to capture, when to save the baseline and how to read the comparison. SnapEye handles local app capture, SnapDiff visual review, SnapSurf browser interaction.

None of this needs a Playwright test script. SnapSurf uses Playwright internally to control its browser; SnapEye captures through the running app; SnapDiff compares captures inside the page.

SnapEye, SnapDiff and SnapSurf have different roles

SnapEye: capture your app and compare before and after

Claude runs a command to capture a component in your local app. After a code change, another command compares it with the saved image and reports whether the pixels changed.

Good for checking a CSS refactor or finding a visual regression. SnapEye captures and records the app; it does not click through the interface.

SnapDiff: review visual differences inside the browser

SnapDiff captures components, compares them with saved images and shows the differences in the page, where you inspect and approve changes through its reporter.

Use it for interactive review. Its basic browser workflow saves references in that browser’s storage; blocking a CI build needs the separate test setup.

SnapSurf: let the agent operate the browser

SnapSurf lets Claude open a page, find a control, click or type, and check what changed: open a settings form, verify that a dialog appeared.

Use it when the task needs interaction. It starts its own browser session, without the logins from your open Chrome tabs.

Semantic verification says whether the interface changed state; visual comparison says whether captured pixels changed. A “saved” message can be correct while a button overlaps it, so check pixels when the task concerns appearance.

Set up local capture in a Vite app

npm install --save-dev @zumer/snapeye @zumer/snapdom@3
import { defineConfig } from 'vite';
import { snapeye } from '@zumer/snapeye/vite';
export default defineConfig({ plugins: [snapeye()] });

Start the dev server, then capture the component before editing it, with a stable viewport, fixed fixture data and a specific target rather than the whole application.

npx snapeye capture billing-card-desktop --target '#billing-card'
# Close the capture-trigger tab before editing, then:
npx snapeye diff billing-card-desktop --target '#billing-card' --fail-on-change

Read status first. A successful run with diff.changed: false passes an appearance-preserving refactor. If it changed, inspect the reported regions and artifacts. An environment failure is not a passing comparison.

Download a Claude Code capture skill

Save this complete SKILL.md as .claude/skills/visual-capture/SKILL.md in the project. The skill supplies the routing instructions; the tools, installed separately, perform the capture. The official skill guide documents the directory and frontmatter.

---
name: visual-capture
description: Capture and verify local UI changes with SnapEye; use SnapSurf for browser interactions and SnapDiff for in-page review.
---
Capture the baseline before editing. Keep the viewport and fixture data fixed.
Use SnapEye for a selector-level capture and read status before diff.changed.
Never replace a baseline simply to hide a regression.
Use SnapSurf for navigation and verify after every action.
Report the target, artifacts, tool versions and what was actually verified.

The downloadable version also covers errors, intentional visual changes and signed-in sessions, and keeps publication and baseline approval subject to the user’s instructions.

A reproducible billing-card exercise

Open the fixture or download its HTML: a static card with synthetic data and a button that deliberately changes its border, so baseline and regression are easy to tell apart.

npm install --save-dev vite @zumer/snapeye @zumer/snapdom@3
npx snapeye serve billing-card.html
# In another terminal, using the URL printed by serve:
npx snapeye capture billing-card --url <printed-url> --target '#billing-card'
# Close the capture-trigger tab, edit the CSS, then compare:
npx snapeye diff billing-card --url <printed-url> --target '#billing-card' --fail-on-change

For an interaction-only state, a fresh trigger URL reloads the page. Reach the state with a browser tool and use SnapEye's documented in-page API; the CLI will not have captured an already-open modal. The SnapDiff live demos show an in-page review workflow with deliberate visual drift.

Add browser interaction through MCP

SnapSurf is published in the official MCP Registry as io.github.zumerlab/snapsurf and listed in Glama. The registry entry checked on October 5, 2026 is version 0.1.2, distributed as the npm package @zumer/snapsurf.

claude mcp add --scope user snapsurf -- npx -y -p @zumer/snapsurf@latest snapsurf-mcp

Then ask Claude to open the app, find a named control, act, verify and assert the intended transition. Read structuredContent, get fresh target ids after new observations, and escalate to pixels when the semantic report cannot answer the question. A semantic diff does not prove a SnapDOM image has the right pixels.

For a workflow that needs the user's existing signed-in tab, use an authorized integration for that tab.

A useful task to give Claude

“Refactor the billing card CSS without changing its appearance. Capture #billing-card before editing, keep the fixture and viewport fixed, compare afterward, and report the JSON verdict and artifact paths. If verification fails, explain the failure; do not overwrite the reference.”

For an intentional redesign, specify which region may change and inspect it before approving a new reference. Keep the original reference until that review is done.

Related: element capture, recapture and invalidation, React lifecycle timing.

Sources checked October 5, 2026: SnapEye setup and CLI, SnapDiff workflows, SnapSurf MCP integration, and the Claude Code skill guide above.

Playwright MCP, for comparison

Microsoft’s Playwright MCP also lets an agent operate a browser without a standalone test script; its documented approach uses structured accessibility snapshots. SnapSurf adds a digest-and-diff workflow with assertions over retained transitions. Both control a browser, so compare their observation and verification APIs against the task at hand.

Keep Playwright tests for an established end-to-end suite, multi-browser automation or a CI workflow your team already maintains. Add selector-level DOM capture when the immediate question is what changed in a running component.

Protect the baseline during hot reload

After a CLI capture finishes, close its trigger tab or navigate to the ordinary app URL before editing. In our local SnapEye 0.4.0 fixture, leaving the capture query open during Vite hot reload triggered another capture and replaced the baseline, which would turn a real change into a misleading no-change verdict. With the capture URL removed before editing, the deliberate border change produced changed: true and exit code 3.

The fixture was checked in Chromium at 320 × 240 captured CSS pixels. An unchanged run reported zero changed pixels; the border regression reported a change. The check covered this fixture in Chromium only.