Skip to content

Commit 0e4b9ee

Browse files
authored
docs: clarify README agent workflows (#80)
1 parent a750e5e commit 0e4b9ee

1 file changed

Lines changed: 35 additions & 8 deletions

File tree

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Each example includes the exact command to run from the repository root.
109109

110110
## Config
111111

112-
Hunk reads config from:
112+
You can persist preferences to a config file:
113113

114114
- `~/.config/hunk/config.toml`
115115
- `.hunk/config.toml`
@@ -124,15 +124,35 @@ wrap_lines = false
124124
agent_notes = false
125125
```
126126

127-
## Live sessions and agent workflows
127+
## Working with Agents
128128

129-
Hunk can load inline rationale from a sidecar and lets you steer a live review window from another terminal or agent process.
129+
Hunk supports two agent workflows:
130130

131-
- `hunk diff --agent-context <file>` or `hunk patch --agent-context <file>` shows inline agent rationale beside the diff
132-
- `hunk session ...` inspects, navigates, reloads, and annotates a running Hunk session
133-
- `skills/hunk-review/SKILL.md` helps coding agents steer a live Hunk review and write inline Hunk annotations
131+
- steer a live Hunk window from another terminal with `hunk session ...` (recommended)
132+
- load agent comments from a file with `--agent-context`
134133

135-
Normal Hunk sessions start and register with the local loopback session daemon automatically. In most cases, use `hunk session ...` and ignore `hunk mcp serve`.
134+
### Steer a live Hunk window
135+
136+
Use the Hunk review skill: [`skills/hunk-review/SKILL.md`](skills/hunk-review/SKILL.md).
137+
138+
A good generic prompt is:
139+
140+
- "Load the Hunk skill and use it for this review."
141+
142+
That skill teaches the agent how to inspect a live Hunk session, navigate it, reload it, and leave inline comments.
143+
144+
### How remote control works
145+
146+
When a Hunk TUI starts, it registers with a local loopback daemon. `hunk session ...` talks to that daemon to find the right live window and control it.
147+
148+
Use it to:
149+
150+
- inspect the current review context
151+
- jump to a file, hunk, or line
152+
- reload the current window with a different `diff` or `show` command
153+
- add, list, and remove inline comments
154+
155+
Most users only need `hunk session ...`. Use `hunk mcp serve` only for manual startup or debugging of the local daemon.
136156

137157
```bash
138158
hunk session list
@@ -148,7 +168,14 @@ hunk session comment clear --repo . --file README.md --yes
148168

149169
`hunk session reload ... -- <hunk command>` swaps what a live session is showing without opening a new TUI window.
150170

151-
Use `hunk mcp serve` only for manual startup or debugging of the local session daemon.
171+
### Load agent comments from a file
172+
173+
Use `--agent-context` to attach agent-written comments or rationale from a JSON sidecar file. For a compact real example, see [`examples/3-agent-review-demo/agent-context.json`](examples/3-agent-review-demo/agent-context.json).
174+
175+
```bash
176+
hunk diff --agent-context notes.json
177+
hunk patch change.patch --agent-context notes.json
178+
```
152179

153180
## Contributing
154181

0 commit comments

Comments
 (0)