hunk-review
Skill5 starsChanged 3 months agoMITView on GitHub
Interacts with live Hunk diff review sessions via CLI. Inspects review focus, navigates files, hunks, and exact lines, reloads session contents, adds inline review comments, and paints attention marks on character ranges. Use when the user has a Hunk session running or wants to review diffs interactively.
4 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- danilolucasmd/skillstheir own version, first seen Oct 19, 2026
- modem-dev/hunkedited, first seen Oct 17, 2026
- atuinsh/atuinedited, first seen Oct 8, 2026
- RussBrown00/agent-skillsedited, first seen Jul 30, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- atuinsh/atuin★ 32k86% same
- modem-dev/hunk★ 9.8k33% same
- RussBrown00/agent-skills★ 192% same
Wrote their own version · 1
- danilolucasmd/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 5 are distinctive, and 10 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
If no session exists, ask the user to launch Hunk in their terminal first.
- Distinctive: line 33
If only one session exists, it auto-resolves
- Very specific: line 40
Use --source only for advanced reloads where the live session you want to control is not already associated with the checkout you want to …
- Very specific: line 90
Use either --next-comment or --prev-comment, not both
- Very specific: line 112
Always include -- before the nested Hunk command
- Very specific: line 115
If the live session is already showing the target worktree, prefer hunk session reload --repo /path/to/worktree -- diff
- Very specific: line 171
Only use STML when hunk session context --json lists stml in experimentalFeatures.
- Very specific: line 175
Before writing markup, run hunk markup guide once — it has copy-paste patterns and the width rules.
- Distinctive: line 195
Add a comment explaining what's happening and why
- Very specific: line 196
If you already have several notes ready, prefer one comment apply batch over many separate shell invocations
- Very specific: line 203
Use highlight add --focus to steer the user's eyes to the exact expression while you explain it, and highlight clear before moving to the …
- Very specific: line 204
Use comment apply for agent-generated batches and comment add for one-off notes
- Very specific: line 205
Use --focus on your first note so agent notes become visible, then sparingly when a note should actively steer the review
- Distinctive: line 206
Keep comments focused: intent, structure, risks, or follow-ups
- Distinctive: line 207
Don't comment on every hunk -- highlight what the user wouldn't spot themselves
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hunk Review
Hunk is an interactive terminal diff viewer. The TUI is for the user -- do NOT run hunk diff, hunk show, or other interactive commands directly. Use hunk session * CLI commands to inspect and control live sessions through the local daemon.
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 get --repo . # inspect path / repo / source
3. hunk session review --repo . --json # inspect file/hunk structure first
4. hunk session review --repo . --include-patch --json # opt into raw diff text only when needed
5. hunk session context --repo . # check current focus when needed
6. hunk session navigate ... # move to the right place
7. hunk session reload -- <command> # swap contents if needed
8. hunk session comment add ... # leave one review note
9. hunk session comment apply ... # apply many agent notes in one stdin batch
10. hunk session highlight add ... # light up the exact range you are explainingSession selection
Most session commands accept:
--repo <path>-- match the live session by its current loaded repo root (most common)<session-id>-- match by exact ID (use when multiple sessions share a repo)- If only one session exists, it auto-resolves
reload also supports:
--session-path <path>-- match the live Hunk window by its current working directory--source <path>-- load the replacementdiff/showcommand from a different directory
Use --source only for advanced reloads where the live session you want to control is not already associated with the checkout you want to load next. For a normal worktree session, prefer selecting it directly with --repo /path/to/worktree.
Commands
Inspect
hunk session list [--json]
hunk session get (<session-id> | --repo <path>) [--json]
hunk session context (<session-id> | --repo <path>) [--json]
hunk session review (<session-id> | --repo <path>) [--include-patch] [--include-notes] [--json]getshows the sessionPath,Repo, andSource, which helps when choosing between--repoand--session-pathRepois what--repomatches;Pathis what--session-pathmatchesreview --jsonreturns file and hunk structure by default; add--include-patchonly when a caller truly needs raw unified diff textreview --include-notesalso returns the live review notes alongside the file and hunk structure
Navigate
hunk session navigate (<session-id> | --repo <path>) --file <path> (--hunk <n> | --old-line <n> | --new-line <n>) [--json]
hunk session navigate (<session-id> | --repo <path>) --comment <id> [--json]
hunk session navigate (<session-id> | --repo <path>) (--next-comment | --prev-comment) [--json]Absolute navigation requires --file and exactly one of --hunk, --new-line, or --old-line:
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 355Exact comment navigation uses the commentId returned by hunk session comment list --json and does not require --file:
hunk session navigate --repo . --comment comment-1Relative comment navigation jumps between annotated hunks and does not require --file:
hunk session navigate --repo . --next-comment
hunk session navigate --repo . --prev-comment--hunk <n>is 1-based--new-line/--old-lineare 1-based line numbers on that diff side- A line target lands the user's viewport on that exact line (falling back to its hunk when the line is inside a collapsed region);
--hunklands on the hunk - Use either
--next-commentor--prev-comment, not both
Reload
Swaps the live session's contents. Pass a Hunk review command after --:
hunk session reload (<session-id> | --repo <path> | --session-path <path>) [--source <path>] [--json] -- diff [ref] [-- <pathspec...>]
hunk session reload (<session-id> | --repo <path> | --session-path <path>) [--source <path>] [--json] -- show [ref] [-- <pathspec...>]Examples:
hunk session reload --repo . -- diff
hunk session reload --repo . -- diff main...feature -- src/ui
hunk session reload --repo . -- show HEAD~1
hunk session reload --repo . -- show HEAD~1 -- README.md
hunk session reload --repo /path/to/worktree -- diff
hunk session reload --session-path /path/to/live-window --source /path/to/other-checkout -- diff- Always include
--before the nested Hunk command --repoor<session-id>usually selects the session you want--sourceis advanced: it does not select the session; it only changes where the replacement review command runs- If the live session is already showing the target worktree, prefer
hunk session reload --repo /path/to/worktree -- diff --session-pathtargets the live window when you need to keep session selection separate from reload source
Comments
hunk session comment add (<session-id> | --repo <path>) (--reply-to <note-id> | --file <path> (--old-line <n> | --new-line <n>)) --summary <text> [--rationale <text>] [--author <name>] [--markup <stml>] [--focus] [--json]
hunk session comment apply (<session-id> | --repo <path>) --stdin [--focus] [--json]
hunk session comment list (<session-id> | --repo <path>) [--file <path>] [--type <live|all|ai|agent|user>] [--json]
hunk session comment rm (<session-id> | --repo <path>) <comment-id> [--json]
hunk session comment clear (<session-id> | --repo <path>) [--file <path>] [--include-user|--all] --yes [--json]Examples:
hunk session comment add --repo . --file README.md --new-line 103 --summary "Tighten this wording"
hunk session comment add --repo . --reply-to user:123 --summary "Addressed in the latest revision"
printf '%s\n' '{"comments":[{"filePath":"README.md","newLine":103,"summary":"Tighten this wording"}]}' | hunk session comment apply --repo . --stdin- Agent notes start hidden: the user sees them only after pressing
aor settingagent_notes = true.--focusjumps to the new note (or the first note in a batch) and turns agent notes on, so pass it on the first note you leave in a session, or tell the user to pressa comment listshows the comments added throughhunk session commentby default;--type userlists notes the user wrote withc,--type ailists notes loaded from an--agent-contextsidecar,--type agentlists agent-authored notes, and--type alllists every notecomment addis best for one note;comment applyis best when an agent already has several notes ready- Root
comment addnotes require--file,--summary, and exactly one of--old-lineor--new-line; replies use--reply-to <note-id>with--summaryand inherit the parent's anchor comment applyitems requiresummaryplus eitherreplyToby itself orfilePathwith exactly one target such ashunk,hunkNumber,oldLine, ornewLinecomment applyreads a JSON batch from stdin and validates the full batch before mutating the live sessioncomment listandcomment clearaccept optional--file- Quote
--summaryand--rationaledefensively in the shell
Attention marks
Highlights paint character ranges inside the diff lines the user is looking at — use them to light up the exact expression you are explaining while you narrate.
hunk session highlight add (<session-id> | --repo <path>) --file <path> (--old-line <n> | --new-line <n>) --start <n> --end <n> [--tone <tone>] [--focus] [--json]
hunk session highlight clear (<session-id> | --repo <path>) [--file <path>] [--json]Examples:
hunk session highlight add --repo . --file src/App.tsx --new-line 42 --start 6 --end 19
hunk session highlight add --repo . --file src/App.tsx --new-line 42 --start 6 --end 19 --tone warning --focus
hunk session highlight clear --repo .highlight addrequires--file, exactly one of--old-lineor--new-line, and the--start/--endoffsets--startis a 0-based inclusive offset into the line's text and--endis exclusive, counted in UTF-16 code units — the same[start, end)range extensions use- Tones:
match(default),info,warning,error,dim;currentrenders as reverse video and is best reserved for the one range under discussion - Pass
--focusto also land the viewport on the marked line - Marks survive scrolling, navigation, and reloads that leave the marked file's content unchanged; a reload that changes that file drops its marks, and
highlight clearremoves them explicitly (optionally per--file) - Marks are visual only — pair them with a
comment addwhen the explanation should persist as a note
Experimental rich markup notes (STML)
Only use STML when hunk session context --json lists stml in experimentalFeatures. The user opts into that experience by launching the review with --experimental; do not ask a normal session to render markup.
For an opted-in session, --markup (or a markup field on apply items) renders the note body as STML — a small HTML-like markup for terminal UI (boxes, rows, gauges, badges, lists, code). Keep --summary a real sentence: it is the fallback and the comment list text.
Before writing markup, run hunk markup guide once — it has copy-paste patterns and the width rules. The session context also reports noteMarkupWidth (the live render width); preview with hunk markup render - --width <that>. Comment responses echo markupWidth and return markupNotes when markup degraded — fix what they flag.
New files in working-tree reviews
hunk diff includes untracked files by default. If the user wants tracked changes only, reload with --exclude-untracked:
hunk session reload --repo . -- diff --exclude-untrackedGuiding a review
The user may ask you to walk them through a changeset or review code using Hunk. Start with hunk session review --json to understand the file/hunk structure without inflating agent context, then use --include-patch only for the files you truly need to read in raw diff form. Use context and navigate to line up the user's current view before adding comments.
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 (
reloadif needed) - Navigate to the first interesting file / hunk
- Add a comment explaining what's happening and why
- If you already have several notes ready, prefer one
comment applybatch over many separate shell invocations - 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
- Use
highlight add --focusto steer the user's eyes to the exact expression while you explain it, andhighlight clearbefore moving to the next topic - Use
comment applyfor agent-generated batches andcomment addfor one-off notes - Use
--focuson your first note so agent notes become visible, then sparingly when a note should actively steer the review - 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 diff file matches ..." -- the file is not in the loaded review. Check
context, thenreloadif needed. - "No active Hunk sessions" -- if Hunk is visibly running, localhost may be blocked by the agent sandbox; retry with network/sandbox escalation. Otherwise ask the user to open Hunk.
- "Multiple active sessions match" -- pass
<session-id>explicitly. - "No active session matches session path ..." -- for advanced split-path reloads, verify the live window
Pathviahunk session getorlist, then use--session-path. - "Pass the replacement Hunk command after
--" -- include--before the nesteddiff/showcommand. - "Pass --stdin to read batch comments from stdin JSON." --
comment applyonly reads its batch payload from stdin. - "Specify exactly one navigation target" -- pick one of
--hunk,--old-line, or--new-line. - "Specify exactly one comment target" -- pass
comment addone of--old-lineor--new-line. - "Specify exactly one highlight target" -- pass
highlight addone of--old-lineor--new-line. - "Highlight --end must be greater than --start" -- offsets are
[start, end)UTF-16 code units into the line text; end is exclusive. - "Specify either --next-comment or --prev-comment, not both." -- choose one comment-navigation direction.
- "The session daemon is ..." -- a
daemon-build-mismatch(the--jsonerror carriesdaemon,cli,attachedSessions, andrecommendedAction). Tell the user which build is newer and how many windows are attached, then ask before runninghunk daemon restart --yes; never restart unprompted. After the restart, windows that failed to register attach on their own, so re-runhunk session listinstead of relaunching anything. WhenrecommendedActionisuse-newer-hunk, the daemon is the newer build: use that Hunk instead. - "Could not read the raw diff for ..." -- the session reloaded or closed while
--include-patchwas reading it. Re-runreview; drop--include-patchif you only need file and hunk structure.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

