hunk is a free, open source version control & collaboration project written in TypeScript and released under MIT. It has 9,323 GitHub stars, 300 forks and 162 open issues, and was last pushed 3 days ago. On this registry it ranks #13 of 30 tracked projects in Version Control & Collaboration, with 5 head-to-head comparisons available. It gained 34 stars over the last 3 tracked days.

What is hunk?

hunk is a review-first terminal diff viewer for agentic coders: an MIT-licensed TypeScript tool that opens agent-authored changesets in an interactive terminal review interface instead of raw patch text, aimed at developers who must inspect changes produced by AI coding agents or by collaborators.

What it is

hunk is a terminal user interface diff viewer that lives in the Developer Tools / Version Control & Collaboration category. It is written in TypeScript, licensed under MIT, and built on OpenTUI and the Pierre diffs package (@pierre/diffs). Its topic list places it among agents, cli, code-review, diff, git, jj, jujutsu, sapling, terminal, and tui tooling, and it is hosted at hunk.dev with documentation at hunk.dev/docs. The repository is modem-dev/hunk, with 9,318 stars, 299 forks, and 162 open issues.

The concrete problem it solves is the gap between generating a change and reading it. Hunk mirrors Git's diff-style commands but opens the changeset in a review UI rather than plain text, which matters when an AI agent has produced a multi-file changeset that a human still has to understand before accepting it. It carries its own review affordances rather than leaving that work to git diff: a multi-file review stream with sidebar navigation, inline AI and agent annotations placed beside the code, and split, unified, and responsive auto layouts. It also supports multiple version control backends, with a VCS adapter owning traversal, filtering, and refs, so the same review surface can serve Git, jj/Jujutsu, and Sapling workflows.

Key capabilities

  • Multi-file review stream with sidebar navigation, so an entire changeset is browsed as one surface.
  • Inline AI and agent annotations rendered beside the code being reviewed.
  • Split, unified, and responsive auto layouts, switchable to fit the terminal.
  • hunk diff reviews current repository changes, including untracked files.
  • hunk diff --watch auto-reloads as the working tree changes, for file and Git-backed reviews.
  • hunk show reviews the latest commit, and hunk show HEAD~1 reviews an earlier one.
  • hunk log opens an auto-responsive, read-only history surface that prints shell-native static records when piped or redirected; hunk log --static forces static output that pages when needed.
  • Keyboard, mouse, pager, and Git difftool support.
  • hunk --fast experiments with offloading eligible syntax highlighting.

Who uses it and how

  • Agentic coders reviewing an AI-produced changeset before committing it, using the inline agent annotations to judge intent against code.
  • Developers on Git who want a review interface inside the terminal, running hunk show HEAD~1 to inspect an earlier commit without leaving the shell.
  • Teams using jj/Jujutsu or Sapling, where the adapter-based design handles traversal, filtering, and refs for those backends.
  • Scripted and piped workflows, where hunk log emits static records automatically and --static controls paging.
  • Omarchy users, where hunk ships as a default tool installed through mise.

Getting started

On macOS and Linux the default installation downloads a standalone binary into ~/.hunk via curl -fsSL https://hunk.dev/install.sh | sh, verifying the archive against the release checksum when SHA256SUMS and a supported checksum tool are present. Alternatives are npm i -g hunkdiff (requires Node.js 22+), brew install hunk, mise use -g hunk, or the default package exported in flake.nix; updates go through hunk update, hunk update --check, or hunk update 0.20.0.

How it compares

No peer diff viewers or paid products are named in the supplied facts as tools this project replaces, so it stands alone in this registry on that axis. The only adjacent software named is its own dependency stack (OpenTUI, Pierre diffs) and the version control systems it adapts to.

When to use it — and when not to

Pick hunk when the work is terminal-native review of agent-authored or human-authored changesets and the choice of Git, jj, or Sapling backend should not change the interface; the README lists no server, database, or mail service to operate, so the operational surface is a local binary and optionally Node.js 22+. Avoid it if the team depends on a hosted, browser-based review product with web comment threads, since hunk is a terminal TUI with no described web interface. The facts also warrant caution: the project carries 162 open issues, and the supplied README excerpt is partial, so the full command and configuration surface is not documented here. On x86-64 the binary requires a CPU with SSE4.2 (Intel Nehalem 2008+ or AMD Bulldozer 2011+), while arm64 has no CPU feature floor; Windows requires mise 2026.8.6 or newer for that install path.

project readme (upstream, from github) — read inline

hunk

Hunk is a review-first terminal diff viewer for agent-authored changesets, built on OpenTUI and Pierre diffs.

hunk.dev · Documentation

CI status Latest release MIT License Join the Discord community

  • multi-file review stream with sidebar navigation
  • inline AI and agent annotations beside the code
  • split, unified, and responsive auto layouts
  • watch mode for auto-reloading file and Git-backed reviews
  • keyboard, mouse, pager, and Git difftool support
image
Split view with sidebar and inline AI notes
image
Unified view and mouse-selectable menus

Install

