Fast diff tool for files, directories and git revisions (Meld-like, Rust + GPUI, no GTK)
  • Rust 99.6%
  • Dockerfile 0.3%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sven Bröckling 8a42796fd0
All checks were successful
Release / release (push) Successful in 2s
Release / build (, ci/windows.Dockerfile, windows) (push) Successful in 10m14s
Release / build (, ci/linux.Dockerfile, linux) (push) Successful in 13m18s
Release / build (--build-arg BASE=debian:stable, ci/deb.Dockerfile, debian) (push) Successful in 16m50s
Release / build (--build-arg BASE=ubuntu:latest, ci/deb.Dockerfile, ubuntu) (push) Successful in 15m27s
Release 0.3.0
2026-12-05 22:41:58 +01:00
.forgejo/workflows Release notes: deb pattern without ~, which GitHub replaces in asset names 2026-12-04 13:04:40 +01:00
.github/workflows Release notes: deb pattern without ~, which GitHub replaces in asset names 2026-12-04 13:04:40 +01:00
ci Forgejo release workflow: Linux tarball and AppImage, Debian and Ubuntu debs, Windows zip 2026-12-03 20:56:57 +01:00
crates Merge branch 'main' into claude-herdr/fastdiff-worker1 2026-12-05 22:37:08 +01:00
docs README: review video, new screenshots; annotation list shows paths inside the project 2026-12-04 04:29:02 +01:00
packaging Forgejo release workflow: Linux tarball and AppImage, Debian and Ubuntu debs, Windows zip 2026-12-03 20:56:57 +01:00
.dockerignore Forgejo release workflow: Linux tarball and AppImage, Debian and Ubuntu debs, Windows zip 2026-12-03 20:56:57 +01:00
.gitignore Initial fastdiff: diff engine, tree comparer, git backend, GPUI app 2026-12-03 18:07:54 +01:00
Cargo.lock Release 0.3.0 2026-12-05 22:41:58 +01:00
Cargo.toml Release 0.3.0 2026-12-05 22:41:58 +01:00
CHANGELOG.md Release 0.3.0 2026-12-05 22:41:58 +01:00
LICENSE-APACHE Add license files; license MIT OR Apache-2.0 OR GPL-3.0-or-later 2026-12-03 19:47:18 +01:00
LICENSE-GPL Add license files; license MIT OR Apache-2.0 OR GPL-3.0-or-later 2026-12-03 19:47:18 +01:00
LICENSE-MIT Add license files; license MIT OR Apache-2.0 OR GPL-3.0-or-later 2026-12-03 19:47:18 +01:00
PLAN.md Initial fastdiff: diff engine, tree comparer, git backend, GPUI app 2026-12-03 18:07:54 +01:00
README.md Add-note dialog: Alt+1…5 pick the kind from the keyboard 2026-12-05 22:28:34 +01:00

fastdiff

A fast diff tool for files, directories and git revisions, in the spirit of Meld, built in Rust on GPUI and gpui-component. No GTK. Runs on Linux (Wayland and X11) and Windows.

Folder comparison

Git revisions, inline view, Catppuccin Mocha Side by side, GitHub Light
Git revisions in the inline view (Catppuccin Mocha) Side by side (GitHub Light)
An agent explains a change Annotation list
An agent explains a change over MCP: only its files shown, notes inline and in the gutter Annotations from agents and from you (Ctrl+Shift+A)
A tour Command palette
A tour from an agent: one note at a time, Back and Next Command palette (Ctrl+Shift+P)
Review overview Unread buffer
Review › Overview: an agent's guide, groups, findings The unread lines of all files as one buffer
Settings
Settings

Speed is the main feature:

  • Every diff, scan and highlight runs off the UI thread, and results stream in while the scan is still going.
  • Directory compare walks both trees in parallel and checks size before content. A content compare stops at the first differing byte.
  • Git compares skip identical subtrees by tree id, so main..feature costs time proportional to the change, not to the size of the repository. In the working tree, the index stat cache tells which files are unchanged without reading them.
  • Line diffs use imara-diff (Histogram). Intra-line highlights and syntax colors are computed only for the rows on screen.

