The Diffbench guide

Every feature, organised by what you are trying to do, and what each one is there for. In the app this page is Help → Diffbench Guide; press ? anywhere to jump to the keyboard reference.

If you are deciding whether to run Diffbench at all, start with the overview.


Contents

  1. The three panes
  2. Choosing what to look at
  3. Reading a diff
  4. Reading commits
  5. Watching work as it lands
  6. Worktrees and agents
  7. Searching the code base
  8. Commenting
  9. Reviews
  10. Handing work to an agent
  11. Managing repos and branches
  12. Making it comfortable
  13. URL reference
  14. Keyboard reference

1. The three panes

The header is one row, lined up with the panes beneath it.

WhereWhat it holds
Over the file treeThe repo, with a dot for how it is doing: green when it is watched and indexed, blue and pulsing while it indexes, amber when its folder is missing or its search index is partial. Click it for every watched repo (see §11).
Over the codeWhat you are viewing: Viewing branch … against main, Viewing commit …, Viewing entire code base. A branch's comparison target there is itself a menu. Starred repos sit at its right end, one click away.
On the rightN comments (the comments dock), Review #… (which review new comments join, and everything you can do with it), Hand off (copy instructions for an agent), and the gear for Settings.

On a narrow window the words comments and Review give way and the controls remain. Pages that are not code (the review table, the guide) say what they are in the middle, and have Back to code on the right.

The left pane is the file tree for whatever is on screen — the changed files of a diff, or every file in the repo. It has a path filter, "Expand all" / "Collapse all", and a file count. In a diff, a newly added folder's name and disclosure arrow are green. Folders that already existed stay neutral, even if all their visible changes are added files; filtering does not change that status.

The right pane ("the nav") is how you choose what to look at: the whole code base, your branches, and your saved comparisons. It can be hidden entirely from Settings → Show the branches panel. Search is not here — it is the bar above the code itself (see §7).

Both side panes are resizable by dragging their inner edge, and both remember their width, including zero. Drag a pane all the way to its screen edge to collapse it and focus on the code. A thin divider stays available: drag it back inward to reopen the pane, or double-click it to restore the default width. Focused dividers also support arrow keys (Shift for larger steps) and Home to collapse.


2. Choosing what to look at

Everything Diffbench can show is one of seven views. They all share one URL shape and one endpoint, so anything that works for one works for all of them.

ViewHow to get thereWhat it is for
BranchClick a branch nameThe branch against the default branch, from their merge-base — the same diff a pull request shows. The normal "review this work" view.
CommitExpand a branch, click a commitOne commit on its own.
Commit rangeShift-click a second commit on the same branchThe span between two commits. For when a branch is long and you only care about part of it.
Branch vs branchShift-click a second branch name, or Branch vs branch… at the bottom of the navTwo branches directly against each other, no merge-base. For comparing two attempts at the same thing.
Commit vs commitCommit vs commit… at the bottom of the navTwo arbitrary shas, which need not be on the same branch.
All filesEntire code base at the top of the navEvery file in the repo as it stands on disk right now. Not a diff — this is for exploring. Opens on the repo's rendered README, pinned to the top; the rest of the listing stays collapsed. A repo with no root README opens on a short note instead — how many files there are, how to open or search them, and a few files that usually explain a code base (package.json, Cargo.toml, src/main.rs, AGENTS.md…) to click straight into.
UncommittedThe +adds −dels badge on a checked-out branchWhat has changed in a folder but is not committed. Read-only; see Known limits.

Clicking the default branch shows its files rather than a diff, unless it has an individual comparison-base override.

Choose a comparison base. Each branch has an always-visible branch icon immediately beside its name. Hover to see its effective comparison base and whether it inherits the repository base or has an individual override; click to change it. This replaces the old make-default flag. The branch's ⋮ → Change comparison base... and the comparison label in the view header open the same large comparison dialog. Its scrollable branch list filters immediately as you type, shows the current base, and reports when nothing matches. Select an available row, then apply it. Self-comparisons, missing branches and unchanged choices cannot be applied; disabled rows explain why. Choose Use repository base to remove an individual override. The Base button immediately left of Organize sets the base for all branches and clears individual overrides. These settings are saved and shared across tabs; they never change Git HEAD, check out a branch, or merge anything. Ahead/behind badges remain relative to the repository-wide base.

