Skip to content
amalucelliPublic

About

A fast terminal diff viewer and code review tool for git, with the coding agent you already use

Topics

Resources

Stars

52 stars

Watchers

0 watching

Forks

Repository files navigation

dffy

dffy

A fast terminal diff viewer for git, with a review loop for your coding agent.

Opens a diff the size of a Linux kernel release in milliseconds.

Latest release MIT license

dffy showing a split diff with the file tree on the left

brew install --cask amalucelli/tap/dffy
dffy            # in any git repository: everything you haven't committed

Who it's for

  • You work in a large repository. dffy shows the first files while it diffs the rest in the background, and it doesn't slow down at the scale of the Linux kernel.
  • You review what your coding agent wrote. Leave comments on its lines, send them back to the agent with one key, then see only what it changed in response.
  • You review pull requests. dffy pr 123 opens a GitHub pull request with its threads inline, and posts your review without leaving the terminal.
  • You live in the terminal, sometimes over SSH from a phone. dffy is a single native binary, with plain-letter keys and a layout that fits small screens.

Install

dffy is a single binary for Linux and macOS, on x86_64 and arm64.

brew install --cask amalucelli/tap/dffy
# or
curl -fsSL https://raw.githubusercontent.com/amalucelli/dffy/main/install.sh | sh

install.md covers mise, building from source, shell completions and the plugins.

Make it your default

git config --global core.pager dffy
git config --global interactive.diffFilter "dffy --color-only"

git diff, git show and git log -p then open in dffy's viewer, and git add -p gets dffy's colors. To try it once without changing your config: git -c core.pager=dffy diff.

Usage

dffy                        # staged, unstaged and untracked changes
dffy main...feature         # any revision git understands
dffy show HEAD              # a commit with its message
dffy --watch                # refresh on every change
dffy a.txt b.txt            # two files or folders, no repository needed

usage.md has the rest: paths, --staged, --syntax, --stat, --json and more.

Key Does
n / N next / previous change
f / F next / previous file
/ search the diff
o find any file in the repository
l show files whole, with their changes marked
K go to a definition, no language server needed
c comment on a line
space list every command
? / q help / quit

keys.md lists every key and how to rebind it. Settings go in ~/.config/dffy/config as key = value lines, and dffy config --default lists them all.

Review your agent's work

dffy agents setup    # a skill for Claude Code, Codex, Pi and Amp

The skill teaches your agent to read changes with dffy a file at a time, and to answer the review threads you leave it under its own name. It never resolves or posts them. Agents without a shell use dffy mcp instead.

With Claude Code, install dffy's plugin so a session you already have open takes the threads you send:

claude plugin marketplace add amalucelli/dffy
claude plugin install dffy@dffy

Then, with claude and dffy open in the same working tree:

  1. c on a line leaves a comment for the agent.
  2. h sends all your open threads to the session, after a confirm, and takes a checkpoint of the working tree first. f sends only the thread in focus.
  3. The session makes each change and replies in its thread.
  4. ' shows only what changed since the checkpoint, the agent's turn. x on a thread resolves it once you're happy.

Ask or start an agent from the viewer

The dffy-agent plugin (experimental) runs Claude Code, Codex, Pi or Amp for you, with no session open:

brew install --cask amalucelli/tap/dffy-agent
  • a on a thread asks an agent about it. The answer comes as a reply in the thread, read-only, with a suggestion when it proposes a change, and s applies the suggestion to the working tree.
  • f and h with no session listening start your agent in a new tab, pointed at the threads.

It needs claude, codex or pi logged in. agents.md and viewer.md have the details.

Claude Code answering a review thread inline in dffy

Review pull requests

The dffy-review-github plugin (experimental) brings GitHub pull requests into the viewer. It needs gh, logged in.

brew install --cask amalucelli/tap/dffy-review-github
dffy pr 123
  • The pull request opens with its threads under their lines. You reply, resolve and suggest changes as on your own comments.
  • P posts your drafts, replies and resolves as one review, and p fetches new pushes and threads in place.
  • R shows only what changed since your last review, and O lists the reviews waiting on you.
  • Plain dffy on a branch with an open pull request brings in its comments too. review = none in the config turns that off.

viewer.md and review-github.md have the details.

Benchmarks

Opening Linux v6.0..v6.1 (13,168 changed files, a 48MB patch) in a viewer, time until the first changed line is on screen:

dffy lumen 2.32.0 hunk 0.25.0
The v6.0..v6.1 range 8.1ms 12.5s 18.1s
The working tree (5 files changed) 77ms 1.11s 733ms
As a pager, git diff v6.0 v6.1 | … 210ms n/a 15.2s
Memory, opening the range 99MB 676MB 4.39GB

As git's pager, dffy streams the whole 48MB patch in 3.1MB of its own memory, about as fast as plain git diff. benchmarks.md has the method.