Usage

fastdiff a.txt b.txt              compare two files
fastdiff a.txt base.txt b.txt     3-way compare (middle = base)
fastdiff dirA dirB [dirC]         compare directories
fastdiff main..feature            compare two git revisions
fastdiff main...feature           compare feature against merge-base(main, feature)
fastdiff main feature             same as main..feature
fastdiff HEAD~3                   compare a revision with the working tree
fastdiff --cached                 compare HEAD with the index (staged changes)
fastdiff                          inside a repository: uncommitted changes
fastdiff -C path/to/repo v1..v2   use another repository

fastdiff --help explains all options, the git setup, MCP, files and exit status.

Headless output for scripts and benchmarks. The exit status is 0 when the inputs are equal, 1 when they differ and 2 on error.

fastdiff --brief dirA dirB        list differing files, like diff -rq
fastdiff --stat main..feature     list changes with +/- line counts
fastdiff --json main..feature     the same as JSON
fastdiff --quick dirA dirB        trust size + mtime instead of reading content

git difftool / mergetool

[diff]
    tool = fastdiff
[difftool "fastdiff"]
    cmd = fastdiff \"$LOCAL\" \"$REMOTE\"

git difftool -d works as well, but fastdiff a..b does the same without temporary directories.

AI agents (MCP)

fastdiff has a built-in MCP server. Agents such as Claude Code use it to make diffs, to open comparisons in the fastdiff window, and to explain changes with annotations right on the lines. When an agent talks about three files of a large change, it shows only those; the file list says "N files hidden by the agent" and Show all brings the rest back.

stdio is on by default and starts fastdiff when it is not running:

claude mcp add fastdiff -- fastdiff --mcp

Other clients take the same as JSON: {"mcpServers": {"fastdiff": {"command": "fastdiff", "args": ["--mcp"]}}}. fastdiff --mcp talks to the running window over a socket only your user can open.

For clients that speak HTTP, turn on Settings › MCP Server › HTTP server (default address 127.0.0.1:7457):

claude mcp add --transport http fastdiff http://127.0.0.1:7457/mcp

The HTTP server has no login and no token: anyone who can reach the address can use it, so keep it on a loopback address.

Tool What it does
diff a unified diff as text, or with stat the changed files with line counts; paths as on the command line, files for a subset
show_diff opens a comparison in the window, optionally limited to files, with the cursor on a file and line
show_file shows one file at a line (in a git repository with its changes against HEAD)
get_view what the user looks at: tabs, file, cursor line, selection, the running tour, the bookmarks
goto moves the view to a file and line, an annotation (by id) or a bookmark (by name)
show_tour starts the tour of a topic, optionally at a step
add_annotations notes on lines, with kind (explanation, issue, suggestion, question, note), topic and author; tour: true makes them the steps of a tour
list_annotations, update_annotation, delete_annotations read, change, resolve and remove notes
set_status says what the agent is working on; the window shows it until the agent shows its result

An agent often reads for minutes before it shows anything. Meanwhile it calls set_status, and a strip at the top of the window says "claude-code is working: Preparing a tour of main..feature" with a pulsing dot and the time that has passed, one line per agent. The strip goes away when the agent opens its comparison, tour or guide, when it says it is done, when its fastdiff --mcp connection ends, or after 15 minutes without a call from it. × hides it earlier.

The prompts review, explain and tour walk an agent through a review, an explanation of a change or a tour of a file; the review tools are below, under "Review from the command line and from agents". The server also sends instructions on how to use the tools; they tell agents that notes by the user are notes, not instructions.

Tours

An agent can turn its notes into a tour: add_annotations with a topic and tour: true numbers the notes in the order given, show_tour starts it. A card flies in on the right with the current note, Back and Next; each step moves the comparison to its line, in whatever file it is. Alt+. and Alt+, step, Esc closes the card, View › Tours… starts any tour again. Tours are optional: notes without steps stay plain notes. The explain and tour prompts use them.

