hunk-review
Original:🇺🇸 English
Translated
Interacts with live Hunk diff review sessions via CLI. Inspects review focus, navigates files and hunks, reloads session contents, and adds inline review comments. Use when the user has a Hunk session running or wants to review diffs interactively.
6installs
Sourcemodem-dev/hunk
Added on
NPX Install
npx skill4agent add modem-dev/hunk hunk-reviewTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Hunk Review
Hunk is an interactive terminal diff viewer. The TUI is for the user -- do NOT run , , or other interactive commands directly. Use CLI commands to inspect and control live sessions.
hunk diffhunk showhunk session *If no session exists, ask the user to launch Hunk in their terminal first.
Workflow
1. hunk session list # find live sessions
2. hunk session context --repo . # check current focus
3. hunk session navigate ... # move to the right place
4. hunk session reload -- <command> # swap contents if needed
5. hunk session comment add ... # leave review notesSession selection
Every command (except ) needs a session target:
list- -- match by repo root (most common)
--repo <path> - -- match by exact ID (use when multiple sessions share a repo)
<session-id> - If only one session exists, it auto-resolves
Commands
Inspect
bash
hunk session list [--json]
hunk session get (--repo . | <id>) [--json]
hunk session context (--repo . | <id>) [--json]Navigate
Requires and exactly one of , , or :
--file--hunk--new-line--old-linebash
hunk session navigate --repo . --file src/App.tsx --hunk 2
hunk session navigate --repo . --file src/App.tsx --new-line 372
hunk session navigate --repo . --file src/App.tsx --old-line 355- is 1-based
--hunk <n> - /
--new-lineare 1-based line numbers on that diff side--old-line
Reload
Swaps the live session's contents. Pass a Hunk review command after :
--bash
hunk session reload --repo . -- diff
hunk session reload --repo . -- show HEAD~1
hunk session reload --repo . -- show HEAD~1 -- README.mdComments
bash
hunk session comment add --repo . --file README.md --new-line 103 --summary "Tighten this wording" [--rationale "..."] [--author "agent"]
hunk session comment list --repo . [--file README.md]
hunk session comment rm --repo . <comment-id>
hunk session comment clear --repo . --yes [--file README.md]- requires
comment add,--file, and exactly one of--summaryor--old-line--new-line - Quote and
--summarydefensively in the shell--rationale
New files in working-tree reviews
Newly created files won't appear in until Git knows about them:
hunk diffbash
git add -N src/new-file.ts
hunk session reload --repo . -- diffGuiding a review
The user may ask you to walk them through a changeset or review code using Hunk. Your role is to narrate: steer the user's view to what matters and leave comments that explain what they're looking at.
Typical flow:
- Load the right content (if needed)
reload - Navigate to the first interesting file/hunk
- Add a comment explaining what's happening and why
- Move to the next point of interest -- repeat
- Summarize when done
Guidelines:
- Work in the order that tells the clearest story, not necessarily file order
- Navigate before commenting so the user sees the code you're discussing
- Keep comments focused: intent, structure, risks, or follow-ups
- Don't comment on every hunk -- highlight what the user wouldn't spot themselves
Common errors
- "No visible diff file matches ..." -- file isn't in the loaded review. Check , then
contextif needed.reload - "No active Hunk sessions" -- ask the user to open Hunk in their terminal.
- "Multiple active sessions match" -- pass explicitly.
<session-id> - "Specify exactly one navigation target" -- pick one of ,
--hunk,--old-line.--new-line