cdiff: Review Claude Code Edits

When Claude Code edits your files, cdiff shows exactly what changed, right in the editor. Changed lines are
green, removed lines get a red rule, and each change has Accept and Revert above it. Nothing is
committed for you, and nothing is sent anywhere: cdiff only reads and writes files on your machine.
Features
- Inline review. Every change is highlighted, with Accept and Revert on the change itself.
- Accept or revert one change, all changes in a file, or all changes in the workspace.
- Next and previous change, across files, from the editor title bar or the keyboard.
- Pending changes panel in the Explorer lists each file with its pending changes, and the status bar shows the totals.
- Claude Code only, by default. With the hook installed, cdiff reviews only the files Claude Code edits, not your own edits.
- Works without the hook too.
allChanges mode compares every file with Git HEAD.


Quick start
- Install cdiff from the Visual Studio Marketplace (or from a release
.vsix file).
- Open the Command Palette and run cdiff: Install the Claude Code hook. It asks you to confirm, then:
- copies the hook script to
~/.claude/hooks/cdiff-pre-edit.js, and
- adds one
PreToolUse entry to ~/.claude/settings.json.
A backup of settings.json is kept next to it. Your other settings and hooks are not changed.
- Restart Claude Code if it is already running.
- Ask Claude Code to change some code. The changes appear in the editor and in the cdiff: Pending changes panel.
- Accept the changes you want, and revert the rest.
The hook needs Node.js on your PATH, because Claude Code runs the hook with node.
To remove the hook, run cdiff: Remove the Claude Code hook. It removes only cdiff's entry and its script.
How it decides what is pending
- The baseline for a file is the content before Claude Code's first edit to it, saved by the hook.
- Everything that differs from the baseline is pending, shown in the editor.
- Accept moves the baseline forward for that change only.
- Revert puts the baseline lines back in the editor. The file is not saved until you save it (Ctrl+S).
- When every change in a file is accepted or reverted, its baseline is removed. The next edit by Claude Code starts a new review.
- In a Git repository, a commit accepts the changes it contains.
Commands
| Command |
What it does |
cdiff: Install the Claude Code hook |
Installs the hook (asks for confirmation first) |
cdiff: Remove the Claude Code hook |
Removes cdiff's hook entry and script (asks for confirmation first) |
cdiff: Accept change / Revert change |
Used by the Accept and Revert links above each change |
cdiff: Accept all changes in file |
Keeps every change in the file |
cdiff: Reject all changes in file |
Restores the file to its baseline and saves it |
cdiff: Accept all changes in workspace |
Accepts every file in the panel |
cdiff: Go to next pending change / previous |
Moves between changes, across files |
cdiff: Open first pending change |
Opens a file from the panel at its first change |
cdiff: Re-check all tracked files against Git HEAD |
Use after switching branches or resetting |
Keyboard shortcuts (change them in Keyboard Shortcuts if they clash):
| Action |
Windows / Linux |
macOS |
| Accept all changes in file |
Ctrl+Alt+A |
Cmd+Alt+A |
| Reject all changes in file |
Ctrl+Alt+R |
Cmd+Alt+R |
| Next change |
Ctrl+Alt+N |
Cmd+Alt+N |
| Previous change |
Ctrl+Alt+P |
Cmd+Alt+P |
Settings
| Setting |
Default |
Meaning |
cdiff.mode |
claudeEdits |
claudeEdits: review only files Claude Code edited (needs the hook). allChanges: compare every file with Git HEAD, including your own edits |
cdiff.enabled |
true |
Turn decorations and CodeLenses on or off |
cdiff.maxFileSizeKB |
1024 |
Larger files are not tracked |
cdiff.ignoredFolders |
node_modules, .git, dist, out, build, .next |
Files inside these folder names are not tracked |
Privacy and files
- cdiff makes no network connections.
- Baselines are saved in
~/.cache/cdiff/snapshots (the hook) and in VS Code's storage folder (the extension), one file per tracked file. Nothing is written into your repository.
- Those baselines contain the content of the files you review, so treat that folder like the files themselves.
- The hook never blocks an edit. It skips binary files and files over 1 MB.
Manual hook setup
If you prefer to edit the file yourself, copy hooks/claude-pre-edit.js from the extension folder to a fixed location
and add this to ~/.claude/settings.json, merged with your existing hooks:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [{ "type": "command", "command": "node \"/path/to/claude-pre-edit.js\"" }]
}
]
}
}
Limits
- cdiff cannot tell which tool made a change. Every change in a tracked file is pending until accepted, reverted, or committed.
- A change made while VS Code is closed is shown as a change against the stored baseline when the file is next seen, not as a separate history.
Contributing and development
npm install
npm test # unit tests: diff logic, snapshot paths, the hook, the settings merge (fast, no VS Code)
npm run test:int # tests in a separate VS Code 1.90 with a throwaway Git repo (needs a display; use xvfb-run on servers)
npm run screenshots # regenerates media/screenshots/ (Linux: needs xvfb-run and ImageMagick's import)
npm run install-local # packages cdiff.vsix and installs it into your VS Code
To remove the extension: code --uninstall-extension juener.cdiff.
License
Copyright (c) 2026 Vallete Software Integrations (https://www.vallete.com). Author: Juener.
All rights reserved. You may install and use cdiff, but you may not copy, modify,
or redistribute it. See LICENSE.txt.