Give your coding agent visual feedback on your app.
Visdiff connects a running web page to the source code behind it. Select an element, describe the change in the built-in Agent chat, and review the source diff before applying it. The visual task queue and CLI/MCP handoff remain available for external coding agents.
Documentation: explore the Visdiff guide or read its source in
docs/.
flowchart LR
Browser["Running app<br/>Select · move · resize · layout"]
Chat["Built-in agent chat<br/>Describe · clarify"]
Queue["Optional task queue<br/>CLI or MCP"]
Source["Source code<br/>Implement · verify"]
Review["Diff review<br/>Apply or reject"]
Browser -->|"Fresh element context"| Chat
Chat -->|"Proposed edit"| Source
Source -->|"Changed files + diff"| Review
Browser -.->|"Optional visual task"| Queue
The built-in Agent works from rendered element context and source anchors rather than a screenshot-only guess. It writes a reviewable proposal into the development working tree; Reject restores the original files, while Apply changes keeps the proposal and runs configured checks.
Requirements: Node.js >=22.12.0.
npm install -D visdiffRegister the plugin before your framework plugin in the existing Vite configuration:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { visdiffVite } from 'visdiff/vite'
export default defineConfig({
plugins: [visdiffVite(), react()],
})Start your development server, configure a model provider, open the app, and click visdiff.
- Click visdiff, then select an element.
- Click Add to Agent and describe the result in plain language.
- Review the proposed files and diff.
- Choose Apply changes or Reject.
For a no-model workflow, drag, resize, or move elements visually and click Apply to queue a task. Click Copy to paste it into any external agent. Edits collect in the change panel until applied. Reset restores the current preview; Esc or ✕ cancels the selection; Clear discards the unsent batch.
Run from the project root to read tasks and agent instructions:
npx -y visdiff tasks
npx -y visdiff instructionsClear only the task IDs the agent implemented and verified:
npx -y visdiff clear <task-id> [task-id ...]Or connect through MCP. For Claude Code:
claude mcp add visdiff -- npx -y visdiff mcpOther MCP clients can launch npx -y visdiff mcp over local stdio. See the agent workflow for implementation and verification rules.
Vite provides the integrated overlay, endpoint, and source anchors for React, Vue, and Svelte. visdiff/webpack supports these frameworks through Webpack; visdiff/next supports Next.js with Turbopack and webpack. See the support matrix for details. Integrations run in development only.
npm run check
npm run build
npm run docs:buildnpm run check runs ESLint, TypeScript checks, and package tests. CI runs unit tests on Node 22.12 and 24; lint, typecheck, builds, documentation, and browser tests run on Node 24.
MIT. See LICENSE.
