@mitchellh: Hunk is very good. It has completely replaced any other local diff viewer for me. It looks good, its speedy, good keybo…

X AI KOLs Following Tools

Summary

Hunk is a review-first terminal diff viewer for agent-authored changesets, offering features like multi-file review streams, inline AI annotations, and Git/Jujutsu support.

Hunk is very good. It has completely replaced any other local diff viewer for me. It looks good, its speedy, good keyboard shortcuts, good mouse support for fallback. Great software @bentlegen. https://t.co/6HH5DPO5mO https://t.co/Dy2rl4NXBL
Original Article
View Cached Full Text

Cached at: 05/11/26, 12:31 AM

Hunk is very good. It has completely replaced any other local diff viewer for me. It looks good, its speedy, good keyboard shortcuts, good mouse support for fallback. Great software @bentlegen. https://t.co/6HH5DPO5mO https://t.co/Dy2rl4NXBL


modem-dev/hunk

Source: https://github.com/modem-dev/hunk

hunk

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

CI status Latest release MIT License

  • multi-file review stream with sidebar navigation
  • inline AI and agent annotations beside the code
  • split, stack, 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
Stacked view and mouse-selectable menus

Install

npm i -g hunkdiff

Or with Homebrew:

brew install modem-dev/tap/hunk

Requirements:

  • Node.js 18+
  • macOS or Linux
  • Git recommended for most workflows

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 diff --watch              # auto-reload as the working tree changes
hunk show                      # review the latest commit
hunk show HEAD~1               # review an earlier commit

Working with Jujutsu

Hunk auto-detects Jujutsu checkouts, so hunk diff [revset] and hunk show [revset] use jj revsets inside a jj workspace. To override VCS detection, set vcs = "git" or vcs = "jj" in config.

Working with raw files and patches

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

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.

For the full live-session and --agent-context workflow guide, see docs/agent-workflows.md.

Feature comparison

Capabilityhunklumendifftasticdeltadiff-so-fancydiff
Review-first interactive UI✅✅❌❌❌❌
Multi-file review stream + sidebar✅✅❌❌❌❌
Inline agent / AI annotations✅❌❌❌❌❌
Responsive auto split/stack layout✅❌❌❌❌❌
Mouse support inside the viewer✅✅❌❌❌❌
Runtime view toggles✅✅❌❌❌❌
Syntax highlighting✅✅✅✅❌❌
Structural diffing❌❌✅❌❌❌
Pager-compatible mode✅❌✅✅✅✅

Hunk is optimized for reviewing a full changeset interactively.

Advanced

Config

You can persist preferences to a config file:

  • ~/.config/hunk/config.toml
  • .hunk/config.toml

Example:

theme = "graphite"   # graphite, midnight, paper, ember
mode = "auto"        # auto, split, stack
vcs = "git"          # git, jj
exclude_untracked = false
line_numbers = true
wrap_lines = false
agent_notes = false

exclude_untracked affects Git working-tree hunk diff sessions only.

Git integration

Set Hunk as your Git pager so git diff and git show open in Hunk automatically:

Untracked files are auto-included only for Hunk’s own hunk diff working-tree loader. If you open git diff through hunk pager, Git still decides the patch contents, so untracked files will not appear there.

git config --global core.pager "hunk pager"

Or in your Git config:

[core]
    pager = hunk pager

If you want to keep Git’s default pager and add opt-in aliases instead:

git config --global alias.hdiff "-c core.pager=\"hunk pager\" diff"
git config --global alias.hshow "-c core.pager=\"hunk pager\" show"

Jujutsu pager integration

To use Hunk as jj’s pager, run jj config edit --user and update:

[ui]
pager = ["hunk", "pager"]
diff-formatter = ":git"

OpenTUI component

Hunk also publishes HunkDiffView and lower-level primitives from hunkdiff/opentui for embedding the same diff renderer in your own OpenTUI app.

See docs/opentui-component.md for install, API, and runnable examples.

Examples

Ready-to-run demo diffs live in examples/.

Each example includes the exact command to run from the repository root.

Contributing

💬 Chat with users/contributors on the Modem Discord server

For source setup, tests, packaging checks, and repo architecture, see CONTRIBUTING.md.

Sponsor

Sponsored by Modem.

Modem

License

MIT

Similar Articles

Show HN: Diffle, a keyboard-centric diff viewer with LSP support

Hacker News Top

Diffle 是一个键盘优先的浏览器端 Git diff 查看工具,支持按行、块或文件添加评论,并可将评论作为 prompt 交给 AI agent 或提交为 GitHub 待处理评审,内置 LSP 支持且可通过 pixi、npm 或独立二进制安装。

hutch: local code reviews in emacs for the mildly disenfranchised

Lobsters Hottest

The author introduces Hutch, an open-source Emacs/Magit-based interface that runs LLM-powered code reviews locally on staged, unpushed, or branch-diff changes, letting developers queue and bulk-apply suggestion patches inside a familiar keyboard-driven workflow.