Hand a document to a human.
Get structured comments back.
An agent writes a spec, a schema, a config, a diagram, a diff. Marginalia renders it as a page, the reviewer clicks a block and comments, and every comment lands on disk as an append-only JSONL event the agent reads directly.
No database. No accounts. No copy-paste step between the browser and the agent.
Install
One binary. It serves a page and writes a log beside your file.
Nothing to configure before the first review. Point it at a document and it prints a URL.
$ brew install --cask gruesomeparty/tap/marginalia$ go install github.com/gruesomeparty/marginalia@latest$ /plugin marketplace add gruesomeparty/marginalia$ /plugin install marginalia$ marginalia serve plan.md
marginalia: serving plan.md at http://127.0.0.1:8787
marginalia: feedback → plan.md.feedback.jsonl
The loop
How a review actually goes.
Five steps, and then it goes round again. Nothing in the middle is a human retyping something into a chat window.
Anchoring
Every block is anchored three ways.
A stable id, the quote the note was written against, and a hash of the block's content. Edit the document and the comments re-anchor themselves.
When the text a note points at has itself changed, the note comes back flagged stale rather than silently pointing at the wrong paragraph. That is the whole trick, and it is the reason the loop can survive more than one round.
{"doc":"plan.md","block":"1.2/2","quote":"The batch cap is 500 records.","hash":"83be6e423f0d","type":"question","text":"why no backoff? the queue will hammer the upstream","author":"berkay","ts":"2026-09-18T23:53:25Z"}
{"doc":"plan.md","block":"1.2/2","type":"reply","reply_to":"e206687d85b0","text":"Fair — switching to exponential with jitter.","author":"agent"}
01 · Selection
Comment on a sentence, not the paragraph.
Select text and the note anchors to that sentence. Rewrite the sentence before it and the note stays exactly where it was.
Rewrite the sentence itself and it goes stale — honestly, and in the reviewer's face rather than quietly.
Tokens are minted by the auth service and verified at the edge. Rotation happens weekly, on Sunday at 03:00 UTC. Clients cache the JWKS document for one hour.
02 · Diagrams
Click the arrow in a diagram.
Mermaid flowcharts are drawn as real pictures whose shapes carry the same anchors as the source.
Click a node and you are commenting on that node. Click an edge and you are commenting on that edge — not on the line of Mermaid that drew it. The picture is in the demo above; this is what a note on one looks like.
03 · Diffs
Review a unified diff the way you'd review prose.
Anchored by file and hunk — the thing a human is most often asked to approve.
A hunk is anchored by its position in the file, not by line number, so regenerating the patch after an earlier hunk changes doesn't orphan the notes below it.
04 · Replies
The agent answers back, and the answer is checked.
A reviewer's question gets a reply threaded under it. The agent records which note a change addressed.
That claim is checked against whatever the note is about — the block, or the one sentence. Claim you fixed it without touching the text and the page says so, in front of the person who asked.
“the counter is reset at midnight”
Midnight in which timezone? This will be wrong for half our customers twice a year.
reviewer
Changed to a rolling window anchored on first request. No midnight, no timezone.
the text changed · claim holds“retries are capped at three”
Three retries against a cold upstream is a thundering herd. Add jitter.
reviewer
Added jitter to the retry schedule.
unchanged since the note · claim not supportedAlso reads
Same anchoring model, different parser.
Scope
What it deliberately does not do.
Worth knowing before you install it rather than after.
Try it on the next thing your agent writes.
Takes one command and a document you were going to have to read anyway.
$ brew install --cask gruesomeparty/tap/marginalia