Branch activity and ordering. Branches automatically start newest activity first, with main pinned at the top even when comparisons use a different default branch. Repositories without main pin their default branch instead. Activity includes the latest commit, uncommitted edits in the repo or its linked worktrees, and branch-message updates (including removal). Observed activity is saved on the server, so becoming clean or reloading does not move a branch backwards. Uncommitted edits are checked separately from loading the list and refresh while the panel is visible, with slower checks paced to avoid overloading large worktrees. Deleted files use the modification time of their nearest surviving directory.

Each row shows its latest activity's date and time immediately before its counts, using the same local-time formatting as commit rows. Hover for the full timestamp and tip commit subject. The date-sort icon switches between newest and oldest activity first; reset restores automatic newest-first ordering. Your choice is remembered across reloads and applies to archived branches too.

Organizing branches and worktrees. Organize, beside the sort controls, temporarily adds checkboxes. Select branches, choose Move to..., and pick an existing section, New section..., Unsectioned, or Archived. Done or Escape removes the checkboxes; normal navigation and commit expansion continue to work during selection. Successful moves clear selection but leave Organize mode on. A branch's More → Move to... also moves one branch without entering selection mode.

Each branch belongs to at most one section; its worktree and uncommitted badges stay attached. Named sections have collapsible headers and counts, with branches sorted by activity inside each. Headers retain their creation order; Archived is always last and starts collapsed. Empty sections disappear automatically. Their More menu offers Rename or Dissolve section, which returns members to Unsectioned without deleting anything in Git. main and the configured comparison base stay outside sections so neither can be hidden. Changing sections does not change activity dates or comparison settings.

Sections and archive membership are repository-wide database state, shared across tabs and retained across server restarts. Collapse preferences stay browser-local. Existing local archive marks are imported once per browser and repository, without overriding subsequent moves, even explicit moves back to Unsectioned. The archive/unarchive button is a shortcut for the same membership system; unarchive returns to Unsectioned. Moves and dissolution offer a ten-second Undo; if another organization change has happened since, Undo refuses rather than overwriting it. Failed moves leave selection intact. Expanding Archived lists every archived branch, with no item-count cap. The branch panel scrolls when needed and keeps its scrollbar visible while there is overflow; focus the panel to scroll with the keyboard. The Copy icon on Branches, Archived, and each custom section copies that section's complete list of branch names, one per line in the displayed order, even when collapsed. Branches copies the unsectioned list only.

Saved comparisons. Any branch-vs-branch or commit-vs-commit view you open is remembered in the nav under Saved comparisons, labelled with which kind it is. The list holds the last 20 per repo and lives in your browser, not the database. When none exist, the section remains empty without an instructional placeholder.


3. Reading a diff

The file tree (left pane) lists the files in the view. Clicking one scrolls to it. Long single-child folder chains are collapsed into one row — src/main/ java/com/example is one line, not five — which matters most in the whole-repo view where every folder in the project is listed.

  • Filter narrows the tree by path; matching folders auto-expand so nothing hides behind a closed folder.
  • Expand all / Collapse all opens or closes every folder and every file block at once.
  • Copy path appears on the hovered row, right-aligned beside the change counts, for folders and files alike. It copies the path as your machine sees it — ~/code/my-app/src/main.rs — so open -R <paste> reveals it in Finder. In a worktree's uncommitted view the path is rooted at the worktree, not at the repo it belongs to.

File blocks are the diffs themselves. Each has a header with the path and:

ControlWhat it does
Copy pathThe file's path to the clipboard.
Comment on this file as a wholeA comment attached to the file, not to a line — for "this whole approach is wrong".
Show every line of this fileExpands from the changed hunks to the entire file, so you can see a change in context. Toggles back.
View sourceOn a markdown file, switches between the rendered document and the raw diff. Rendered is the default because a table or a fenced block cannot be reassembled from independent diff lines.

Linking to lines. Every line number is a link. Click one to select that line; shift-click another to select the span between them. The URL updates to #L120-L134, so what is on screen is always what the address bar says, and Back undoes a selection.

