Hunk vs git diff

git diff prints a unified patch to standard output. One long stream, one file after another, with no navigation past your pager's search. Hunk reads the same data and draws a review UI: one multi-file stream, a file sidebar, split or stacked layouts, syntax highlighting, mouse support, expandable context, watch mode, and agent annotations on hunks. Git still computes the diff. Hunk replaces the reading. Run hunk diff where you would run git diff, or point core.pager at hunk pager.

Checked against each project's own docs in September 2026Read as Markdown

Which to choose

Choose Hunk if

  • The changeset spans more than a couple of files and scrolling stopped working as navigation.
  • You want side-by-side, syntax highlighting, and a file list without configuring anything.
  • You want more context around one hunk without re-running the command with -U.
  • An agent wrote the change and you want its reasoning beside the code.

Choose git diff if

  • You are scripting, piping, or generating a patch to apply somewhere else.
  • You want the exact bytes Git produces, with no renderer in between.
  • You are on a machine where installing anything is not an option.
  • The change is two lines and you already know what they are.

What `git diff` gives you

git diff is not a bad tool. It is a precise one aimed at a different job. It computes a changeset and writes a unified patch to standard output, and that output is the interchange format of the whole ecosystem. git apply consumes it, review systems parse it, and every diff viewer including Hunk is ultimately rendering it.

It does not try to be a reading interface. No syntax highlighting, no side-by-side, no file list, no sense of where you are. Once a changeset gets past a few files your only navigation is your pager's search, and the usual workaround is re-running the command with narrower paths until the output fits on a screen.

What Hunk changes

Hunk runs Git underneath and renders the result as a UI. Every visible file becomes one continuous review stream and the sidebar indexes it, so selecting a file jumps you there without hiding the rest of the change. [ and ] move hunk by hunk across the changeset, , and . move file by file, and z expands unchanged context without re-running anything.

Layout, line numbers, wrapping, and theme all change while you read. The mouse works: click a file, use the wheel or scrollbar, open menus. hunk diff also includes untracked files, which git diff leaves out and which is a routine source of confusion about files you know you wrote.

The rest is agents. When one produced the change, it can attach reasoning to specific hunks via hunk session, and Hunk renders those notes inline beside the code instead of in a chat window you read separately.

Three ways to reach it
curl -fsSL https://hunk.dev/install.sh | sh

# 1. directly, where you would have typed git diff
hunk diff
hunk show HEAD~1

# 2. as an opt-in Git alias
git config --global alias.hdiff '-c core.pager="hunk pager" diff'
git hdiff

# 3. from any patch at all
git diff --no-color | hunk patch -

What stays the same

Git is still the source of truth. Hunk does not reimplement diffing, does not change what counts as a change, and does not modify your files or Git state. It reads what Git reports and draws it. Rename detection, --color-moved, and path filtering all still come from Git, and hunk show HEAD~1 -- src/ui README.md filters the way you would expect.

It also takes nothing away. git diff keeps working, scripts that parse it keep working, and an alias gives you Hunk only when you want it, without changing your default pager.

Hunk vs git diff, capability by capability

git diff is written in C and licensed GPL-2.0. Hunk is TypeScript, MIT, and ships as a standalone binary for macOS, Linux, and Windows.

Hunk compared with git diff, capability by capability
CapabilityHunkgit diff
Produces the diffHunk runs Git underneath. Git is still the thing that computes the changeset.NoYes
Output usable as a patchgit diff is what you pipe into git apply. Hunk is a viewer.NoYes
Syntax highlightingYesNo
Side-by-side / split viewgit diff has no split view. git difftool shells out to another program for one.YesNo
ThemesHunk ships 65 bundled themes and takes custom ones. Git has color.diff.* settings rather than themes.YesPartly
Word-level highlighting inside a changed lineGit has --word-diff and --color-words, opt-in per invocation. Hunk highlights word-level changes by default.YesPartly
File sidebar you can jump fromYesNo
Hunk-by-hunk navigation across the changesetYesNo
Mouse: click, wheel, scrollbar, menusYesNo
Change layout, wrapping, and theme mid-reviewYesNo
Expand unchanged context in placeIn Git, more context means re-running with a larger -U.YesNo
Shows untracked files in the reviewhunk diff pulls untracked files into the changeset. git diff omits them.YesNo
Watch mode that reloads the reviewYesNo
Inline agent and human annotations on a hunkYesNo
Moved-line detectionBoth use Git's --color-moved. Hunk honors diff.colorMoved from your Git config.YesYes
Scriptable, pipeable outputHunk is interactive. hunk session review --json is its machine-readable surface, aimed at agents rather than shell pipelines.PartlyYes
Available everywhere with no installNoYes
Native Jujutsu and Sapling supportYesNo

● yes · ◐ partly, see the note · ○ no

Questions people ask

Does Hunk replace git diff?

No. Hunk runs Git underneath and renders its output. git diff works exactly as before, and it is still the right tool for scripting, piping, and generating patches to apply.

How do I get a side-by-side git diff in the terminal?

git diff has no side-by-side mode. Run hunk diff instead, where split view is the default on wide terminals, or configure a difftool. Press 1 for split, 2 for stack, and 0 for the responsive layout at any point.

Can I make git diff itself open Hunk?

Yes. Set core.pager to hunk pager and patch-like output opens in the review UI, while everything else falls through to your plain-text pager. To keep your current pager, add an alias instead: git config --global alias.hdiff '-c core.pager="hunk pager" diff'.

Why does hunk diff show files that git diff does not?

It includes untracked files by default, which is usually what you want when reviewing your own work in progress. Pass --exclude-untracked to match Git's behavior.

What about GNU diff, the one that is not part of Git?

GNU diff compares two files or directories outside version control. The closest Hunk equivalent is hunk diff --files before.ts after.ts, which opens the same review UI on a pair of files and can watch both for changes.

Sources

Claims about git diff were checked against its own documentation in September 2026. If something here has gone stale, open an issue and it gets fixed.

Other comparisons

Try Hunk on your next changeset.