Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/nasqret/lean-interact/mathlib-lookupnpx skills add nasqret/lean-interact --skill mathlib-lookupgit clone --depth 1 https://github.com/nasqret/lean-interactWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/nasqret/lean-interact/mathlib-lookup)<a href="https://agentmods.dev/skills/nasqret/lean-interact/mathlib-lookup"><img src="https://agentmods.dev/badge/skills/nasqret/lean-interact/mathlib-lookup.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00170 | $0.02369 |
| Opus 5 | $0.00085 | $0.01184 |
| Sonnet 5 | $0.00034 | $0.00474 |
| Haiku 4.5 | $0.00017 | $0.00237 |
Grade A, and why
mathlib-lookup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.
mathlib-lookup
This skill exists for the user's single stated pain point: they know the mathematics and not the Mathlib name. Two consequences govern everything below.
- A name is a claim, and claims get checked. Nothing unverified is ever reported, used, or written - not even hedged with "I think". A hedge disappears the moment the name is repeated.
- A name alone is not an answer. Report the real elaborated type. The user needs the hypotheses and their order to use the lemma; the name is only the handle.
Repository root: /path/to/lean-interact.
The escalation, in order of cost
Stop at the first step that yields a verified name.
1. Dot completion (free, when a hypothesis exists)
If the user has h : Nat.Coprime a b in context, the whole Nat.Coprime namespace is
reachable as h.something, and the editor's completion list is guaranteed correct for this
Mathlib. Tell the user to type h. in the VS Code infoview pane. The programmatic equivalent is
step 2's --namespace.
2. Guess from the naming grammar (seconds)
Read vault/Naming Conventions.md. Construct the name rather than recall it:
- Say the statement in Mathlib's vocabulary: "modEq iff dvd", "le of dvd", "prime dvd mul".
- Conclusion first, hypotheses after
of_; symbols become fragments (+->add,∣->dvd,↔->iff,≤->le,^->pow,%->mod/emod). - Namespace = the type of the distinguished hypothesis, or the head of the conclusion.
- Casing migration:
natCastnotnat_cast,intCastnotint_cast. Pre-2024 sources and mathlib3 names are systematically wrong. - Always try the primed variant too;
'means different hypotheses or argument order (Nat.modEq_iff_dvdvsNat.modEq_iff_dvd').
Then verify (step 4). A guess that verifies costs one command.
3. Search with tools/mlq.py (seconds)
python3 tools/mlq.py "modEq iff dvd" # free text over names and statements
python3 tools/mlq.py --about "chinese remainder" # by informal topic
python3 tools/mlq.py --concept ModEq # by the concept appearing in the statement
python3 tools/mlq.py --namespace Nat.Prime # the whole API of a namespace or type
python3 tools/mlq.py --help # authoritative; the tool wins over this note
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 184 lines · 170 tokens per session scan A 0e8b13c4663c
mathlib-lookup is a skill published in the GitHub repository nasqret/lean-interact (10 stars, last pushed 26d ago), licensed MIT. It adds 170 tokens to every session and 2,369 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
screen
Screen informal↔Lean 4 statement pairs for faithfulness defects. Use whenever writing, editing, translating, or reviewing Lean 4 theorem or definition statements that are meant to formalize informal mathematics: after drafting a statement, before committing formalizations, when auditing a benchmark file, or when the…
learn-from-math-agent-trajectories
Review completed or paused mathematical agent transcripts, visible reasoning, code, searches, tool calls, corrections, and final claims to extract evidence-backed lessons for Jacobian operations, discovery, contracts, skills, evaluations, and documentation. Use for mathematical workflow retrospectives and "what should…
mathlib-api
Evidence-driven workflow for designing a Mathlib definition and the API around it. Use when adding a new structure/def intended for mathlib; when choosing between design alternatives (index type as field vs parameter, Set vs indexed family, coarse set vs finer indexed structure and when the fine one should exist at…
lean-probe
Fast Lean 4 proof verification for coding agents via the LeanProbe MCP server's warm REPL. Use when you need to know whether Lean 4 code compiles (no errors, no sorry), iterate on a declaration inside a Lake/Mathlib project, test a replacement proof candidate, or explore a goal tactic by tactic — far faster than lake…
book-mirror
Take any book (EPUB/PDF), produce a personalized chapter-by-chapter analysis. Each chapter is preserved in detail (The Chapter) and mirrored back to the reader's actual life (The Mirror) using brain context. The mirror observes and resonates — a friend pointing out parallels, NOT a consultant rearranging the reader's…
ljg-learn
Deep concept anatomist that deconstructs any concept through 8 exploration dimensions (history, dialectics, phenomenology, linguistics, formalization, existentialism, aesthetics, meta-philosophy) and compresses insights into an epiphany. Use when user asks to explain, dissect, or deeply understand a concept, term, or…