moonshine
Claude Code and Codex support for distilling interactive technical explanations from AI generated complexity.

Source-backed still examples:
The Still: Moonshine's Harness
(source) and
A Map of What Children Learn
(source).
AI tools generate complexity faster than people can consume it. Inspired by Distill.pub, moonshine helps apply distillation to the flood of technical output, turning complex ideas into explorable, visual, interactive articles.
Moonshine starts with story discovery — concept, audience, the one insight the reader should walk away with — before it writes any code, and renders the article on one of two substrates:
- still (
/moonshine:still) — a Vite + React + Velite project where prose lives in pristine markdown and figures are React components. This is the substrate with the authoring loop (below) and the default for anything that will keep being edited.
- shine (
/moonshine:shine) — a single self-contained HTML file with vanilla JS and D3. No build tools; one file you can email or host anywhere.
# Claude Code
/moonshine:still how gradient descent finds minima
# Codex
$still how gradient descent finds minima
The authoring loop (still)
While npm run dev runs, the rendered article is itself the editing surface, for both the author and the agent:
- Edit prose in place. Cmd/Ctrl+click any block to edit its raw markdown in the page; saves splice back into the
.md by source offset.
- Tune figures with knobs. Cmd/Ctrl+click a figure to open a panel generated from its
DEFAULTS; "Save to markdown" writes the tweaked values into the directive's attributes.
- Reorder sections. Cmd/Ctrl+drag any block (or use ↑/↓ in the editor) to move it: the block lifts and the others slide apart to show where it lands, and the markdown is rewritten.
- Edit on a tablet. Without a keyboard, touch and hold a block to edit it, keep holding and drag to reorder, and tap between blocks to add one. The diagram editor pans with one finger and zooms with a pinch.
- Arrange diagrams. The agent declares a diagram as a small spec (nodes, edges, groups); the author arranges it, and can change its boxes and arrows, in a dev-only direct-manipulation editor (labels edited in place, drag-to-connect, draggable arrow ends, alignment guides, auto-layout, notes, a reader frame, a separate narrow arrangement for phones), and readers get a live SVG diagram whose node labels never render below 13px. A node can be a labelled box or an icon tile (a built-in glyph, any Tabler icon, or an emoji) with its name beside it; links take a colour family and arrowheads at either end or both, and their labels carry direction marks; groups can be outlined, tinted, dashed or marked at the corners.
/moonshine:diagram holds the design rules, and the template's Diagrams page shows the range. The editor's gestures are declarative drags: an arrow's end re-routes live to the nearest side of any box, boxes join a group by being dropped in it, labels slide along their arrows, and undo animates. Regenerating the spec never clobbers the arrangement.
- Draggable figures. Figures that readers drag are built with declarative dragging (Dragology): a figure says which states dragging an element can reach, and the library works out the motion. Readers can drag outputs (a point on a computed path) and watch the inputs follow; the example article shows how.
- Add content with "+". Hover between blocks to insert text, a diagram (built in the same editor), or an uploaded image straight into the markdown; 💬 on it asks the agent to adjust it.
- Git as shared memory. Every browser save auto-commits with a
moonshine-edit: prefix, so the agent can see exactly what the author changed and build around their words.
- Suggestions from the agent. The agent (an editing pass,
/moonshine:critique) can leave proposed changes on the article instead of making them. Each shows under its passage as a word-level diff with Accept, Edit and Reject; a remark with no replacement can be sent back to the agent as a comment. The HUD toggles them and can accept or reject all.
- Comments back to the agent. The 💬 affordance sends feedback ("this is too hand-wavy") into
.feedback/ files that the agent picks up at turn boundaries (Stop hook) or via the idle listener (/moonshine:moonshine-listen).
All of it is dev-only: vite build produces a plain, read-only static page with none of the editing machinery in the bundle.
Install