promptgarten ๐ŸŒฑ
๐ŸŒ ES

Command reference ยท Claude Code

/diff

Opens an interactive diff viewer for uncommitted changes and turn-by-turn diffs.

Left/right switches between git diff and Claude turns, up/down scrolls through files. From v2.1.198, the viewer automatically refreshes on external git changes.

โœ… WHEN TO USE IT?

Go through uncommitted changes file by file before committing

/diff after several edits, to review each changed file

Trace which change originated in which conversation turn

/diff, then switch between git diff and Claude turns with left/right

โ›” WHEN NOT TO?

Wanting to compare changes across multiple commits/branches

/diff only shows uncommitted changes and turn-by-turn diffs, not commit history

Better: use a normal 'git diff <ref1> <ref2>' in the terminal for cross-commit comparisons

SOURCES