ClaudeWatch
Review what Claude Code changed, one file at a time. After a turn, the ClaudeWatch sidebar lists
every file Claude edited; open a diff against the version from before Claude touched it, then
Keep or Undo each file.
Status: working, not yet published. Run it with F5.
How it works
Claude Code ──hook──> node out/hook/hook.js ──writes──> ~/.claudewatch/
│ (watched)
VS Code extension <──────────────────────────────────────────┘
review tree · diff (baseline ↔ live file) · Keep / Undo
Three Claude Code hooks run the same script (src/hook/hook.ts):
| Event |
What the script does |
PreToolUse on Write, Edit, MultiEdit, NotebookEdit |
Saves the file's current content as its baseline, only if it has none yet. |
UserPromptSubmit |
Starts a new turn for the session. |
Stop |
Marks the turn as finished, so the extension can open the review panel. |
Because a baseline is only saved when none exists:
- a file you haven't kept keeps its original baseline, so its diff grows as Claude edits it again;
- a file you kept gets a fresh baseline the next time Claude touches it, so you only see new changes.
What you see
The ClaudeWatch icon in the activity bar opens two views, Sessions and Workspace Folders. Each can be
collapsed or hidden on its own, like Outline or Timeline in the Explorer.
Sessions
- One node per Claude session, named after Claude Code's title for it, else the first prompt. If a session edited
files in several workspace folders, each folder gets its own group.
- Under a session (or folder): To review, the files waiting for Keep / Undo, and Edited in this session, every
file Claude edited, marked pending, kept, undone or no net change. File rows start with
+added −removed counts,
then "new" for files Claude created, then the folder. Hover a file for its diff.
- Rows have buttons in this order: Keep, Undo, Show diff. Sessions, folders and the To review list have the same
buttons for everything under them, and their Show diff opens one multi-file diff. The view title has Keep All,
Undo All and Refresh, shown only while something waits for review.
- Undo all takes two clicks, not a dialog. On the view title and on sessions, folders and To review, the first
click turns the button into a warning icon and the second one undoes. After 5 seconds, or when you arm another
one, it goes back to normal. Keep and single-file Undo act immediately.
- Hide a session with the eye button on its row (or right-click). It moves to a "Hidden sessions" row at the
bottom, where its eye button shows it again, and the group's eye shows all. Only the view changes: its files still
wait for review and keep their buttons in the editor. Hidden sessions are remembered across restarts.
- Workspace Folders lists every workspace folder (the root of each, not nested folders) with a switch to turn
ClaudeWatch's hooks on or off in its
.claude/settings.local.json. Other settings in that file are left alone.
It starts collapsed.
In the editor
Open any changed file, from the sidebar or the Explorer (which marks it with C):
- Added lines get a dark green background. A dark red line marks where lines were removed, or replaced (it sits above
the new lines).
- Hover a change to see what was removed and added, with Keep and Reject for that change. The same two buttons sit
above each change.
- Keep, Discard and Diff for the whole file are in the editor's title bar.
- Ctrl+Z / Ctrl+Shift+Z step back and forward through Keep, Reject and Undo.
- Diff editors keep VS Code's own look.
Storage
Baselines live outside the workspace, in ~/.claudewatch/ (set CLAUDEWATCH_HOME to move it):
baselines/<id>.blob original bytes (absent for files Claude created)
baselines/<id>.json path, whether the file existed, session and turn numbers
sessions/<session_id>.json session name, current turn and when it stopped
history/<session_id>/<id>.json every file Claude edited in the session, kept after Keep / Undo
history/<session_id>/<id>.before|.after copies of the file before / after Claude's edit, for the diff of kept and undone files
hook.log errors from the hook script
<id> is the sha1 of the file's absolute path.
Source layout
| Path |
Purpose |
src/shared/ |
Types and storage paths used by both the hook and the extension. No vscode import. |
src/hook/hook.ts |
The hook script. Never prints to stdout and always exits 0. |
src/hooks/hookInstaller.ts |
Adds and removes the hooks in .claude/settings.local.json. |
src/review/ |
Baseline store, the two tree views, editor decorations and per-change buttons, undo / redo of review actions, hidden sessions, the two-click Undo all, commands. |
playground/ |
Multi-folder workspace opened by F5 (playground.code-workspace: admin/ and api/). Each folder's .claude/settings.local.json already points at the dev build's hook. |
Development
bun install
bun run compile # or: bun run watch
bun run lint
bun run test # integration tests in a real VS Code instance
Press F5 to open the playground in an Extension Development Host. Run Claude Code there and ask
it to edit a file; a baseline appears in ~/.claudewatch/baselines/.
Not handled yet
- Files changed through shell commands (sed, formatters, code generators) bypass the hook.
- Removed lines are shown in the hover, not as lines in the editor (VS Code gives extensions no way to add them).
- Tree rows can't colour or right-align text, so the
+N −M counts are plain text.
- Ctrl+Z can't bring back a file Claude created after you undid it.
- Hooks only apply to Claude Code sessions started in the folder that has them, so a nested
.claude needs its own.
| |