You derived something. Implemented it. Code ran fine. Two weeks later: the sign was wrong.
vibe-check is a Claude Code agent for catching that. It makes you declare conventions before deriving anything, tags results with confidence levels, and writes PyTorch snippets to verify the algebra numerically. When it doesn't know a sign convention, it says so.
Works across math in general. Knows quantum computing, linear algebra, representation theory, and Lie algebras well.
Checks derivations step by step. Convention declarations up front, numerical sanity checks at the end. Catches notation conflicts between papers (same symbol, different meaning in each). Translates math into runnable PyTorch with unitarity checks and gradient verification against finite differences. Flags claims that go beyond what's actually been proven. Constructs exact matrices in reduced subspaces where basis ordering quietly breaks things. Computes Lie algebra generators, commutators, dimension checks. Builds compound matrices C^(k)(O) with exterior power representations.
Won't plan your experiments. Won't brainstorm. Wrong tool for that.
# Marketplace (recommended)
/plugin marketplace add SnehalRaj/vibe-check
/plugin install vibe-check@vibe-check
# Or add directly
claude plugin add SnehalRaj/vibe-check
# Or clone
git clone https://github.com/SnehalRaj/vibe-check.git ~/.claude/plugins/vibe-checkBefore any derivation, the agent states conventions: Hilbert space, basis ordering, tensor convention, parameterization, what the matrix acts on. Ambiguous convention? It picks one and marks it [UNCERTAIN].
Convention Declaration:
- Space: HW=3 subspace of 6 qubits, dim = C(6,3) = 20
- Basis: lexicographic ordering of weight-3 bitstrings
- Tensor convention: qubit 0 is leftmost
- Parameterization: R(theta) = exp(-i theta G/2)
- Matrix acts on: reduced subspace basis vectors
Every result gets tagged. No bare assertions.
| Tag | Meaning |
|---|---|
[EXACT] |
Proven under stated conventions |
[APPROX: regime] |
Valid in a specified regime |
[ASYMPTOTIC] |
Leading-order behavior |
[CONJECTURE] |
Plausible but unproven |
[UNCERTAIN] |
Convention-dependent or unverified |
Derivations longer than three steps follow a fixed protocol:
- Setup (symbols, spaces, basis, assumptions)
- Strategy (2-4 lines max)
- Step-by-step derivation (each equality justified)
- Boxed result
- Sanity checks (dimensions, symmetry, limiting cases)
- PyTorch snippet that actually runs
- Ambiguity report (convention-sensitive steps flagged)
You can skip the numerical check, but you have to say so.
You: "I derived the gradient of tr(A exp(tB)) but finite differences don't match."
The agent declares conventions, gives the correct derivative, lists common sign errors (exp(tB) vs exp(-itB), missing factors of i), writes verification code, and tells you your step size is probably too large or you mixed up transpose with conjugate-transpose.
| Domain | Coverage |
|---|---|
| Linear algebra | Decompositions, subspace projections, eigenvalue perturbation, Kronecker products |
| Lie algebras | Generator listing, commutator verification, DLA dimension, su(d) generation claims |
| Representation theory | Compound matrices, exterior powers, irreducible decompositions, Schur-Weyl duality |
| Quantum circuits | Hamming weight subspaces, RBS/matchgate disambiguation, FLO simulatability |
| Optimization | Gradient verification, Hessian structure, parameter-shift vs finite differences |
| Statistics | Estimator bias/variance, sample complexity, concentration inequalities |
| PyTorch | Reduced-basis assembly, batched operations, autograd verification |
Give generic overviews. Use overloaded terms without defining them. Skip derivation steps. Present code without tests. Make algebra claims without checking small cases. Guess at paper statements from memory. Switch conventions without telling you. Say "polynomial" without specifying in what.
LLMs are confidently wrong about math. They'll produce a derivation with the wrong sign or a convention that doesn't match the paper they cite. It compiles. Tests pass. Sign was still wrong.
This agent won't skip steps, won't guess conventions, and checks numerically when it can.
PRs welcome. Agent definition is in agents/vibe-check.md. If your subfield has its own notation problems, adding domain instructions helps.
MIT License