main, or review staged changes before committing — all with syntax highlighting and a navigable file list.
Opening the Diff Viewer
From Source Control
1
Open the Source Control Navigator
Click the Source Control icon in the sidebar or press
Cmd+3.2
Click a modified file
Select any file from the changed files list. Its diff opens in the editor area.
From the Command Palette
1
Open the Command Palette
Press
Cmd+Shift+P.2
Type diff or compare
Filter results to find the comparison you want.
3
Select a comparison
Press
Enter to open it.View modes
Toggle between the two display modes using the button in the toolbar.Unified view
A single-column layout similar to GitHub’s diff display. Both the old and new versions of a file appear in one scrollable column:- Added lines have a green background.
- Removed lines have a red background.
- Unchanged context lines appear without a background.
- Line numbers from both the old and new file are shown side by side.
Side-by-side view
A two-column layout showing the original and modified versions simultaneously:- Left column — the original file.
- Right column — the modified file.
- Corresponding changes are aligned horizontally so you can compare them directly.
Color coding
Navigating diffs
File list
The left panel lists all changed files. Each entry shows:- The file path
- A change summary (
+additions / -deletions) - A status icon indicating the type of change
Use these controls to move through the file list:
Within a single diff
- Scroll to move through the diff.
- Changes are grouped into hunks, separated by context dividers.
- Click a line number to jump directly to that line in the editor.
Comparing branches
When you open a branch comparison, the Diff Viewer shows:- Base branch — the target (e.g.,
main). - Head branch — your feature branch.
- All commits between the two branches.
- The complete unified diff across all changed files.
feature-x vs main.
Integration with Code Review
The Diff Viewer and Code Review work together:1
Review your changes visually
Open the Diff Viewer to confirm the diff is what you expect.
2
Click Code Review
Press the Code Review button in the toolbar. The AI agents analyze the same diff you’re viewing.
3
Read the feedback
Agent output appears in terminal tabs. Address the suggestions, then re-check the diff.