Margin

← → walk · s source · esc


      

Settings

Theme
Alignment
Density

Preamble

One \newcommand per line, applied to every render. Claude can add to this with margin macro.

Export

Session Pinned

Keyboard shortcuts

Keyboard

Esc closes this.

Margin

A second window for the mathematics in a Claude session. Claude stays where it is, in the terminal or on the web; every display formula it writes appears here, rendered by a real TeX engine, and stays.

Using it with Claude Code

Claude Code your terminal Margin this page Stop hook
  1. One line, Node 20 or newer. It clones the repo, links the margin command, installs the hook and the skill, and opens the desk.

    git clone git@github.com:tomburgerch/pr-margin.git ~/margin && cd ~/margin && npm install && npm link && margin install && margin

    margin install changes exactly two things: a Stop hook in the Claude Code settings, and a skill symlink at ~/.claude/skills/margin. Both come back out with margin uninstall.

  2. Margin runs beside Claude Code, not inside it. Keep the conversation on one screen and the desk on the other; margin wants a terminal of its own and nothing else.

  3. Restart any Claude Code session that was already open. Hooks are read when a session starts, so a session you opened before margin install captures nothing. That is the usual reason a new desk stays empty.

  4. Then talk about mathematics the way you would anyway. As each turn ends, every display formula in it lands here. You never ask Claude to send anything, and you never type a Margin command unless you want something deliberate.

  5. The deliberate things are sentences, not commands. You say them; Claude runs the verb.

    Pin that.
    margin pin 42
    Let us try the Hamiltonian route.
    margin path "Hamiltonian route"
    The sign in #57 is wrong, fix it.
    margin push --replaces 57
    What did we try?
    margin list
  6. Everything lives in one file, ~/.margin/store.json. If the desk is not running when Claude writes, the turn waits in ~/.margin/spool.jsonl and lands the next time you start it, so beginning with Claude costs nothing.

What you are looking at right now

How it works

Without Claude Code

There is no hook on claude.ai, but the page reads any text you hand it. Copy a Claude reply and press Cmd/Ctrl+V anywhere outside a field: every $$ block, \[ \] block and bare align or equation environment becomes a formula, with the line above it as its label. The slim field at the bottom of the stream does the same for text you type.

Keyboard

Margin is keyboard first, and the list is kept in one place: or press ?.

github.com/tomburgerch/pr-margin · Built on MathJax 3.

Move to path