While lines are selected, a small bar appears in the space to the right of the code — where a code line usually leaves the most room — with the range and three controls:

ControlWhat it does
🔗Copy the permalink.
⌘ terminalCopy the link and the selected code, fenced, with the file and view named — so an agent has the context whether or not it can reach the server.
✕Clear the selection (or press Escape).

The bar is pinned to the right edge of the code area, so scrolling a long line sideways does not carry it off screen. The selection tint is mixed with each row's own colour rather than painted over it: a selected added line still reads as added, and a deleted one as deleted.

Line numbers are ordinary links, so the browser's own "copy link address" gives you the permalink without going near the UI.

Commenting on a rendered document. A rendered markdown file takes comments on its own blocks: hover a paragraph, heading or code block for a + in the left margin. The comment is recorded against the source line that block came from, so it is the same record as one made in the source view — visible in both, and re-checked against the file by the same rule when the code moves.

Jumping is exact. With wrapping off (the default) every row is exactly one line tall, so a file's height is known rather than estimated and clicking it in the tree lands where it should. Turning on Wrap long code lines trades that for readable long lines.

Past ~120 files the block list is virtualised — only what is near the viewport is built — with a note saying which slice you are seeing.


4. Reading commits

Expanding a branch lists its commits: the ones it has that the default branch does not, or — when there are none, which is the case for the default branch itself and for a branch already merged — its most recent 30. The list says which of the two you are seeing.

Where the remote is. The commit that this branch's upstream points at is marked (origin) — or whatever the remote is actually called — next to its sha. Everything listed above it has not been pushed, which a list of commits does not otherwise tell you. Branches with no upstream show no marker.

Hover a commit for a small tooltip: the subject in bold, the short sha beneath. Deliberately not the body — a hover is for identifying a commit, not reading it. Commits from before today show just the date (Aug 31); hover it for the time. In a narrow side pane each commit takes two lines — sha and subject, then its line counts, controls and date — so the subject is never squeezed out.

Double-click opens the whole message in a panel you can scroll and select from. Hard-wrapped paragraphs are re-flowed to the panel's width — keeping the source's 72-column breaks leaves orphan words on their own lines — while bullets, quotes, headings and trailers keep their structure.

Stepping through a branch. The ↕ control hands the commit list to the keyboard:

  • The row it is on goes darker, and the list's note line changes to ↑↓ to step · Esc to stop.
  • ↑ / ↓ walk the list, opening each commit as you go.
  • Esc leaves the mode, with whatever commit you stopped on still open.

It exists because reading a branch is a sequence, and clicking each row means aiming at a target that just moved under the cursor. Steps replace the history entry rather than pushing one, so Back still means "before I started reading". The mode ends whenever you leave that commit list — including via Back.

Comfortable message reading. The inline reader has large − / + controls that resize both the title and body, independently of code and other UI text. Your size choice is remembered across commits and browser reloads. The fullscreen control opens a wide reading panel with still larger text and its own scrollbar; its toolbar stays visible while you read. Esc, ✕, or the restore control returns to the inline message without leaving the selected commit. In fullscreen, arrow keys scroll the message instead of stepping through commits; Tab stays within the panel.

Other commit-row controls: copy the sha; the ✉ full-message panel. They appear on hover, sharing the timestamp's cell so they cost the subject no width.


5. Watching work as it lands

A background poll watches each repo's ref state and pushes changes over a WebSocket, so a commit from an agent appears without a refresh.

The refresh pill. If a change lands while you are part-way through writing a comment, the update does not apply itself — it waits behind an Updates available pill at the top of the view. Click it when you are ready. Your draft is never destroyed by something landing underneath it.

When the connection drops. If the live connection to the server is lost for more than a couple of seconds, a banner says so — what is on screen may be out of date — and it goes away by itself once the page reconnects. A New version available banner appears only when the app itself was updated, not every time the server restarts.

Unsaved comments are kept. A comment you are typing survives scrolling far away and back, and reloading the window; only Cancel (or Escape) throws it away.

The uncommitted view watches itself. When an uncommitted view is open it re-fetches on a timer paced by how long the last fetch took, and says so in a banner. It pauses on a hidden tab and while you have a draft open. This is the one thing a ref poll cannot notice — uncommitted work produces no commit — so it has to ask.

