dv
A terminal diff viewer for reading and reviewing pull requests, with Helix keys, rust-analyzer, and GitHub review comments.
- Diff: unified or side-by-side (
Ctrl-w v), syntax highlighted, changed words emphasised, context expandable per hunk (+/-,Zfor the whole file). - Helix-style: the cursor/selection model, motions (
w b e,f t,gw,mm, …), and your Helix theme,cursorline,line-number, andjump-label-alphabet. - rust-analyzer:
gd/gr/gy/giand hover (Space k) from the diff. - GitHub: the PR's description, conversation, checks and review threads inline, rendered like github.com. Comment on selected lines, suggest changes, reply, edit, delete, resolve, mark files viewed, and submit reviews.
Install
Or download a binary for Linux or macOS from the
releases, or build from a checkout with
cargo install --path ..
Needs git. For PRs: gh, logged in (gh auth login).
Optional: rust-analyzer (go to definition, references, hover), hx (opening files and
writing comments; $VISUAL/$EDITOR is used for comments if set), xdg-open/open
(opening links). Inside zellij, editors open in floating panes.
Usage
# Tab lists the PRs you have worktrees for
On a branch with an open PR, plain dv loads it too.
Press ? in dv for every key (/ searches the list). SPEC.md has the full key
table and design notes.
Reviewing a PR
dv 2258(ordv 2258 -wto keep your checkout as it is).- Read:
]g/[ghop between hunks,]f/[fbetween files,Space fpicks a file,Space tlists the threads.Space vmarks a file viewed and moves on. - Comment: select lines (
x,v), thencto comment orsto suggest a change. On a thread,rreplies (quoting the comment under the cursor). These go into your pending review;Space plists them. - Submit:
S, then Comment / Approve / Request changes.
C posts a comment immediately instead of adding it to the review. Space e / Space d
edit / delete a comment, Space r resolves a thread, gf opens a link, R refreshes.
Reviewing with Claude Code
Claude Code writes a review, and dv shows it inline next to the lines it's about. You reply to Claude from dv, Claude answers (or changes the code), and you copy the comments you agree with into your GitHub review. The two talk through a review file that dv reloads whenever it changes, so you can keep dv open while Claude works.
Setup (once): dv install-skill installs the dv-review skill to
~/.claude/skills/dv-review/. Restart any running Claude Code session so it picks it up.
-
Get the PR:
dv 2258 -w(ordv list -w, then Enter). -
Ask for a review: press
Space ain dv and pick "Ask Claude to review this".$EDITORopens for anything it should focus on; leave it empty to just go. (Or, in Claude Code in that checkout, ask it to "review this PR for dv".) Inside zellij, Claude Code opens in a floating pane, where you can watch it and approve what it asks to do; elsewhere it runs in the background, allowed to edit files and run only thedv review-*and read-onlygitcommands it needs, and the status bar says when it's done. It runsdv review-info(the review file's path, and the base commit:git diff <base>is the diff dv shows), writes its review, and runsdv review-check, which checks every line reference against the diff and records the commented code. -
Read it in dv: Claude's summary sits in the top section; its comments are threads by claude under their lines (
]c/[cto step through them,Space Alists them). -
Act on each comment:
Key ccopy it into your pending GitHub review (edit it in $EDITOR, or keep it as is)Csame, but post it now rreply to Claude: it answers right away, in the background (nothing goes to GitHub) Space rresolve it, so Claude leaves it alone Space ddismiss it A comment copied to GitHub is removed from the review file, so it doesn't show twice.
-
Claude answers: as soon as you reply, Claude Code answers in the background, resuming the same session each time so it keeps the review in mind; its answer shows up under your reply ("Claude is answering…" meanwhile). Replies you write while it's busy are answered in one more run. (
Space a→ "answer your replies", or asking Claude Code to "answer my dv replies", does the same by hand.) For each unresolved comment where you spoke last, it replies, or makes the change you asked for and says what it changed. Its answers appear in dv as it writes them. Repeat 4–5 as needed. -
Have Claude make the changes (optional):
Space a, "Ask Claude to make the changes". You can add your own instructions in$EDITORfirst (leave it empty to just go). Claude makes the change each open comment asks for (not the resolved, dismissed or outdated ones), replying on each with what it changed; those comments then show as outdated. Check the changes, then resolve. -
Submit:
Ssubmits your pending review, holding whatever you queued withc. Claude never posts to GitHub; only you do, from dv.
When the code changes (Claude's edits, yours in hx, a new push), Claude's comments follow
their code: one whose lines moved moves with them; one whose code changed or is gone shows
[outdated], folded and dimmed near its old line, and can't be copied to GitHub. Claude
re-anchors outdated comments that still apply when it next runs dv review-check.
Good to know
- The review file is
.git/dv/reviews/pr-<N>.json(branch-<name>.jsonwithout a PR): never committed, and shared by the repo's worktrees. A new review replaces it (the skill keeps comments that still apply, with your replies). - It works on a local branch before there's a PR, but
c/Cneed one. - Like dv's own comments,
c/Cneed the checkout at the PR head with no local changes. While Claude's changes are uncommitted you can reply and resolve, but copy comments to GitHub only once they're pushed.
Layout
| File | |
|---|---|
src/main.rs |
arguments, PR checkout, worktrees |
src/diff.rs |
git diff parsing, hunks, word diffs |
src/list.rs |
dv list: the open-PR picker |
src/claude.rs |
Claude review files: format, checks, replies |
skills/dv-review/ |
the Claude Code skill (dv install-skill) |
src/gh.rs |
GitHub via gh: PR info, threads, review mutations |
src/lsp.rs |
a minimal rust-analyzer client |
src/highlight.rs |
syntect highlighting mapped to Helix scopes |
src/md.rs |
GitHub-flavoured markdown rendering |
src/theme.rs |
Helix theme and settings |
src/view/ |
the TUI: state (mod.rs), keys, motions, rendering, review actions, rust-analyzer |
cargo test runs the tests.
License
MIT or Apache-2.0, at your option (LICENSE-MIT, LICENSE-APACHE). Releasing: RELEASING.md; changes: CHANGELOG.md.