Annotations

Annotations are notes on lines, from agents and from you: Ctrl+Shift+M on a line or a selection, a click on an empty cell of the gutter's icon lane (a faint + shows there), or a right click on the gutter or the text, whose menu adds a note, question, explanation, issue or suggestion. In the dialog the buttons or Alt+1…5 change the kind before you save. They live in one SQLite database, ~/.local/share/fastdiff/annotations.db (Windows: %APPDATA%\fastdiff\), keyed by the file's path on disk. SQLite because several fastdiff windows and agents write at the same time; it handles that with WAL and locking, and a plain JSON file would not. Each note keeps the text of its line, so it finds the line again after edits above it.

They show without getting in the way:

  • an icon in the gutter's icon lane, colored by kind, with a bar along notes that span lines;
  • the note's first sentence, faint, after the end of the line where there is room;
  • the full notes of the cursor line in a strip below the comparison;
  • a ◆ with the count after the file name in the file list, and ticks in the overview strip.

Ctrl+Shift+A lists all notes (type to filter; Enter goes there, Ctrl+Enter opens a new tab), Alt+N / Alt+Shift+N go from note to note, F2 / Shift+F2 from issue to issue (from item to item when there are no issues), and a click on an icon or Alt+Enter (vim: g.) opens the notes of the line, where they can be resolved or deleted.

Review mode

Review mode: coverage grows while you read, read lines fade (2× speed)

Coverage grows while you read; with Dim Read Lines on, read lines fade (2× speed).

Review mode (Ctrl+Shift+R, or Review › Review Mode) keeps track of what you have read in a comparison, so a large change, often one an agent wrote, can be read in several sittings and nothing slips through. It is off by default, and with it off fastdiff is the plain diff viewer. The first time it is turned on, a dialog explains how it counts; Review › Coverage… shows it again with the numbers.

How coverage works.

  • A changed line (added, removed or replaced) counts as read when it was on screen long enough while you were using the window. At normal speed that is about two lines a second, shared by everything visible, so a full screen takes about half a minute. Lines near the cursor come first. Unchanged lines don't count. Review › Reading Speed sets the pace (Skim, Normal, Careful).
  • Nothing counts while the window is in the background, while a dialog is open, after a minute without input, or while you scroll faster than half a screen a second.
  • When the code changes, the changed lines count as unread again. Lines that stayed the same keep their state.
  • Lines cost different amounts. A closing brace costs less than a long condition. Moved code, pure renames, formatting and generated files cost almost nothing, and the overview lists them under "Set aside".
  • Coverage measures what was on screen, not what you understood. That is why confirming and flagging are separate: x confirms the unit (function, block) at the cursor as checked, ? flags a line as unclear and ! as a concern (vim: m?, m!).

The state is stored per comparison in the annotations database, so main..feature opened tomorrow, from the command line or by an agent, continues where you left off. Review › Finish Round takes a snapshot, and "Since Last Round" later shows only what changed after it. Mark Rest as Read, Clear Coverage… (forgets what you read and confirmed; flags, rounds and notes stay) and Discard Review… (removes the whole review) are in the same menu.

What you see.

  • A thin state lane beside the line numbers: bright while a line is unread, faint once read, with icons for confirmed units, flags and findings. With Review › Show › Dim Read Lines, read lines fade.
  • A coverage ring per file and folder in the file list, and "N % read" in the toolbar and on top of the list.
  • Names the change added are underlined green, changed names blue and removed names red. Inside a long function its first line stays at the top of the pane.