First-scan banner. A repo you just added shows an indexing banner in the whole-repo view; the list fills in as the scan goes.

Truncation banner. A change too large to parse in full says so and shows what it got, rather than failing or hanging.


6. Worktrees and agents

A worktree is a second folder of the same repo, on its own branch, at the same time. It is how an agent works on something without disturbing what you have open.

Branches are shared between a repo and its worktrees, so a worktree's branch is already in your branch list. What is not shared is its uncommitted work — and that is invisible from everywhere else. So:

  • Any branch a worktree has checked out is marked with the worktree's folder name, in its own colour.
  • That row carries its own +adds −dels badge for the worktree's uncommitted state, separate from your own folder's.
  • Clicking the badge opens that folder's uncommitted diff, which then watches itself.

Worktrees are not indexed into their parent. Agents routinely create worktrees inside the repo they came from, and a worktree is a second copy of the whole project — walking into one makes a repo's file list mostly duplicates of itself. The walk stops at those boundaries, exactly where git does. Worktrees are still findable: the add-repo picker lists them, labelled with their parent and branch, and GET /api/r/<slug>/worktrees reports every one.


7. Searching the code base

The search bar sits directly above the code, aligned with the left pane's own file filter — start typing there from anywhere, no separate page to reach first. Cmd/Ctrl-K from anywhere jumps straight into it.

  • Substring matching. serId finds getUserById. Three characters minimum.
  • Case and Whole words toggles.
  • Path filter to narrow to a subtree.
  • Results are grouped by file with the matching lines shown; clicking one opens that file and scrolls to the line.
  • Results re-run themselves when the index changes, so what is on screen stays current while an agent edits files underneath it.
  • Escape, or the close button at the right of the bar, backs out of the results to the whole code base view — the query is cleared, not just hidden.

Results are ranked by kind before relevance — source above prose above generated output — because a repo holding captured logs will match any query thousands of times and bury what you were looking for. Nothing is hidden; logs and lockfiles just sort lower.

This is for exploring a code base, not for reading diffs.


8. Commenting

Hover any diff row for a + in the gutter; click it to comment on that line. The file block header has a control for commenting on the file as a whole.

Anchoring. A comment records the text of the line it was written on, not just its number. When history is rewritten underneath one, the text no longer matches and the comment is flagged orphaned — shown, with what it was originally written against — rather than silently re-pinned to a line that has nothing to do with it.

On a comment:

ControlWhat it does
EditChange the text.
DeleteRemove it.
Mark resolvedA done-with-it flag. Resolved comments stay visible and stay in the review.

