Skip to content

Review with an agent

The Hunk window stays with you. Your agent uses non-interactive hunk session commands from another terminal to inspect the same review, navigate it, and leave inline notes.

Terminal window
hunk diff

Keep that window open. Normal Hunk sessions register with a local loopback daemon so the session CLI can find them.

In the agent's shell, locate the skill bundled with the installed Hunk version:

Terminal window
hunk skill path

Ask the agent to load that file and use it for the review. A portable prompt is:

Load the Hunk skill and use it for this review. Run `hunk skill path` to get the skill path.

The skill tells agents not to launch the interactive TUI themselves. It teaches them to use the session surface instead.

A typical agent flow is:

Terminal window
hunk session list
hunk session get --repo .
hunk session review --repo . --json
hunk session navigate --repo . --file src/App.tsx --hunk 2
hunk session comment add --repo . --file src/App.tsx --new-line 42 --summary "Check this boundary"

review --json exposes structure without forcing the full patch into agent context. The agent should request --include-patch only when it actually needs raw unified diff text.

A Hunk review with agent rationale rendered directly beside the annotated diff hunk

Agent notes remain spatially attached to the code they explain. Use { and } to move between annotated hunks while keeping the full changeset visible.

The agent can guide the visible selection and add agent-authored notes, but you remain in the review stream and can navigate normally. Ask it to summarize when finished, then use { and } to walk annotated hunks.