Comparison

dffy hunk lumen difftastic delta diff-so-fancy diff
Interactive viewer with a file tree ✅ ✅ ✅ ❌ ❌ ❌ ❌
Watch mode ✅ ✅ ✅ ❌ ❌ ❌ ❌
git's pager (reads a diff on stdin) ✅ ✅ ❌ ❌ ✅ ✅ ❌
git add -p filter ✅ ❌ ❌ ❌ ✅ ✅ ❌
Syntax highlighting ✅ ✅ ✅ ✅ ✅ ❌ ❌
Changed-word emphasis ✅ ✅ ✅ ✅ ✅ 🟡 ❌
Syntax-aware diff ✅ ❌ ❌ ✅ ❌ ❌ ❌
Split and unified, picked by width ✅ ✅ ❌ 🟡 🟡 ❌ 🟡
Mouse ✅ ✅ ✅ ❌ ❌ ❌ ❌
Compares files outside a repository ✅ 🟡 ❌ ✅ ✅ 🟡 ✅
Plugins or extensions 🟡 🟡 ❌ ❌ ❌ ❌ ❌
Single native binary ✅ 🟡 ✅ ✅ ✅ ❌ ✅
Your own line comments ✅ 🟡 ✅ ❌ ❌ ❌ ❌
GitHub pull request review 🟡 🟡 🟡 ❌ ❌ ❌ ❌
AI or agent annotations ✅ ✅ 🟡 ❌ ❌ ❌ ❌
Other VCSs (Jujutsu, Mercurial, Sapling) ❌ ✅ ✅ ✅ ✅ 🟡 —

🟡 means partial support. All seven are open source. GNU diff is GPL-3.0-or-later and the rest are MIT. Checked against hunk 0.25.0, lumen 2.32.0, difftastic 0.72.0, delta 0.20.1, diff-so-fancy 1.4.14 and GNU diffutils 3.10, with a source for every cell.

Features

Fast

Reading diffs

Reading code

Navigation

Reviewing

  • 💬 Review comments on lines and files, drawn under their code, with replies, resolve and suggestions. They're kept in a plain file in the repository's git directory.
  • 🗒️ A Comments panel beside the file tree. Picking a thread takes the diff to it.
  • 📍 Checkpoints save the working tree, so the next diff shows only what changed since, such as your agent's last turn.
  • 🤝 Coding agents and GitHub pull requests, above.

Git

Anywhere

Scripts and agents

  • 🧱 --json: the diff as JSON Lines, with each line's kind and whether it moved or was only reformatted.
  • 🤖 dffy mcp: an MCP server. Coding agents list a change's files, read its diffs a page at a time, find where a name is defined and used, read your review comments, and reply in a thread or apply its suggestion.
  • ✍️ dffy comments: review comments as JSON. Scripts and agents add their own with dffy comments apply, shown inline with their author.

Plugins

Plugins are separate programs that dffy runs. All are experimental.

Plugin What it adds
dffy-render-markdown Markdown files diffed as rendered text, with Mermaid fences drawn
dffy-render-mermaid .mmd and .mermaid flowcharts and sequence diagrams drawn in the terminal
dffy-review-github GitHub pull request reviews
dffy-agent Asking and starting coding agents

All four at once:

brew install --cask \
  amalucelli/tap/dffy-render-markdown \
  amalucelli/tap/dffy-render-mermaid \
  amalucelli/tap/dffy-review-github \
  amalucelli/tap/dffy-agent
# or
curl -fsSL https://raw.githubusercontent.com/amalucelli/dffy/main/install.sh | sh -s -- \
  --plugin markdown \
  --plugin mermaid \
  --plugin review-github \
  --plugin agent

The renderers need one line in ~/.config/dffy/config, then r switches a file between its lines and its rendered form:

render = md:markdown mmd:mermaid mermaid:mermaid

dffy-review-github and dffy-agent work once they're on PATH. dffy doctor checks that each plugin is found, and that gh and the agents are logged in. plugins.md has the details.

Docs

The documentation covers every key, flag and setting: installation, usage, the viewer, keys, configuration, themes, git integration, watch mode, review comments, plugins, JSON output, coding agents, the MCP server and troubleshooting. CHANGELOG.md lists what each release changed.

To contribute, start with design.md and architecture.md: dffy is a library, dffy-core, with its own diff engine and terminal renderer, and the viewer, printed output, JSON and MCP server are thin frontends over it.

Credits

dffy builds on ideas from tools I like: the terminal review flow of lumen, the review UX of hunk, and the rendering of diffs.com (Pierre's @pierre/diffs).

License

MIT

About

A fast terminal diff viewer and code review tool for git, with the coding agent you already use

Topics

Resources

Stars

52 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages