Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Warden: The Diff GuardNew to Visual Studio Code? Get it now.
Warden: The Diff Guard

Warden: The Diff Guard

Harsh Doshi

| (0) | Free
Review every Claude Code file edit in a VS Code diff before it is written: approve, reject, edit or comment.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Warden

Warden: review Claude Code's edits in VS Code

Review every file edit Claude Code wants to make, in a VS Code diff, before it touches your file.

Claude Code waits while you look. You approve it, reject it, fix it, or comment on it, and Claude gets your answer.

Features

  • Diff before write: each edit opens as a side-by-side diff at the first changed line.
  • Approve: Claude writes the edit as shown.
  • Reject: Claude does not write it and is told you said no.
  • Ask in Terminal: hand the choice back to Claude Code's usual prompt in the terminal.
  • Edit the proposal: type in the right side of the diff; Claude writes your version.
  • Line comments: click + on any line (or a selection) to leave a note; Claude gets it with your decision.
  • Ask about lines: select lines, press Ctrl+Alt+Q, and ask a quick copy of the Claude session about them in the Chat view.
  • Right window only: an edit goes to the VS Code window that has that file's folder open.
  • Gets your attention: if that window is in the background, it flashes in the taskbar (bounces in the Dock on macOS).
  • Nothing to install: the small local server ships inside the extension and runs on VS Code's own Node.
  • Local only: everything runs on 127.0.0.1; no account, no cloud, no telemetry.

Requirements

  • VS Code 1.95 or newer.
  • Claude Code on the same machine.
  • For "Ask about lines": the claude command on your PATH and VS Code chat turned on.

Get started

  1. Install Warden.
  2. Open your project folder in VS Code.
  3. Click Start Warden in the status bar (bottom right). You see Warden connected to Claude Code.
  4. Run Claude Code in that folder as usual (in any terminal).
  5. When Claude edits a file, the diff opens. Choose Approve, Reject or Ask in Terminal at the top right of the diff.

To stop, click Stop Warden in the status bar. Claude Code then asks in the terminal again, as it did before.

How it works

Claude Code ──hook──▶ Warden server (127.0.0.1:7357) ──▶ VS Code window with that folder
     ▲                                                              │
     └──────────────── your decision, edits and comments ◀──────────┘
  1. On start, Warden adds two hooks to Claude Code's global ~/.claude/settings.json. Your own hooks stay; a backup is saved as settings.json.agent-reviewer.bak.
  2. Before Claude writes a file (Write, Edit, MultiEdit), the hook sends the edit to the Warden server and waits.
  3. The server sends the edit to the VS Code window whose folder holds the file. That window shows the diff.
  4. Your choice goes back through the same waiting hook. Claude writes, skips, or asks you in the terminal.
  5. If Warden is not running, the hook fails quietly and Claude Code works as normal.

The server stops by itself 10 seconds after the last window disconnects.

Shortcuts

Action Windows / Linux macOS
Approve Ctrl+Alt+Enter Cmd+Alt+Enter
Reject Ctrl+Alt+Backspace Cmd+Alt+Backspace
Ask in Terminal Ctrl+Alt+A Cmd+Alt+A
Ask Claude about selected lines Ctrl+Alt+Q Cmd+Alt+Q

Closed a diff without choosing? Run Warden: Show Pending Review from the Command Palette.

Settings

Setting Default What it does
warden.port 7357 Port of the local server. Change it only if you run the server yourself on another port.

To get the taskbar flash, Warden sets task.notifyWindowOnTaskCompletion to 0 in the folder's .vscode/settings.json. Set it to -1 to turn this off.

Remove the hooks

Uninstalling the extension leaves the hooks in ~/.claude/settings.json; they do nothing while Warden is off. To remove them, delete the entries whose URL contains /hook?src=agent-reviewer, or run npm run hooks:uninstall in the backend folder of this repository.

Troubleshooting

  • No diff opens: check that the status bar says Stop Warden and that the edited file is inside a folder open in this window.
  • Warden disconnected: the window lost the server; it retries by itself. Run Warden: Show Server Log to see why.
  • Ask about lines says Claude Code CLI not found: put claude on your PATH, or set AGENT_REVIEWER_CLAUDE_PATH before starting VS Code.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft