hunk
Terminal diff viewer for reviewing Git, GitHub, Jujutsu, and Sapling changesets, with inline agent annotations, split/unified layouts, and watch mode.
Hunk is a terminal diff viewer for reviewing changesets, particularly ones written by coding agents. It mirrors Git's diff-style commands but opens the result in a review UI: a multi-file review stream with sidebar navigation, split, unified, or responsive auto layouts, and inline AI or agent annotations beside the code. It is built on OpenTUI and Pierre diffs, and supports keyboard, mouse, pager, and Git difftool use.
It covers several sources of changes. hunk diff reviews working-tree changes including untracked files, hunk show reviews a commit, and hunk log browses history (interactive on a terminal, static output when piped, with optional graph view and commit range selection). hunk gh pr, hunk gh commit, and hunk gh compare open GitHub pull requests, commits, and comparisons without the GitHub CLI; GH_TOKEN or GITHUB_TOKEN is used for private repos. It auto-detects Jujutsu and Sapling checkouts and uses native revsets there. Raw inputs work too: hunk diff --files before.ts after.ts or git diff --no-color | hunk patch -. The --watch flag reloads the review as files or the working tree change.
For agent workflows, a review can be left open in one terminal while an agent loads the skill file from hunk skill path and works against the live session, adding annotations. Hunk ships as a standalone binary (no Node.js needed except for the npm install) on macOS, Linux, and Windows, and updates itself with hunk update. It suits developers who review AI-generated or large multi-file diffs from the terminal.
Installation
# via Install script
curl -fsSL https://hunk.dev/install.sh | sh
# via Homebrew
brew install hunk
# via npm
npm i -g hunkdiff


Alternatives & related tools
git-crypt
Transparent file encryption for Git repositories using AES-256, encrypting files on commit and decrypting on checkout
gitoxide
Pure Rust implementation of Git, offered as the gix library crate plus gix and ein command-line binaries for testing the API and running workflow tools.
onefetch
Command-line tool that displays Git repository information and code statistics in terminal
soft-serve
Self-hostable Git server with SSH-accessible TUI for command-line repository management and browsing.
gh-dash
Terminal UI for GitHub that lists configurable pull request and issue sections, with vim-style hotkeys, custom actions, and a YAML config file.
add a badge to your README
Maintain hunk? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/hunk?utm_source=badge)<a href="https://www.trmn.sh/tools/hunk?utm_source=badge"><img src="https://www.trmn.sh/badge/hunk.svg" alt="Featured on trmn" height="20"></a>