The comments dock (the header's N comments button) lists every comment on the current view, with Copy as Markdown at its top — for pasting into a chat with an agent that is not using the review API.

Comments are per view: a comment on a branch stays with that branch, and does not vanish the moment a commit lands on it.


9. Reviews

A review is a durable, addressable collection of comments, with a stable id.

Comments collect automatically. Whatever review is active for the current view is the one new comments join. The header's Review button shows which: Review #1787762, or Review none. Click it for:

ItemWhat it does
Open in the review tableThis review in the table, or the list of reviews if none is active.
Start a new reviewThe old one is kept; new comments go to the new one.
Stop collectingStop new comments joining, without deleting anything.
Reviews of this viewEvery past review of the same view; pick one to collect into it again.

Hand off, beside it, copies the agent instructions. With no review collecting yet it starts one first, so it works either way; with one, it asks for your decision (approve, approve after addressing, request changes) and puts it in the instructions.

The review table shows each comment as a row: the code it was written against, the comment, and the thread of replies. Threads are where an agent's responses land, each linked to the commit that addressed it. A review can be archived (a status on the review itself, separate from branch-section membership), and two reviews can be merged into one.

Drag any vertical column divider anywhere down the table to make that column wider or narrower; the other columns keep their widths. Double-click a divider to reset it, or focus it and use Left/Right (Shift for larger steps). Widths are remembered across reloads.

The left review list keeps recent reviews larger and easier to read. Reviews older than a week sit in Earlier, collapsed by default with a count; click it to expand or collapse the full list. Your choice is remembered.

The table's density is adjustable independently of everything else — see Display.


10. Handing work to an agent

Hand off in the header copies a block of instructions to paste into an agent. It contains the review id and everything the agent needs to act on it. If no review is collecting yet, it starts one first, so there is always something to hand over.

The agent's side of the contract is docs/agents.md — how to fetch a review, reply to one row or to every row at once, where to commit each fix, and how to link a reply to the commit that addressed it. The running server serves the same file at /api/docs/agents, so it cannot drift from the API the agent is actually calling.

Two conventions worth knowing, because they are what make the handoff work:

  • Report finished work by linking to a commit or branch, never by describing an uncommitted diff in prose and never by linking the uncommitted view — its content changes on the next keystroke, so there is nothing stable to review.
  • Every view is a URL. /<slug>/b/<branch>@<sha> is a complete instruction for "look at this".

11. Managing repos and branches

The first time, before anything is watched, the window lists every git repo under your code folder, each with a Watch button. Agent worktrees are left out of that list; each shows up on its own branch once its repo is watched. In the app, Change folder… there opens Settings.

Repos. The repo's name, top left, opens the list of every repo being watched. Each row says how that repo is doing — its file count once indexed, Indexing 40% while it is being read, search is partial when it is too big to index whole, Folder not found when it has gone — and hovering the status says more. Click a repo to switch to it; the star keeps it one click away in the header; × stops watching it (nothing on disk is touched, and its comments and reviews are kept).

Add a repository… lists every git repo under your code folder, worktrees included, with a filter. Repos already watched stay in the list, ticked, so it also answers "which of these am I watching?". Watch adds one at once. Change code folder… opens the app's settings, and Connect a machine over SSH… watches repos on another machine.

What watching costs. An idle repo costs nothing: macOS reports each change as it happens, so nothing is polled. The work is indexing a repo for search, once when it is added and then only what changes. Each repo's index stops at 200,000 files or 512 MB of text and skips files over 1 MB; past that, search covers part of the repo and the list says so, while browsing and diffs are unaffected. There is no limit on how many repos you watch. (The Linux kernel, 97,000 files, indexes in about two minutes and ends partial at 89,000.)

A repo whose folder has gone — a moved checkout, a drive that is not plugged in — stays in the list, marked Folder not found. Its comments and reviews are kept and readable, and opening it says plainly that the code cannot be reached. Nothing needs doing: Diffbench looks for the folder every half minute (and straight away when you open the repo), and picks it back up when it returns. One unreachable repo no longer stops the others, or the app, from starting.

Branches. Each branch row shows:

  • its name, with HEAD if it is checked out in this repo's own folder;
  • how many commits it is ahead and behind the default branch, as ↑3 ↓1;
  • an uncommitted badge if it is checked out somewhere;
  • a worktree marker if a worktree has it.

Branch intent. The branch's up/down-arrow control opens its purpose in the same reader as a commit message, with a large title, Context (what the user wanted when the branch or worktree was started), and Definition of done (the agent's expected outcomes and verification). Text sizing is shared with commit messages, including remembered sizes and fullscreen reading. The edit control offers separate fields for all three sections, with Save, Cancel, and Remove. Older descriptions stay visible as context; missing completion criteria are explicitly marked as not recorded rather than guessed.

Context and Definition of done support Markdown, including lists, emphasis, code blocks, tables, and labelled links. Bare web and file:// URLs also become links. Links open in a separate tab; your browser may block local-file links from a web page. Editing preserves the original Markdown source.

ControlWhat it does
CopyThe branch's name.
ArchiveMoves the branch into the collapsed Archived section — the same membership as Organize → Move to… → Archived, shared by every window. Nothing in git is deleted.
More → Push to remote & deleteA real push, then a local delete. Confirms first. Uses the same SSH agent your terminal does.
More → Delete without pushingLocal delete only. Confirms first, and says plainly that unpushed commits are gone.

12. Making it comfortable

The gear on the right of the header opens Settings. Everything here is remembered on this Mac (per browser, if you open Diffbench in one). Its last two lines open the app's own settings (code folder, indexing, agents; also ⌘,) and this guide.

Appearance — System / Light / Dark, Wrap long code lines (off by default; off is what makes jumping to a file land exactly) and Show the branches panel.

