See what AI changed before you accept it.
Visual before/after diffs for AI-assisted development. No more hidden layout breaks.
Install • Quick Start • How It Works • Commands • Config
You ask your AI coding tool to "fix the button styling." It does. But it also:
- Shifted your nav 3px to the left
- Changed the font weight on your headings
- Broke the mobile layout entirely
Code diffs don't show you this. You only find out when a user reports it.
npx shotdiff snap # Take a "before" screenshot
# ... let AI make changes ...
npx shotdiff diff # See exactly what changed visuallyShotdiff captures your running app before and after changes, then generates a beautiful visual comparison with pixel-level highlighting.
npm install -g shotdiff
# or use directly
npx shotdiff# 1. Start your dev server
npm run dev
# 2. Take a snapshot before AI changes
npx shotdiff snap
# 3. Make your AI changes (Claude, Cursor, Windsurf, whatever)
# 4. See what actually changed
npx shotdiff diffA beautiful HTML report opens in your browser with:
- Side-by-side comparison of before/after
- Slider overlay to drag and reveal changes
- Pixel diff highlight showing exactly what moved
- Change summary with percentage of affected pixels
Takes a "before" screenshot of your running app.
shotdiff snap # Default: http://localhost:3000
shotdiff snap --url http://localhost:5173 # Custom URL
shotdiff snap --width 1440 --height 900 # Custom viewport
shotdiff snap --full-page # Capture full scrollable pageTakes an "after" screenshot and shows the visual diff.
shotdiff diff # Compare against last snap
shotdiff diff --threshold 0.1 # Sensitivity (0-1, lower = more sensitive)
shotdiff diff --no-open # Don't auto-open browserWatches for file changes, auto-captures and shows diff after each change.
shotdiff watch # Watch current directory
shotdiff watch --url http://localhost:5173 # Custom URL
shotdiff watch --delay 2000 # Wait 2s after change for HMRShows all snapshots taken in this session.
shotdiff history # List all snapshots
shotdiff history --clean # Delete all snapshotsCreate shotdiff.config.json in your project root:
{
"url": "http://localhost:3000",
"width": 1280,
"height": 720,
"fullPage": false,
"threshold": 0.1,
"delay": 1000,
"routes": ["/", "/dashboard", "/settings"]
}Or pass flags to any command:
| Flag | Default | Description |
|---|---|---|
--url |
http://localhost:3000 |
URL to capture |
--width |
1280 |
Viewport width |
--height |
720 |
Viewport height |
--full-page |
false |
Capture full scrollable page |
--threshold |
0.1 |
Diff sensitivity (0-1) |
--delay |
1000 |
Delay after file change (ms) |
- Snap captures a PNG screenshot using Playwright's Chromium
- Screenshots are stored in
.shotdiff/(add to.gitignore) - Diff uses pixelmatch for pixel-level comparison
- Results are rendered as a self-contained HTML report with inline base64 images
- No cloud, no uploads, everything stays local
Any local development server. Any framework. Any AI coding tool.
- Next.js, React, Vue, Svelte, Angular
- Claude Code, Cursor, Windsurf, Copilot, Cody
- Any URL running on localhost
- Node.js 18+
- A running local dev server
Playwright's Chromium is downloaded automatically on first run.
Those are great CI tools for visual regression testing. Shotdiff is different:
| shotdiff | Percy/Chromatic | |
|---|---|---|
| Use case | Real-time AI change review | CI/CD regression testing |
| Setup | npx shotdiff snap |
Config, CI integration, account |
| Cost | Free forever | Free tier, then paid |
| Where | Local, instant | Cloud, async |
| When | Before you accept AI changes | After you push code |
MIT
Built to save developers from invisible AI breakage.