v0.2 · an MCP server for Claude Code, Cursor and Codex
Your agent writes the formula. excyst proves it.
1,038 verified formulas, and a prover that runs your code against them. It catches the bugs that never crash: a log in the wrong base, n where the formula has n−1, a dropped 21, a softmax that overflows.
Recorded in a real terminal: excyst proves an agent's kl_divergence wrong, names the mistake, and passes it after a one-token fix. The second film is the same bug caught inside a coding agent.
Recorded at normal speed from excyst 0.2.1 running in bash: every frame is the program's own output. The one change from outside is the fix, written to metrics.py between the two runs. The music was composed for the film and stays off until you turn it on.
Read it as text
1 · Open
In a folder with the tour's metrics.py, type excyst. The screen opens on four first steps.
2 · Prove
In the screen: prove metrics.py:kl_divergence. The same command as plain text gives:
provekl_divergence← metrics.py:kl_divergence
formula KL(p‖q) = Σₓ p(x) log( p(x)/q(x) )
chosen the function name matches the formula id kl_divergence
inputs p, q passed by name FAIL agrees on 0 of 25 inputs worked example ✗why × 1/ln 2: log base 2 where this formula uses the natural log (bits instead of nats) [convention] if that convention is the one you want, the code is fine; otherwise it is the fixexample p=[0.5, 0.5] q=[0.9, 0.1] (worked example)yours 0.736966
reference 0.510826 (also computed independently: 0.510826)1 ms
3 · Fix
In metrics.py, outside excyst, np.log2 becomes np.log.
4 · Proved
The up arrow brings the command back, and enter runs it again:
provekl_divergence← metrics.py:kl_divergence
formula KL(p‖q) = Σₓ p(x) log( p(x)/q(x) )
chosen the function name matches the formula id kl_divergence
inputs p, q passed by name PASS agrees with the reference on all 25 inputs (the worked example ✓ and 24 random, seed 0)1 ms
5 · Search
kl divergence is not a command, so it searches the formulas:
4 formulas for 'kl divergence'kl_divergence Kullback–Leibler divergence information theory
KL(p‖q) = Σₓ p(x) log( p(x)/q(x) )
kl_mvn KL divergence between multivariate Gaussians information theory
KL(N₀‖N₁) = ½[tr(Σ₁⁻¹Σ₀) + Δμᵀ Σ₁⁻¹ Δμ − k + ln(|Σ₁|/|Σ₀|)]
kl_gaussians KL divergence between two Gaussians information theory
KL = ln(σ₂/σ₁) + (σ₁² + (μ₁−μ₂)²) / (2σ₂²) − ½
vae_kl VAE KL term (diagonal Gaussian) deep learning
KL = −½ Σⱼ (1 + log σⱼ² − μⱼ² − σⱼ²)
type formulas <id> for the full formula, symbols and a worked example
6 · Quit
A slash opens the list of commands. Ctrl-c twice goes back to the shell.
The agent's turns are illustrated. Every excyst result is real output, slowed down so you can follow it: the two proofs took 11 ms and 9 ms.
Read it as text
Real output
Everything runs. Five of six are wrong.
An agent asked for “the usual evaluation helpers” wrote metrics.py. No errors, plausible numbers. excyst matches each function to a verified formula and proves it. Every line in this terminal was recorded from the real CLI.
Type in it:
The bugs that don't crash
Wrong numbers look like numbers.
Tests check that code runs. Reviewers check that it reads well. Nobody checks that log is the right log. excyst does, and when it fails it says which mistake it was.
np.sum(p * np.log2(p / q))convention
×ln21
On every input: log base 2 where the formula uses the natural log. Bits, not nats.
s / math.sqrt(n - 1)convention
×n−1n
Divides by n−1 where the standard error divides by n.
np.var(x)convention
×nn−1
The population variance where the sample variance was asked for.
… / (2 * s2 ** 2)bug
+21
On every input: the −21 of the Gaussian KL divergence was dropped.
1 - x @ y / (‖x‖ ‖y‖)bug
1−cosθ
A cosine distance returned where the similarity cosθ was asked for.
np.exp(z) / np.exp(z).sum()overflow
e1000=∞,∞∞=nan
Right on 25 inputs, nan at magnitude 1000 where the answer is finite. Subtract the max first.
Silent wrong numbers are a known failure of generated code: one 2026 benchmark of LLM-written dosing code found its failures were silent, including 60-fold errors, and identically named metrics already disagree across libraries. The evidence
How a proof works
An oracle that cannot share your mistake.
01
Match
Each function is matched to a formula by its name or docstring, or you name one. Inputs are passed by name, or in the formula's order.
02
The worked example
Your code runs on the formula's worked example, whose answer was computed separately from the reference. The test suite proves every one of those answers fails when it is wrong.
03
Fresh inputs
24 new inputs drawn from the formula's domain on every run: distributions stay on the simplex, covariances stay positive-definite. Hard-coding the example fails.
04
The diagnosis
A mismatch is tested against the usual causes: log base, n vs n−1, a missing 21 or 2π, sign, complement, square vs root, transpose, overflow. Conventions are labelled, because bits may be what you meant.
verified formulas
1,038
of 1% errors caught
97.4%
×2 and log-base bugs named
99.7%
median proof
1 ms
Measured over the whole library by mutating its own references. “Prove” means agreement with an independent reference on the worked example and fresh random inputs: strong evidence, not a formal proof. What it cannot do
The formula sky
1,038 stars. Every one checked.
Each point is a formula, grouped by field; lines join related ones. Drag to turn the sky, hover to read, click to open it.
In your daily loop
Let the agent check itself.
excyst runs as an MCP server for Claude Code, Cursor, VS Code and Codex. Before your agent writes a metric it reads the verified definition; after, it proves the code and fixes what fails, without you asking.
find_formula search 1,038 formulas by name or idea
get_formula definition, conventions, worked example
prove · prove_file code against the reference
check_model calibration, coverage, robustness
One command finds Claude Code, Cursor and Codex on the machine and adds excyst to each:
excyst connect --write
Or by hand:
claude mcp add --scope user excyst -- excyst mcp
Once excyst is installed, one click adds it to Cursor:
Add to AGENTS.md or CLAUDE.md so it is used unprompted:
When you write or change code that computes a formula, use the excyst MCP tools: get_formula before writing it, prove after. A FAIL is a failing test. If the diagnosis is a convention, say which one the code uses on purpose.
Why not ask the model to check itself?
A checker is only worth what it doesn't share.
Independent
A model checking its own formula repeats its own convention. excyst's answers were computed apart from its reference code and are mutation-tested, so a shared mistake has nowhere to hide.
Ungameable
Fresh inputs from a seed on every run. An agent that learns the worked example still fails, and the seed makes any failure reproducible.
Specific
Not a red cross: the factor, the convention, the input that is mishandled and a counterexample. An agent can act on that in one step.
Yours
Runs on your machine with numpy. No account, no key, no network, the same answer every time. Free, and fast enough to run on every save.
Some calibration labels may be wrong. Name which ones and cap how many, and at any threshold the paper gives the exact best and worst number of calibration points covered once they are corrected. The robust threshold is the smaller of two familiar order statistics, so it takes linear time.
It also says where the method loses: on CIFAR-10N human labels, auditing 1,000 random labels gave smaller prediction sets at the same 90% coverage target, a mean size of 1.311 against 1.547.
excyst check holds a trained classifier to an objective you commit: calibration, accuracy, conformal coverage, robustness to noise and reproducibility, each with pass or fail and what to try next.
$ excyst demo
PASS accuracy 0.9090 >= 0.8
FAIL calibration (ECE) 0.0639 <= 0.03 confidence over-states accuracyPASS coverage @ 90% 0.9240 >= 0.880
PASS reproducible identical same inputs, same reportFit one temperature on held-out validation data: T = 3.96.PASS calibration (ECE) 0.0166 <= 0.03