Text size — three independent controls, because they scale different things:

ControlWhat it scales
Code textEverything that is file content: diffs, file listings, and rendered markdown documents. Nothing else on the page changes size. Goes from 10px up to 32px.
Side panelsFile names, branch names and recent review entries in the side panes.
Review tablesText in the review table.

Each scales its line height with its font size, so the largest setting is not cramped and the smallest is not airy.

Review table — Message width and Row height, for trading rows on screen against readability in a long review.

Reset sizes puts every size control back to its default.

Pane widths are dragged, not set here, and are remembered separately.

Updates and supporting Diffbench are in the Diffbench menu.

  • Check for Updates… looks for a newer version. Diffbench also checks once a day, and always asks before installing. Settings → General turns the daily check off.
  • Support Diffbench… Diffbench is free, with every feature and no trial. If you pay for a supporter license, paste its key here; the window can also remove the key from this Mac, to use it on another. Nothing in the app depends on a key, and this window never opens by itself.
  • Help → Third-Party Notices lists the open-source software Diffbench includes.

13. URL reference

Every view is a URL. These are the shapes:

/<slug>                                  the repo's default view
/<slug>/files                            every file, as it is on disk
/<slug>/files/<path>                     one file, scrolled to
/<slug>/files/<path>#L12-L34             a span of lines in that file
/<slug>/b/<branch>?f=<path>#L12-L34      a span of lines within a diff
/<slug>/b/<branch>                       a branch vs the default branch
/<slug>/b/<branch>@<sha>                 one commit
/<slug>/b/<branch>@<from>..<to>          a span of commits
/<slug>/c/<sha>                          one commit, no branch context
/<slug>/compare/<base>...<compare>       two branches
/<slug>/tree/<ref>                       every file at a ref
/<slug>/uncommitted                      this folder's uncommitted changes
/<slug>/uncommitted/<worktree-path>      a worktree's uncommitted changes
/<slug>/search?q=<query>                 code search
/<slug>/reviews                          the review table
/<slug>/reviews/<id>                     one review

14. Keyboard reference

KeyWhereWhat it does
Cmd/Ctrl-KAnywhereJump to code search.
?Anywhere but a text fieldOpen this guide at the keyboard reference.
↑ ↓While stepping a commit listMove to the previous / next commit.
EscWhile steppingLeave the mode, keeping the commit open.
EscIn a comment composerCancel the draft.
EscIn a popoverClose it.
Double-clickA commit rowOpen its full message.
Shift-clickA second commit on one branchThe range between them.
Shift-clickA second branch nameDiff the two branches.
ClickA line numberSelect that line, and put it in the URL.
Shift-clickA second line numberSelect the span between them.
EscWith lines selectedClear the selection.

Arrow keys always belong to a focused text field first — stepping yields to a caret.


Known limits

  • The uncommitted view is read-only. Content that can differ on the very next request is not a stable enough thing to anchor a comment to — a much worse version of the history-rewrite problem anchoring already solves. It is for watching, not for line-by-line review.
  • A very large uncommitted diff is capped, and says so. Past the configured limits it stops early and shows what it parsed.
  • Search needs three characters (two with unicode61), and covers indexed files only — binaries and anything over REVIEWPP_INDEX_MAX_FILE_MIB are listed but not searchable.
  • Syntax highlighting is per line. A construct spanning lines (a block comment, a triple-quoted string) will not colour as a unit — inherent to highlighting a diff rather than a file.
  • Saved comparisons are per-browser, in localStorage: a window of the app and a browser tab keep their own. Branch sections, archived branches and archived reviews are in the database and shared.
  • Push-and-delete needs your ssh agent. The app takes SSH_AUTH_SOCK from your login shell; if ssh-add -l says "no identities", that one action fails and nothing else is affected.
  • .gitignored files are not indexed, so they do not appear in the whole-repo view or in search.
  • Symlinks are listed but not followed. They appear as files, as git shows them; their targets are indexed in their own right if they are inside the repo, and not reached at all if they are outside.
  • A merge commit is shown against its first parent — "what did merging this bring in" — not as a combined diff.
  • A very large committed diff is capped too, not only the uncommitted one. Opening the initial commit of a large repository shows what fits and says so.