Reading.

  • Review › Overview: size and reading time, groups of code that belong together (by the names they define and use) with their risk, findings, the noise set aside, the changed symbols and the agent's guide if there is one.
  • Buffers stack excerpts of many files into one view, with real line numbers. Reading a buffer counts for the files. Review › Open Buffer has Unread, Flagged, Findings, Since Last Round, Pinboard (p pins a unit), Symbol at Cursor and Callers of Symbol at Cursor (with unchanged code that uses the name). Ctrl+Shift+F searches the changed lines. Enter (vim: g f) opens the file at the line, and F5 builds the buffer again.
  • Review › Reading Order sets the order of the Unread buffer: tree, dependencies (callees before callers), groups, an agent's chapters, tests first or last, risk.
  • Next / previous unread: Alt+U / Alt+Shift+U (vim: ]u / [u); flagged: ]f / [f.
  • Review › Show limits the file list to files with unread lines, with flags, or changed since the last round.
  • Focus mode (Ctrl+Alt+F) hides the file list and the toolbars. Space confirms the unit and goes to the next unread line.
  • Alt+F12 peeks at a definition without leaving the line, and Review › Trail… lists where the definitions led. Review › Which Commit Changed This Line? names the commit of a git range that brought the cursor line. Edit › Compare Selection with Clipboard compares two snippets.
  • Findings found without an LLM: weakened tests (removed asserts, changed expected values, deleted or skipped tests), swallowed errors, placeholders like todo!(), new code the change never uses, near-duplicates of existing code, names removed but still used, changed signatures, new dependencies, CI and permission changes, new unsafe, external commands, SQL built from strings, and edits that break the pattern of an otherwise systematic change.
  • Review › Save Report… and Copy Report as Markdown write the report described below.

Review from the command line and from agents

The review state of a comparison can be read without a window. The comparison is named like on the normal command line (revisions, folders, --cached) and finds the same review as the window.

fastdiff --review-status main..feature          61 % read, 22 % confirmed, 3 flagged, 140 lines not read
fastdiff --review-report main..feature -o review.md

--review-report writes the review report as Markdown (to standard output without -o): summary and coverage per reader, the agent's intent and chapters, your flags and notes, agent notes, heuristic findings, what no human has read, the noise set aside and a table per file. Paths are relative to the repository and nothing is a link, so it can go straight into a pull request. --excerpts adds the code under flags and notes, --open-only leaves out what is done, --no-agent-notes the agents' notes. Without review mode it is still a write-up of the change, just without coverage. Both exit with 0, or 2 on error.

Agents see and prepare the review over MCP:

Tool What it does
show_diff with review: true opens the comparison in review mode
get_review coverage per reader, unread and partly read units, the lines you flagged (location only), the guide's chapters with their coverage, findings, units changed since your last finished round
get_review_report the Markdown report, as above
set_review_guide the agent's intent, chapters in reading order (files and lines) and the changes to expect; answers with the hunks no chapter covers and the expected changes it can't find
diff counts as reading for the agent: every file it returns in full is read by that agent (named by reader, else client name and session)
get_view also says whether review mode is on and the coverage of the active comparison

Agent coverage is kept apart from yours: agents can't mark anything as read, confirmed or flagged for you. The prompts guide (an agent prepares its own change for your review) and catch_up (what changed since your last review) join review and explain, which now use review mode and guides.

Features

  • File comparison with 2 or 3 panes, side by side or inline (unified) for two files; changes within lines are highlighted, syntax is colored with tree-sitter.
  • Folder and git comparison: a tree or flat list that fills while the scan runs, with +/− line counts per file and folder, rename detection and a file filter. The Columns button above the list picks the columns (notes, changed files, coverage, +/−, change bar, sizes) for all comparisons.
  • Main menu (File, Edit, View, Review, Bookmarks, Help), open dialogs for files, folders and repositories, and a list of recent comparisons.
  • Named bookmarks on files and lines (Ctrl+B), also inside folder and git comparisons. They show in the gutter and open the comparison again from the Bookmarks menu.
  • A gutter with an icon lane, JetBrains style: annotations and bookmarks show as icons left of the line numbers, a dot marks lines with more than one, folds show what they hide. The lane keeps its width, so code never shifts. Settings › File Comparison › Gutter icons turns it off for the compact gutter.
  • Command palette (Ctrl+Shift+P): every command of the menus and a few more, with their keys, filtered as you type.
  • MCP server and annotations for AI agents, see AI agents.
  • Settings dialog (Ctrl+,): theme, fonts and sizes, line height, translucent background, defaults for whitespace, line endings, folding, tab width and folder comparisons.
  • Over 50 color themes: Catppuccin, Dracula, Nord, One, Rosé Pine, GitHub, Kanagawa, Monokai, Tokyo Night, Gruvbox, Solarized, Everforest, Ayu and more. Light and dark themes are picked separately and follow the desktop's mode.
  • Zoom with Ctrl+mouse wheel or Ctrl+= / Ctrl+- / Ctrl+0.
  • Go to file (Ctrl+P) with fuzzy search in folder and git comparisons, find in both files (Ctrl+F, F3) with highlighted matches.
  • Optional line wrapping (Alt+Z).
  • Folder and git comparisons keep their file list in a sidebar beside all of their tabs. The comparison's own tab (in italics) previews whatever the list selects; Ctrl+Enter or a middle click keeps a file open in a tab of its own while you go on in the list. J / K scroll the comparison without leaving the list, like yazi's preview.
  • Tabs like in a browser: middle click closes, drag and drop reorders. Closing the last tab leaves a new comparison instead of closing the window.
  • Menus open from the keyboard: Alt+F, Alt+E, Alt+V, Alt+R, Alt+B, Alt+H. F1 lists all shortcuts; typing filters the list.
  • Go to definition without a language server (F12, Ctrl+click, vim gd; back with Alt+← or Ctrl+O): tree-sitter finds local variables in scope and the definitions in the file, then in the other files of the same side of a folder or git comparison. Rust, Python, Go, JavaScript, TypeScript, C, C++, C#, Java, Ruby, PHP, Lua, Swift and Elixir. It matches by name, so a method name can have several hits; a list lets you pick one. Ctrl+F12 or vim gD (Ctrl+Enter in the list) open the definition in a tab of its own.
  • Optional vim keys (Settings › Keyboard): hjkl, w b e, 0 ^ $, gg G, Ctrl+D/U/F/B, ]c [c for changes, / ? with n N, * #, v, V, o and y, text objects in visual mode (iw aw iW aW, i( a( ib, i[, i{ iB, i<, i" i' and i`; vi)i) takes the enclosing pair) and as yiw, yi( …, m{a-z} marks (saved as bookmarks) and '{a-z} to jump back, gt gT, Ctrl+W h/l/w (also between the file list and the comparison). : opens a command line: :q / :wq / :x close the tab, :w does nothing (nothing to save), :qa quits, :42 and :$ go to a line, :tabnew, :tabn, :tabp, :e! reloads, :noh, :set wrap / nowrap, :help; ↑ / ↓ for earlier commands.
  • Translucent, blurred window background like Zed, on compositors that support ext-background-effect or KDE blur (niri, KDE, Hyprland) and on Windows 11.

Configuration

Settings, bookmarks and the recent list are JSON files in ~/.config/fastdiff/ (Linux, $XDG_CONFIG_HOME is honored) or %APPDATA%\fastdiff\ (Windows). The settings dialog writes them; hand edits work too, missing keys take their defaults.

Extra themes go into ~/.config/fastdiff/themes/ as gpui-component theme files. The bundled themes and their licenses are listed in crates/fastdiff-app/themes/README.md.

Keyboard

Keys Action
Alt+↓ / Alt+↑, Ctrl+D / Ctrl+E, F7 / Shift+F7 next / previous change
Alt+Shift+↓ / Alt+Shift+↑ next / previous changed file
↑ ↓ ← → Enter move, collapse, expand, open in the file tree
Alt+1 file list ↔ comparison
F12, Ctrl+click go to definition
Alt+← / Alt+→ back / forward after go to definition
Ctrl+Enter, middle click (file list) keep the file open in a tab of its own
J / K, Ctrl+↓ / ↑ (file list) scroll the comparison, the list keeps the focus
Ctrl+Enter (Go to file, Find) open in a new tab
Ctrl+F12 go to definition in a new tab
Middle click, drag (tab) close, move the tab
Alt+F / E / V / R / B / H open a menu
F1 all shortcuts, type to filter
Ctrl+Shift+P command palette
Ctrl+Shift+M, Ctrl+Shift+A annotate the line, list annotations
Alt+N / Alt+Shift+N next / previous annotation
F2 / Shift+F2 next / previous issue in the gutter
Alt+Enter (vim g.), click on an icon the gutter items of the line
click on an empty icon-lane cell, right click (gutter, text) add a note; the menu picks the kind
Alt+1 … Alt+5 (add-note dialog) note, question, explanation, issue, suggestion
vim K the annotations of the line
Alt+. / Alt+,, Esc next / previous tour step, close the tour
Ctrl+Shift+R review mode on / off
Alt+U / Alt+Shift+U (vim ]u / [u) next / previous unread line
x, ?, ! (vim x, m?, m!), p confirm the unit, flag as unclear / concern, pin
Ctrl+Alt+F, Space focus mode, confirm and go to the next unread
Ctrl+Shift+F search the changed lines (as a buffer)
Alt+F12 peek at a definition
↑ ↓ ← →, Home / End, Ctrl+← / → move the cursor in a file comparison
Shift+← → ↑ ↓, Shift+Home / End, Shift+Page Up / Down select text (Ctrl+C copies it)
Ctrl+Shift+← / →, Ctrl+Shift+Home / End, Ctrl+A select by word, to the start / end, all of the pane
drag, double click, triple click select text, a word, a line; a drag in the line numbers selects whole lines
vim v, V, o, y select characters / lines, go to the other end, copy
vim viw, vi(, vi" … yiw, yi( … select / copy a text object
Ctrl+↑ / ↓ scroll without moving the cursor
Ctrl+P go to file
Ctrl+F, F3 / Shift+F3 find in the file comparison, next / previous match
Ctrl+F (file list) filter files
Alt+Z wrap long lines
Ctrl+Shift+L tree / flat list
Ctrl+Shift+] / Ctrl+Shift+[ expand / collapse all folders
Ctrl+Shift+S show identical files
Ctrl+Shift+Z fold unchanged regions
Ctrl+Shift+W cycle whitespace handling
Ctrl+Shift+I side by side / inline view
Ctrl+B, Ctrl+Shift+B add bookmark, manage bookmarks
Ctrl+N, Ctrl+O, Ctrl+Shift+O new comparison, open files, open folders
Ctrl+= / Ctrl+- / Ctrl+0, Ctrl+wheel zoom in / out / reset
Ctrl+, settings
F1 keyboard shortcuts
Ctrl+C copy the selected text (the cursor line without a selection)
F5 / Ctrl+R refresh
Ctrl+W, Ctrl+Tab close tab, next tab

Layout

crates/
  fastdiff-core   text model (encodings, EOL, binary), line/intra-line/3-way diff, alignment
  fastdiff-tree   TreeSource abstraction, filesystem source, parallel N-way tree comparer
  fastdiff-git    gitoxide backend: revisions, index and worktree as TreeSources
  fastdiff-annotations  the annotation store (SQLite) and re-anchoring of notes
  fastdiff-mcp    MCP server: JSON-RPC, HTTP and local-socket transports, the stdio bridge
  fastdiff-app    the `fastdiff` binary: CLI, headless output, MCP tools, GPUI front end

See PLAN.md for the design and docs/research.md for background.

Building

cargo build --release

GPUI needs Vulkan on Linux and DirectX on Windows. On Linux you also need the usual Wayland/X11/xkbcommon/fontconfig development packages.

Not done yet: editing and merging (push/pull of chunks, saving, mergetool output), hg/svn.

License

fastdiff is available under your choice of one of these licenses:

SPDX: MIT OR Apache-2.0 OR GPL-3.0-or-later