Review what Claude Code changed before you commit: /diff, /rewind, /code-review and git
Dmitriy Solodukha · Updated · 4 min read
Checked against Caprock v0.199.0
Review Claude Code's changes before you commit: /diff, git add -p, /code-review, what /rewind cannot undo, Codex's review pane, and an annotated diff.
Read the diff before you commit. In the session, /diff shows the working tree's changes, Claude's edits included; git add -p then stages them hunk by hunk, so nothing goes in unread. /code-review (alias /review) adds a second pass that looks for bugs. /rewind undoes Claude's own file edits, but not what a Bash command changed: git is the safety net, not checkpoints.
Caprock's Changes view shows a session's diff beside the agent: stage a hunk, leave notes on lines and send them all to the agent, commit and push, then follow the pull request's checks. Free and open source.
What Claude Code gives you
| Command | What it does |
|---|---|
/diff | the working tree's changes, Claude's edits included |
/rewind (Esc Esc) | restores code, conversation or both to a checkpoint |
/code-review (/review) | a review of the branch's commits and uncommitted changes; --fix applies findings |
/security-review | the diff against origin's default branch, for security issues |
/code-review takes a pull request number, a branch, a path or a range, and an effort level. It runs as a background subagent and counts toward your usual limits.
In the VS Code extension, Manual mode shows each edit as a side-by-side diff to accept, reject or change first; in Auto mode most files are edited without asking.
What /rewind cannot undo
Claude Code saves a checkpoint of the files its edit tools change before each prompt, and keeps the 100 most recent. A rewind does not restore:
- Files changed only by Bash — a
sed, a code generator,npm install. - Most subagent edits, including a background
/code-review --fix. - Your own edits, and edits from other sessions running at the same time.
Anthropic's docs say it plainly: checkpoints are not a replacement for version control. Commit before a large task, or run it in a worktree.
Review with git
- 1
git diff --stat
- 2
git add -p
- 3
git diff --staged
--stat lists the files and how much each changed — a file you did not expect is the first thing to look at. git add -p walks every hunk and asks y or n, so you read each change before it is staged, and the last command shows exactly what the commit will hold.
Make Claude check its work before it stops
A Stop hook runs when Claude is about to finish. If it returns {"decision": "block", "reason": "…"} — say, because the tests failed — Claude keeps working instead of stopping. A PreToolUse hook can block a tool call before it runs, such as a write to a file you protect. Both are in Claude Code hooks.
Codex: /diff, /review and the app's pane
- CLI:
/diffshows the Git diff, untracked files included;/reviewasks Codex to review the working tree;codex review --uncommitted(or--base,--commit) does it from the shell. - The Codex app has a review pane: unstaged, staged, a commit, the branch or the last turn; stage, unstage or revert a file or a hunk; leave inline comments.
Review on GitHub, after the push
- Claude Code Review — several agents review each pull request and post inline comments, on open, on every push or on request (
@claude review). Team and Enterprise plans only; billed on tokens through usage credits, with no flat price per review. - Codex — comment
@codex review, or turn on automatic review; it flags P0 and P1 issues and reads rules fromAGENTS.md.
Other review panes
- Warp — a Code Review panel of uncommitted changes or the branch against main; inline comments go to the running agent, third-party CLI agents included.
- Cursor — Find Issues checks the agent's edits; Bugbot reviews pull requests.
What Caprock adds: the diff beside the agent
Caprock is a free, open-source desktop app for macOS, Windows and Linux that runs Claude Code, Codex and other agents in real terminal tabs. Its Changes view (⇧⌘G, Ctrl+Shift+G) sits beside the session:
- Staged, unstaged, new and conflicted files, each diff unified or side by side; stage or unstage single hunks.
- Notes on the diff, sent to the agent. Click a line number (⇧-click for a range) to leave a note; Send to agent types every note, with its file, lines and code, into that session.
- Commit with the agent's words. The message can start from what the agent said last; Commit, Commit & Push, Push (never forced). Your git hooks run.
- Fix with agent. A commit a hook refused, files in conflict or a pull request's failing check goes to the agent in that worktree with its output.
- After the push, the pull request's checks by name, what blocks it and how long CI is taking against its usual.
It works on any git repository, whichever agent made the change, and the review features are part of the free app.
Which to use
/diffandgit add -p— every commit; nothing to install./code-reviewor Codex's/review— a second opinion before a pull request.- Claude Code Review or
@codex review— a team that reviews on GitHub. - Caprock — several agents at once, and you want to read, annotate and commit each one's work without leaving its session.
Questions people ask
- How do I see what Claude Code changed?
- Run /diff in the session: it shows the working tree's changes, Claude's edits included. Outside it, git diff --stat for the files and git diff for the lines.
- Can I undo Claude Code's changes?
- /rewind (or Esc twice) restores files Claude changed with its edit tools to an earlier checkpoint. It does not undo what a Bash command changed, most subagent edits or your own edits, so commit before a large task and use git to undo.
- Is /review deprecated in Claude Code?
- No. /review is an alias of /code-review, a bundled skill that reviews the branch's commits and your uncommitted changes and can apply fixes with --fix.
- How do I make Claude Code run tests before it finishes?
- Add a Stop hook that runs them and returns a block decision when they fail: Claude keeps working instead of stopping.
- How much does Claude Code Review cost?
- Code Review for GitHub pull requests is for Team and Enterprise plans and is billed on tokens through usage credits, with a monthly spend limit; there is no flat price per review.
Sources
- Claude Code docs — Checkpointing: /rewind, what it does not track, read 27 November 2026
- Claude Code docs — Commands: /diff, /security-review, /code-review, read 27 November 2026
- Claude Code docs — Local code review: /code-review (alias /review), --fix, read 27 November 2026
- Claude Code docs — Code Review for GitHub pull requests, read 27 November 2026
- Claude Code docs — Code Review costs, read 27 November 2026
- Claude Code docs — VS Code extension: the diff view, read 27 November 2026
- Claude Code docs — Hooks: Stop and PreToolUse decisions, read 27 November 2026
- OpenAI — Codex commands: /diff, /review, read 27 November 2026
- OpenAI — Codex app: code review pane, read 27 November 2026
- OpenAI — Codex on GitHub: @codex review, read 27 November 2026
- Git — git-add documentation: --patch, read 27 November 2026
- Warp docs — Code Review, read 27 November 2026
- Cursor docs — Agent review, read 27 November 2026
- Caprock CHANGELOG — 0.78.0 Review and commit without a terminal, 0.102.0 review notes and Fix with agent
- Caprock docs — the Changes view (docs/app.md)
Try it
The record of every coding agent you run, the sessions it did not start included. Free, open source; nothing leaves your machine.
Caprock is a desktop app: it installs on your computer, not your phone.
Or email yourself the link:
macOS, Windows and Linux. Your phone pairs with it by QR code. Install options →
Notarized by Apple. One file for Apple silicon and Intel, macOS 13 or later.
Windows 10 22H2 or later, x64. Windows may ask once whether to run it: click More info, then Run anyway.
Paste it into Claude Code, Codex or any coding agent.
See what it says ▾
Install the Caprock desktop app for me. It is open source (Apache-2.0), a local app for my coding agents: https://github.com/dspv/caprock What the install does and how to remove it: https://github.com/dspv/caprock/blob/master/docs/install-agent.md Run the install script for my system: https://caprock.dev/mac.sh, /win.ps1 or /linux.sh. Read it before you run it if you like. Leave my Claude Code settings alone; the app asks me itself. Tell me when it's open.
Or run it yourself:
Paste in Terminal: it installs Caprock and opens it.Or with Homebrew: brew install --cask dspv/tap/caprock-app
Or run it yourself:
Paste in PowerShell: it installs Caprock for you and opens it.
Or run it yourself:
Paste in a terminal: it installs Caprock for you, no sudo. Or download the AppImage