promptgarten ๐ŸŒฑ

Command reference ยท Claude Code

/diff

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

/diff opens an interactive diff viewer for the current working state. The left/right arrow keys switch the view between the Git diff of uncommitted changes and the individual turn-by-turn diffs of the conversation; up/down browses through the changed files. Enter opens the diff of the selected file; inside it you scroll with the arrow keys, PageUp/PageDown, j/k, Space, or Home/End, and Esc returns to the file list. Since version 2.1.198, the open viewer automatically updates when the repository's Git state changes outside the session, for example through a branch switch or commit in another terminal. /diff shows only uncommitted changes and conversation turns, not history across multiple commits, and it does not evaluate the content of the changes. To reset to an earlier state, use /rewind instead, which rewinds code and conversation together.

๐Ÿ”„ THE SAME TASK (โ€œVIEW DIFFโ€) ON OTHER PLATFORMS

Compare all 28 tasks โ†’

โœ… 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 the Git diff and Claude turns using 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: regular 'git diff <ref1> <ref2>' in the terminal for cross-commit comparisons

Wanting changes checked for bugs or security issues in terms of content

/diff only shows the visual difference without evaluating its content.

Better: /code-review for bugs and cleanup, /security-review for security risks.

SOURCES

MORE COMMANDS ยท Claude Code

/doctor/effort/exit/export/fast/feedback/fewer-permission-prompts/focus/fork/goal/heapdump/help

All commands ยท Claude Code โ†’

Share:๐•in๐Ÿ’ฌ