Built for the agent loop
Mark a file viewed and it stays viewed across rebases and
force-pushes — marks are keyed to content, not line numbers, so only
files that actually changed come back for a second look.
Annotate a hunk with c, then margin --notes
prints every remark as Markdown with path:line anchors.
Paste it into a pull request, or hand it straight back to the agent
that wrote the code.
Acts on the diff
Stage and unstage hunk by hunk with s / u, or
discard one with x. Accepting and rejecting an agent's
edits never means switching tools.
Staging touches the index only. Discard — the one destructive key —
writes a backup patch to .git/margin/trash/, makes you
type yes, and is reversible with margin undo.
Instant, and honest about it
First paint in about 4 ms on a 100-file diff, 15 ms on a
250k-line lockfile — measured with criterion, budgets enforced in CI.
Syntax highlighting is budgeted per frame, so no diff can freeze the UI.
A good terminal citizen
Safe as core.pager: piped output is byte-identical to its
input, by contract and by test. Honours NO_COLOR, degrades
to a real 16-colour palette instead of mangled RGB, and picks a light
or dark theme from your terminal's own background.