Skip to content

Comments and annotations

Notes are hunk-specific and render beside the rows they explain. Hunk keeps them in the review flow rather than in a separate comments screen.

TermWhat it is
NoteAny card shown beside the code.
Agent commentA note an agent adds to a live window with hunk session comment. This is the recommended path.
Sidecar annotationA note loaded at launch from an --agent-context JSON file.
Your noteA note you write in Hunk with c.
HighlightA temporary mark on a character range. It draws attention but is not a note.

Agent comments and sidecar annotations are both agent notes. They start hidden: press a to show or hide them, or launch with --agent-notes. Your own notes are always visible.

Notes live in the Hunk window. Closing the window discards them.

Terminal window
hunk session comment add \
--repo . \
--file README.md \
--new-line 103 \
--summary "Tighten this wording" \
--focus

Choose exactly one --old-line or --new-line target. --focus moves the user's viewport to the new note and turns agent notes on; use it for the first note in a session and when a note should actively steer the review.

Optional fields:

  • --rationale <text>: a longer explanation shown under the summary.
  • --author <name>: the label on the note card, such as Claude note instead of Agent note.
  • --markup <stml>: an experimental rich body; see Agent context and STML.
Terminal window
printf '%s\n' '{"comments":[{"filePath":"README.md","newLine":103,"summary":"Tighten this wording"}]}' \
| hunk session comment apply --repo . --stdin --focus

Each item needs a summary and either:

  • filePath with exactly one target: hunk, hunkNumber, oldLine, or newLine, or
  • replyTo by itself, to reply to an existing note.

Items also accept rationale, author, and markup. Hunk validates the complete batch before changing the live session. --focus jumps to the first note in the batch.

A reply inherits the parent note's file and line:

Terminal window
hunk session comment add --repo . --reply-to user:123 --summary "Addressed in the latest revision"

Your notes are a way to ask the agent questions in context:

  1. Press c on a line and write the question.
  2. Ask your agent to read your notes. It runs hunk session comment list --repo . --type user --json or hunk session review --repo . --include-notes --json.
  3. The agent answers with --reply-to <note-id>, and the reply appears under your note.

Agents can remove your notes during cleanup but cannot create or edit them.

Terminal window
hunk session comment list --repo .
hunk session comment list --repo . --type all
hunk session comment rm --repo . <comment-id>
hunk session comment clear --repo . --file README.md --yes

comment list shows agent comments by default. --type selects other notes:

--typeLists
live (default)Comments added through hunk session comment
userYour notes
aiSidecar annotations
agentAgent-authored notes
allEvery note

comment clear removes agent comments. Add --all (or its synonym --include-user) to clear your notes too. Clearing always requires --yes.

In the TUI, move to a line and press c, or click an add-note affordance. Press Ctrl+S to save or Escape to cancel. Human and agent notes are labeled by source. Press { and } to move through annotated hunks across the review stream.