Git Diff View
Press Ctrl+G to open or close the git diff view. It shows changed files on the left and the diff on the right. By default the diff shows all changes relative to HEAD (both staged and unstaged); press S to cycle the scope between Both, Unstaged, and Staged. You can navigate hunks, stage and unstage files, create commits, discard changes, queue inline comments, and submit those comments back to the agent as a structured prompt.
Layout
Section titled “Layout”┌─────────────────┬───────────────────────────┐│ Git Diff · Both │ Unified Diff ││ │ ││ ● src/main.rs │ @@ -10,6 +10,8 @@ ││ src/lib.rs │ fn main() { ││ Cargo.toml │ + let config = ... ││ │ + setup(config); ││ │ run(); ││ │ } ││ │ │├─────────────────┴───────────────────────────┤│ j/k move · space stage · S scope · C commit │└─────────────────────────────────────────────┘The file-list header shows the active scope: Git Diff · Both, Git Diff · Unstaged, or Git Diff · Staged. The bottom help bar changes depending on which pane is focused.
Navigation
Section titled “Navigation”| Key | Action |
|---|---|
h / ← | In the diff pane, focus the file list; in the file list, collapse the selected directory |
l / → or Enter | In the file list, expand/open the selected entry and focus the diff |
j / ↓ | Move down |
k / ↑ | Move up |
PageDown / PageUp | Page through the diff pane |
o | Toggle between the diff and the source view of the selected file |
f | Toggle full-file context (show the entire file instead of just the hunks) |
v | Cycle the diff layout: auto, unified, or split |
? | Show help |
r | Refresh the diff |
Esc / Ctrl+G | Close git diff view |
Diff scope
Section titled “Diff scope”Press S to cycle what the diff shows:
| Scope | Comparison | Includes untracked files |
|---|---|---|
| Both (default) | HEAD → worktree | Yes |
| Unstaged | index → worktree | Yes |
| Staged | HEAD → index | No |
The active scope is shown in the file-list header.
Staging and committing
Section titled “Staging and committing”| Key | Action |
|---|---|
Space | Toggle staging of the selected file or directory (stages unstaged entries, unstages staged ones; on a directory, applies to every file beneath it) |
a | Stage all changes |
A | Unstage all changes |
C | Commit staged changes |
C opens a commit-message composer at the bottom of the screen. Type a message and press Enter to commit the staged changes, or Esc to cancel. Git rejects the commit when nothing is staged.
Queued review comments are preserved (and re-anchored) when the diff refreshes or you switch scope, so cycling views never discards your feedback.
Discarding changes
Section titled “Discarding changes”Press d to discard changes to the selected file. A confirmation prompt appears — press y to confirm or n / Esc to cancel. Discard restores the file to its state in HEAD (for tracked files) or removes it (for untracked files).
Inline comments
Section titled “Inline comments”| Key | Action |
|---|---|
c | Add a comment at the current diff location |
e | Edit the comment under the cursor |
x | Delete the comment under the cursor |
Enter | Submit a comment while editing that comment |
s | Submit all queued comments to the agent (from the diff pane) |
u | Undo the last queued comment |
- Navigate to a diff line you want to comment on.
- Press
cto open the comment editor. - Type your comment and press
Enterto queue it. - Add more comments if needed.
- Press
sfrom the diff pane to submit all queued comments.
All queued comments are sent as a single prompt to the agent, grouped by file and including the line number, line kind, line text, and your feedback. This lets the agent understand exactly which changes you’re commenting on.
Use case
Section titled “Use case”The git diff view is designed for reviewing agent-generated changes. After the agent modifies files, open the diff to:
- See exactly what changed
- Stage the changes you want to keep and commit them directly
- Discard changes you don’t want
- Add targeted feedback on specific lines
- Request fixes to particular hunks without describing them in prose