An explanation compiler for Claude Code

Explainer

Ask how something works, and get the explanation that costs you the least effort: usually a short answer in precise, plain prose, built from first principles; a diagram, an interactive page, or a narrated animation when the structure needs one. Every artifact is checked against a small model of the subject, for what it leaves out and for what it says that you did not need.

Inspired by Andrej Karpathy's post on the ladder from STE-style writing to diagrams, HTML, and 3b1b-style explainer videos.

Compiler demo

One model, four renderings

Every rendering of softmax temperature is compiled from one model.md. The terms and the numbers are the same in each one. Normal routing would stop at Stage 3; this folder renders all four to show that they agree.

                                ┌─ 1 · controlled prose
question -> model -> narrative ─┼─ 2 · diagram
             probe    cold read ├─ 3 · interactive page
                                └─ 4 · animated video

then: check · review sheet · cold read · blind test
Omission and excess

Checked in both directions

An explanation costs the reader effort in two ways: what it leaves out, and what it says that the reader did not need. A fresh agent reads every published explainer cold, as its stated audience, and reports both. explainer check holds every number to the model and every rendering to a length budget. In chat, the same principles give shorter, better answers. explainer eval chat graded six answers about phenomena blind (score out of 10; unneeded passages per answer):

PrinciplesScoreWordsUnneeded
none6.33994.7
v0.5.07.25445.0
current7.82921.5

The cold reads also found real errors: a Dijkstra argument that said "reaching D costs at least ten" seconds before D became eight, and a git bisect remedy that could not find the bug it was meant to find. Evals · Concepts

Stage 4 · Manim + local Kokoro voice · no API keys

Videos

Softmax temperature · 93 s. The distance between two dots sets their probability ratio, so the viewer sees why low T sharpens and high T flattens, and why softmax needs exp: dividing by the sum gives owl −0.4.
STE-80 rewrite · 97 s. One manual sentence through three Simplified Technical English rules, 16 → 9 words. Kept words move; removed words fade. The narration is in STE.
Odd numbers make squares · 4 min 21 s. A proof by picture, compiled beat by beat from a narrative: each odd number is an L that grows the square by one, and each L is two bigger than the last. Every letter and color is introduced before it is used.
Dijkstra's shortest paths · 3 min 23 s. The run from the model, replayed: why the smallest estimate settles first, why a settled estimate is final, and one negative edge that breaks it.

Three videos stop where a learner should predict first: commit a guess, then the video continues. The chapter buttons jump to each pause.

Narration and animation stay in sync through bookmarks in the script. The local voice service synthesizes each bookmark segment separately, so every bookmark time is exact, with no Whisper pass.

Routing

The simplest medium that keeps the structure

StageUse when the subject is mainly…Escalate when…
1 · prosea procedure, a definition, an argument—
2 · diagramtopology, flow, architecturethe reader must hold three or more relationships at once
3 · interactivea parameter, scenarios, drill-downthe reader must explore states or alternatives
4 · videoa transformation over timeunderstanding depends on seeing state A become state B
Stage 1 · prose

Find the commit that introduced a bug

git bisect is a linear procedure with one loop. Numbered steps carry all of it, so the router stops here.

Stage 2 · diagram

What git stores when you commit

Blobs, trees, commits, and refs are pure topology. Nothing moves and nothing is tuned, so one diagram is enough.

Stage 3 · interactive

Why a CDN makes a request faster

Two distances and a cache state set the answer. Predict the no-CDN time, then compare three paths side by side.

Stage 1 + 2 · prose and diagram

Why the sky is blue, and the setting Sun red

A phenomenon from first principles: scattered power goes with the electron's acceleration squared, so blue scatters 5.86 times more than red. 650 words, by budget.

Stage 3 · interactive

How a higher interest rate lowers inflation

Switch the assumptions economists disagree about (anchored expectations, the cost channel, the neo-Fisherian view) and watch output and inflation over 16 quarters.

Stage 3 · interactive

How self-attention works

One token, four levels. Remove one part at a time (content weights, a separate query, √d, the mask) and see what breaks.

Quick start

Install

/plugin marketplace add ifrit98/Explainer      # in Claude Code
/plugin install explainer@explainer
/explainer:explain how does a bloom filter work
/explainer:video why the derivative of sin is cos
/explainer:verify bloom-filter                  # model check, review sheet, blind test

Video also needs brew install uv cairo pango pkgconf ffmpeg and a one-time explainer setup for the local voice.