You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`hunk session review --json` returns file and hunk structure by default. Add `--include-patch` only when a caller truly needs raw unified diff text in the response.
190
192
191
193
`hunk session reload ... -- <hunk command>` swaps what a live session is showing without opening a new TUI window.
192
-
Pass `--focus` to jump the live session to the new note.
194
+
Pass `--focus` to jump the live session to the new note, or to the first note in a batch apply.
195
+
196
+
`hunk session comment apply` reads one stdin JSON object with a top-level `comments` array. Each item needs `filePath`, `summary`, and exactly one target such as `hunk`, `hunkNumber`, `oldLine`, or `newLine`.
193
197
194
198
-`--repo <path>` selects the live session by its current loaded repo root.
195
199
-`--source <path>` is reload-only: it changes where the nested `diff` / `show` command runs, but does not select the session.
-`comment add` is best for one note; `comment apply` is best when an agent already has several notes ready
104
107
-`comment add` requires `--file`, `--summary`, and exactly one of `--old-line` or `--new-line`
105
-
- Pass `--focus` when you want to jump to the new note
108
+
-`comment apply` payload items require `filePath`, `summary`, and exactly one target such as `hunk`, `hunkNumber`, `oldLine`, or `newLine`
109
+
-`comment apply` reads a JSON batch from stdin and validates the full batch before mutating the live session
110
+
- Pass `--focus` when you want to jump to the new note or the first note in a batch
106
111
-`comment list` and `comment clear` accept optional `--file`
107
112
- Quote `--summary` and `--rationale` defensively in the shell
108
113
@@ -125,13 +130,14 @@ Typical flow:
125
130
1. Load the right content (`reload` if needed)
126
131
2. Navigate to the first interesting file / hunk
127
132
3. Add a comment explaining what's happening and why
128
-
4.Move to the next point of interest -- repeat
133
+
4.If you already have several notes ready, prefer one `comment apply` batch over many separate shell invocations
129
134
5. Summarize when done
130
135
131
136
Guidelines:
132
137
133
138
- Work in the order that tells the clearest story, not necessarily file order
134
139
- Navigate before commenting so the user sees the code you're discussing
140
+
- Use `comment apply` for agent-generated batches and `comment add` for one-off notes
135
141
- Use `--focus` sparingly when the note itself should actively steer the review
136
142
- Keep comments focused: intent, structure, risks, or follow-ups
137
143
- Don't comment on every hunk -- highlight what the user wouldn't spot themselves
@@ -143,5 +149,6 @@ Guidelines:
143
149
-**"Multiple active sessions match"** -- pass `<session-id>` explicitly.
144
150
-**"No active Hunk session matches session path ..."** -- for advanced split-path reloads, verify the live window `Path` via `hunk session get` or `list`, then use `--session-path`.
145
151
-**"Pass the replacement Hunk command after `--`"** -- include `--` before the nested `diff` / `show` command.
152
+
-**"Pass --stdin to read batch comments from stdin JSON."** -- `comment apply` only reads its batch payload from stdin.
146
153
-**"Specify exactly one navigation target"** -- pick one of `--hunk`, `--old-line`, or `--new-line`.
147
154
-**"Specify either --next-comment or --prev-comment, not both."** -- choose one comment-navigation direction.
0 commit comments