Marginalia is a disposable macOS review app for agent-written drafts.
It opens when a draft hits disk, lets you edit inline, captures short rationales only when they matter, then returns a clean bundle the agent can use immediately.
Desktop review surface: change rail, manuscript editor, and focused rationale column.
The normal loop is lossy:
- The agent writes a draft.
- You edit it somewhere else.
- You explain those edits back to the agent.
- The agent guesses what to repeat.
Marginalia removes the translation step. Your edits become the feedback channel.
- Opens one markdown file in a native review window.
- Shows a stable change rail, a manuscript editor, and a focused rationale surface.
- Computes diffs from rendered plain text so edits read like editorial changes, not character noise.
- Lets you add change-bound rationales with
⌘/and session notes with⌘G. - Persists recovery snapshots and marks ambiguous note remaps as stale instead of silently moving them.
- Writes a 7-file review bundle on close.
Requires macOS and jq.
brew install jq
curl -fsSL https://raw.githubusercontent.com/samay58/marginalia/main/scripts/install.sh | bashIf the CLI lands in ~/.local/bin, add that directory to PATH.
Marginalia is designed to run from a post-write hook.
Global Claude Code hook:
marginalia init --globalProject-local hook:
marginalia initAsync hook mode:
marginalia init --asyncDefault trigger rules:
- files ending in
-draft.md - files containing
<!-- REVIEW -->
If your CLI supports post-write hooks, call marginalia open <file> --out <status-path> and feed the resulting summary_for_agent.md back into the agent.
Open a file directly:
marginalia open ./draft.mdOpen with explicit bundle and status output paths:
marginalia open ./draft.md \
--bundle-dir ~/.marginalia/bundles \
--out /tmp/marginalia.status.jsonOptional writing principles:
marginalia open ./draft.md --principles ~/WRITING.mdBundles are written to:
~/.marginalia/bundles/[timestamp]_[filename]/
Each bundle contains:
original.mdfinal.mdchanges.jsonannotations.jsonchanges.patchprovenance.jsonsummary_for_agent.md
summary_for_agent.md is the primary agent input. The other files exist for exactness, automation, and debugging.
| Key | Action |
|---|---|
Esc |
Finalize review and write bundle |
⌘ Enter |
Finalize review |
⌘ / |
Start a rationale for the nearest edit |
⌘ G |
Toggle session notes |
⌘ O |
Open a different draft |
⌘ ⇧ O |
Toggle references |
⌘ Z |
Undo |
⌘ ⇧ Z |
Redo |
pnpm install
pnpm tauri dev
pnpm run check:diff
pnpm run check:annotations
pnpm run check:semantic
pnpm run check:bundle
pnpm run check:hook
pnpm run check:lint
pnpm run check
pnpm run buildNotes:
pnpm devserves the marketing site.pnpm tauri devruns the desktop review app at/review.pnpm tauri:build:appbuilds the.app.pnpm tauri:build:dmgbuilds the DMG release artifact.
MIT
