Hunk CLI

A terminal diff viewer: all files in one stream, and an agent with the hunk-review skill walks through the changes and leaves line comments

  • 9,657 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • Hunk loads TypeScript extensions from ~/.config/hunk/extensions/ and from a repository after explicit trust, and hunk extension install fetches them from Git by address
  • Through hunk session the agent reloads the window onto other diffs and writes comments into the session, which runs on a local background process
  • The hunk gh command calls the GitHub API and reads a token from GH_TOKEN or GITHUB_TOKEN for private repositories
All reasons and checks

modem-dev/hunk

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/hunk

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Hunk loads TypeScript extensions from ~/.config/hunk/extensions/ and from a repository after explicit trust, and hunk extension install fetches them from Git by address
  • Through hunk session the agent reloads the window onto other diffs and writes comments into the session, which runs on a local background process
  • The hunk gh command calls the GitHub API and reads a token from GH_TOKEN or GITHUB_TOKEN for private repositories

This is third-party code. Review the repository files before installing.

What it does

Hunk is a program for reading changes in the terminal, built on OpenTUI. hunk diff shows working-copy edits together with untracked files, hunk show opens a commit, hunk log gives an interactive history with a branch graph, hunk status prints the state of worktrees, and git diff | hunk patch - reads a patch from standard input. Files go in one stream with a sidebar, the layout is split, unified or automatic, and the width threshold for the split view is set by the auto_split_min_width config option. Git, Jujutsu and Sapling repositories are detected on their own, and hunk gh pr opens a pull request without the GitHub CLI. Agents connect to Hunk through the hunk-review skill. A running window registers with a local background process, and the agent uses hunk session commands to read the review structure, jump to a file and hunk, reload the window onto another diff and place line comments. The agent's comments stay hidden until you press a. The SKILL.md file in the repository is a pointer: the agent gets the real instructions with hunk skill show hunk-review, so they match the installed version. There is a --watch mode that rereads the diff as files change, and Hunk can be set up as the pager for Git, Jujutsu and Sapling. TypeScript extensions add commands, themes, sidebars and support for other version control systems.

Who it is for. For developers who read an agent's changes in the terminal and want the model's comments beside the code without leaving the repository.

Good fit when

  • An agent changed ten files and you want to read them as a stream with a sidebar instead of paging through git diff
  • You want the agent itself to walk you through the changes, stop at the right hunks and leave line comments
  • You need to open a pull request or a branch comparison from the terminal with hunk gh pr
  • The repository is kept in Jujutsu or Sapling and you want an interactive viewer like the Git one
  • Changes arrive as a patch from a pipeline: git diff --no-color | hunk patch -

Not a fit when

  • You need a structural diff that compares syntax trees: the project's own comparison table marks that capability as missing
  • You work on Windows arm64 or on musl-based Linux such as Alpine: there are no prebuilt binaries for them
  • The repository is on GitHub Enterprise: hunk gh does not support it yet
  • The review has to happen in a browser with team comments: Hunk runs only in the terminal, and the catalog has Plannotator for browser markup

Example request

Load the hunk-review skill, walk through the diff open in Hunk and leave comments on the debatable spots in src/App.tsx

Limitations

Hunk is in beta: the package in the repository is version 0.24.0-beta.1, and the latest GitHub release is 0.23.0. The author calls the extension API experimental and warns of breaking changes between minor versions.

Binaries exist for macOS (arm64, x64), Linux (arm64, x64, glibc) and Windows (x64). On x86-64 the CPU needs SSE4.2, the npm install needs Node.js 22 or newer, and on Windows installing through mise needs version 2026.8.6 or later.

Updating with hunk update works from version 0.20 for installs through the script, npm and Homebrew; an older version is first updated by the method it was installed with.

Untracked files are included automatically only by hunk diff: if you open git diff through hunk pager, Git itself decides the patch contents. Anonymous hunk gh requests to public repositories are limited by GitHub API rate limits.

MIT license.

How to disable. Remove Hunk the way you installed it: npm uninstall -g hunkdiff, brew uninstall hunk or through mise. If you set it as a pager, restore the core.pager value in Git settings. The skill is removed with its folder from the agent's skills directory, and the config lives in ~/.config/hunk/config.toml.

FAQ

How does the agent find the open Hunk window?

On startup the interface registers with a local background process on the loopback address, and hunk session list shows the active windows. If the list is empty while Hunk is running, the agent's sandbox is probably blocking loopback and the command should be rerun with escalated permissions. Guessing requests to /session-api with curl is pointless: access needs an automatically discovered private owner credential.

How does --agent-context differ from a live session?

It is the fallback: the agent prepares a notes file in advance and Hunk shows the notes beside the code. The recommended route is different: the agent steers the open window through hunk session, moving between hunks and placing comments in real time.

How do I open a pull request in Hunk?

hunk gh pr finds the pull request for the current branch, and hunk gh pr 123 takes the repository from origin. For private repositories set GH_TOKEN or GITHUB_TOKEN; public ones open anonymously.

How do I make Hunk the default viewer for git diff?

Run git config --global core.pager "hunk pager". To keep the usual pager, add the hdiff and hshow aliases that enable hunk pager for a single call. For Jujutsu the pager is set under [ui], for Sapling under [pager].

What if the agent has no skill system?

Ask the agent to run hunk skill show and follow the output; hunk skill path gives the path to the skill file.

Can unwanted files be hidden from the review?

Yes, with an extension. The example from the project page removes files ending in .lock from the changeset and shows a notice with the number of hidden files. hunk extension install installs extensions from repositories, and --no-extensions switches them off for one run.

Discussion

No questions or reviews yet.

CLI tools

A CLI that opens a local git diff in the browser like GitHub's Files changed tab; comments copy out as prompts for an agent

CLIExtended access3.3KRepository stars

A herdr plugin: the agent's code diff in a terminal pane beside the chat, line comments and notes sent back to Claude Code, Codex or OpenCode

CLIExtended access928Repository stars

A code-review CLI and plugin for agents: reads a git diff and writes line-level comments with context

CLIExtended access48.1KRepository stars

Crit opens a coding agent's plans, diffs and running apps in a browser: click a line, leave a comment and the agent receives it

CLIExtended access1.2KRepository stars
Official

agnix lints CLAUDE.md, AGENTS.md, SKILL.md, hooks and MCP configs with 702 rules, autofix and editor extensions for VS Code and JetBrains

CLIMinimal access457Repository stars

A CLI and three skills that work through review-bot comments on a PR: assess findings, fix code, reply and wait for checks

SkillBroad access306Repository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialRepository starsMain difference
Hunk (this entry)no9,657
Plannotatorno9,570a local browser interface for annotating agent plans and reviewing diffs
open-code-reviewno48,062a CLI and plugin where the agent itself reads git diff and writes line comments

README in short

The repository holds TypeScript sources in packages/, docs on agents, extensions, keys, themes and the open and status modes, a changelog, two agent skills (hunk-review and hunk-extensions) and sample extensions and demo diffs. The project page gives commands for Git, GitHub, Jujutsu and Sapling, config.toml settings, a comparison table with lumen, difftastic, delta, diff-so-fancy and plain diff, and ways to embed the diff renderer in your own OpenTUI app. Tests and checks run in GitHub Actions.

README badge

Report a problem

Foxx AIHunk
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.