sniff out the wiff in your diff, from the comfort of your terminal
wiff is a terminal-first diff and code-review tool. It captures a diff, lets you browse and annotate it with syntax highlighting, and stores the review as a local session that both a human (in the TUI) and an agent (via the CLI and a skill) can read and write at the same time.
Read the full docs over at https://wezfurlong.org/wiff/
Install straight from the git repository with a recent Rust toolchain, without cloning it first:
cargo install --git https://github.com/wez/wiff.git wiffOr, from a checkout of this repository:
cargo install --path crates/wiffEither way puts the wiff binary on your PATH.
wiff has a rich local code-review model that needs no network access: it captures a diff from your working tree, index, or history, and stores the review -- comments, replies, verdicts, and all -- as a session on your own disk. That makes it a good fit for private review of code that never leaves your machine. On top of that same model, a forge integration mirrors a GitHub pull request into a local session and publishes your review back, so you can review a PR from the comfort of the terminal.
-
Local change review captures a diff and reviews the change it describes: the working tree, the staged index, a branch or revision, or a whole branch back to its fork point. This is the default.
-
Forge review mirrors a GitHub pull request into a local session so you can read and annotate it in the TUI, then publishes your comments, replies, and verdict back to the PR. Pull by number against the repo's forge remote, or by full URL from anywhere, even without a local checkout:
wiff forge pull 6185 wiff forge pull https://github.com/wezterm/wezterm/pull/6185
-
Explore review annotates existing code rather than a change, which is useful when laying out a new task. It opens an empty review and reads a chosen set of files at their current state. Start one with
wiff new --explore, then add files withwiff explore add <PATH>...or the file picker in the TUI.
wiff ships an agent skill that teaches your agent to read and annotate a review
through the wiff CLI. The TUI stays yours; the agent works only through the
command line on the same session.
Install the skill and get its path with:
wiff skill-pathThis expands the bundled skill into your data directory (rewriting each wiff
call to the absolute path of your binary) and prints the path to its SKILL.md.
Point your agent at that file, or copy the skills/wiff-review/ directory into
wherever your agent looks for skills. Once installed, ask your agent to review
the diff or address the existing comments; it discovers the active session for
the checkout on its own.
Start a review from a diff source and open the TUI:
wiff new # the working tree against the current commit
wiff new --cached # the staged index
wiff new --change HEAD # a branch, change, or revision against its parent
wiff new --from-base # the whole branch back to its fork point
git diff | wiff new # a unified diff piped inA plain wiff new pins the base at the current commit, so a commit or amend
you make afterward stays inside the range and wiff refresh shows it. --change
follows a branch or change to its newest commit on refresh, while a bare
revision is held. --from-base takes the base from the configured
base_revision_rules (the merge-base with your upstream by default); --base <ruleset> overrides it with an explicit ruleset, and --base empty reviews the
whole history to the root.
Bindings follow less, with review actions layered on top:
j/kor arrows to scroll a line,space/bto page.g/Gto jump to the top (the review summary) or bottom.,/.previous/next file,[/]previous/next hunk,{/}previous/next comment.tfile picker,Ccomment picker,Ttheme picker./and?search forward/backward,n/Nto repeat.entertoggles a fold,tabtoggles a comment,Hhides all comments,wtoggles line wrapping,Ltoggles the line-number gutter.
Switch the diff layout live (or set diff_mode in config):
1unified: one column with added and removed lines interleaved.2side-by-side: before on the left, after on the right.3after-side only: the resulting file in a single column.4rendered: the after side through a type-specific renderer (markdown today), falling back to the after-side source when there is no renderer.0auto: side-by-side when the terminal is wide enough, unified otherwise.
vstarts a linewise selection; extend it with the navigation keys.cadds a comment on the selection, or on the cursor line with no selection.- On a comment,
rreplies,eedits,xresolves,dwithdraws,asets a verdict. - In the editor,
ctrl-dmoves the body into your drafts andesccancels.
Edits are buffered as drafts and marked as such. ctrl-s saves them to the
session; you are also offered to save on exit.
A session outlives a single sitting so you and your agent can iterate on it.
- Create a review to begin:
wiff new. - Iterate until done: reopen with
wiff resume, capture new changes into the session withwiff refresh(orctrl-rin the TUI), which rebases your comments forward onto the new diff. Because a session stores how to find its base and tip rather than a frozen pair of commits, refresh follows an amend, rebase, or added commit on its own; when the base has moved out from under the review it captures anyway and warns that the starting point shifted. - Remove it when finished:
wiff session rm, or choose Remove session on exit.
List sessions any time with wiff session list. When a repository holds several
sessions, acting commands without an explicit --session resolve the one whose
review matches the branch you have checked out, falling back to the most recent
session when none matches.