The default installation method on macOS and Linux downloads a standalone binary and installs it into ~/.hunk. It checks the archive against the release checksum when both SHA256SUMS and a supported checksum tool are available, and warns otherwise. Release discovery uses Hunk's anonymous aggregate endpoint with direct GitHub fallback:

curl -fsSL https://hunk.dev/install.sh | sh

Windows users can install with npm or mise. Other installation methods are also available:

npm i -g hunkdiff                    # macOS, Linux, or Windows; requires Node.js 22+
brew install hunk                    # macOS or Linux
mise use -g hunk                     # macOS, Linux, or Windows

[!NOTE] If you previously installed hunk via modem-dev/tap, be sure to uninstall it first with brew uninstall modem-dev/tap/hunk.

Windows requires mise 2026.8.6 or newer. Nix users can use the default package exported in flake.nix; see the Nix guide for details. Hunk also ships as a default tool in Omarchy, installed through mise.

Requirements:

  • macOS, Linux, or Windows
  • On x86-64, a CPU with SSE4.2 (Intel Nehalem 2008+, AMD Bulldozer 2011+); arm64 has no CPU feature floor
  • Node.js 22+ for the npm install; the install script, Homebrew, mise, and Nix ship a standalone binary that does not require Node.js
  • Git recommended for most workflows

Update Hunk

Starting with Hunk 0.20, npm, Homebrew, and default install-script installs use Hunk’s canonical update command:

hunk update          # install the newest release
hunk update --check  # check without installing
hunk update 0.20.0   # select an exact npm or default install-script release

On an older release, update once with the installer or package manager that installed Hunk, then use hunk update going forward. Custom HUNK_INSTALL_DIR installs must re-run the installer with the same directory; mise, Nix, and source installs use their owning tools instead.

Quick start

hunk           # show help
hunk --version # print the installed version

Working with Git

Hunk mirrors Git's diff-style commands, but opens the changeset in a review UI instead of plain text.

hunk diff                      # review current repo changes, including untracked files
hunk --fast                    # experimentally offload eligible syntax highlighting
hunk diff --watch              # auto-reload as the working tree changes
hunk show                      # review the latest commit
hunk show HEAD~1               # review an earlier commit
hunk log                       # browse history on a terminal; print when redirected
hunk log --static              # force static output, paging when needed

hunk log is one auto-responsive, read-only history surface, not a repository manager. On a terminal it opens the desktop history browser; pipes and redirects receive shell-native static records automatically, and --static forces static output that pages only when needed. The selected VCS adapter owns traversal, filtering, refs, and how a history item opens for review; the bundled Git and Jujutsu adapters both implement that public capability. Static output keeps full commit, author, date, message, branch/bookmark, remote, and tag details; --oneline provides compact records, and --theme uses the same palette as Hunk review. Interactive history groups commits by local-calendar day with account-like author handles and relative times, while keeping commit ids right-aligned and clickable. Enable Graph view from the View menu to replace day groups with commit-topology lanes. Press v and move with Up/Down or k/j to select a contiguous range. Shift+Up/Shift+Down, uppercase K/J, and Shift-click extend directly. Escape collapses the selection; opening the range reviews the inclusive cumulative change from the oldest commit's parent through the newest commit. History also shares review's b/f full-page and u/d half-page movement keys. Range selection is disabled with --all or author, message, date, and path filters because traversal can interleave or hide commits. After opening a commit or range, quit its normal Hunk review to return to the same selection. History controls are configurable through canonical hunk.history.* keybindings.

Working with Jujutsu and Sapling

Hunk auto-detects Jujutsu and Sapling checkouts, so hunk diff [revset] and hunk show [revset] use native revsets inside jj or Sapling workspaces. hunk log --vcs jj also reads JJ history directly, including in a non-colocated workspace. To override VCS detection, set vcs = "git" or vcs = "jj" or vcs = "sl" in config.

Working with raw files and patches

hunk diff --files before.ts after.ts        # compare two files directly
hunk diff --files before.ts after.ts --watch # auto-reload when either file changes
git diff --no-color | hunk patch -          # review a patch from stdin

Watch mode remains continuous. Direct-file and Git-backed reviews normally use filesystem observation to refresh promptly, with periodic polling retained as a fallback for missed events or unavailable watchers. Jujutsu and Sapling reviews currently use polling rather than filesystem observation.

Working with agents

  1. Open Hunk in another terminal with hunk diff or hunk show.
  2. Tell your agent to add the skill file returned by hunk skill path.
  3. Ask your agent to use the skill against the live Hunk session.

A good generic prompt is:

Load the Hunk skill and use it for this review. Run `hunk skill path` to get the skill path.

For the full live-session and --agent-context workflow guide, see the agent workflow guide. Experimental rich STML note bodies require starting the review with --experimental; plain agent notes remain the default.

Feature comparison

Capability hunk lumen difftastic delta diff-so-fancy diff
Review-first interactive UI
Multi-file review stream + sidebar

readme truncated — read the full docs on github

Frequently asked questions

Is hunk free to use?

hunk is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does hunk do?

Review-first terminal diff viewer for agentic coders

What is hunk written in?

hunk is primarily written in TypeScript. Its source is publicly available at https://github.com/modem-dev/hunk, and it has 9,323 GitHub stars.