One command for visual PR reviews. Pre-post detects the routes your branch changed, screenshots them on production and on your dev server, and posts the diff as a single PR comment.
How it works
- Make your UI changes
- Say
/pre-postin Claude Code, or runpre-post pr - Pre-post diffs your branch against main, then follows the import graph to every route you touched
- It captures each route twice — production (Pre) and your dev server (Post), desktop and mobile
- It pixel-diffs each pair and crops the changed region
- One sticky comment lands on the PR, updated in place on every run
Next.js App and Pages Router, Vite, and monorepos are detected automatically. The Pre side can be any reachable URL — Vercel, Netlify, or your own host.
What's different
Pre-post started as a fork of Vercel's before-and-after. The original required you to manually pass two URLs. Pre-post reads your git diff, detects which routes changed, captures both sides automatically — desktop and mobile, at 2x retina — then pixel-diffs each pair and posts a single comment on the PR.
Under the hood, it uses Playwright instead of Vercel's agent-browser. It freezes the clock, finishes animations, and waits for fonts, images, and layout to settle before each capture, so a screenshot only changes when the page does.
Install
For your terminal. Nothing to install — the first run pulls the CLI and Chromium, then reuses them.
Needs Node 20+, a GitHub token (gh auth login or GH_TOKEN), and an open PR. Stuck? Run doctor.
Add Skill
Show Claude Code how and when to take pre and post screenshots. The skill runs the one command and reports the summary and the comment link — it never opens the images, so screenshots stay out of the model's context. Say /pre-post after a UI change.
Easiest way in. Install once, then never type a flag. No npm knowledge needed — just Node 20+.
Options
First run in a repo — the production URL is saved to .pre-post.json
Skip detection and name the routes yourself
Custom viewports (default is desktop + mobile)
Capture and diff locally without posting anything
Machine-readable output
Compare any two URLs, no PR involved
Use existing images instead of capturing URLs
Check which routes this branch touches, or why a run cannot start
Sign in once to a protected site — the session is reused
Clean up old screenshots
Screenshots are published to a pre-post-assets branch in the same repository, one commit per run, and served via GitHub blob URLs. Nothing is committed to the PR branch, so no CI runs, and the images render on private repos. prune removes images for PRs closed more than 90 days ago.
Acknowledgements
Built on before-and-after by James Clements at Vercel Labs.