lean-probe

lean-probe is a skill for Claude Code, Codex from epfl-lara/LeanProbe. It costs 139 tokens per session (2,926 once invoked), scanned B, original, MIT.

A fast checker for Lean 4 code, where Lean 4 is a programming language used to write and verify mathematical proofs.

In plain words
What is it for?
Use it to check standalone snippets, test declarations inside a project, inspect Lean goals, and confirm that proofs compile without sorry.
Why use it?
It provides quick feedback while developing a proof, without waiting for a full project build after every small change.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads ~/.codex paths; mentions Codex.

Good fit Use it to check standalone snippets, test declarations inside a project, inspect Lean goals, and confirm that proofs compile without sorry.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/epfl-lara/leanprobe/skill
Install

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.

Any agent
npx skills add epfl-lara/LeanProbe --skill skill
Clone the repo
git clone --depth 1 https://github.com/epfl-lara/LeanProbe

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for lean-probe

README.md
[![agentmods](https://agentmods.dev/badge/skills/epfl-lara/leanprobe/skill/github.svg)](https://agentmods.dev/skills/epfl-lara/leanprobe/skill)
Your own site
<a href="https://agentmods.dev/skills/epfl-lara/leanprobe/skill"><img src="https://agentmods.dev/badge/skills/epfl-lara/leanprobe/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for lean-probe

Your own site · 80×15
<a href="https://agentmods.dev/skills/epfl-lara/leanprobe/skill"><img src="https://agentmods.dev/badge/skills/epfl-lara/leanprobe/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,926 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00139 $0.02926
Opus 5.5 $0.00056 $0.01170
Sonnet 5.5 $0.00028 $0.00585
Haiku 4.5 $0.00014 $0.00293

Measured 7d ago against content hash f3425d7d97da, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

lean-probe scanned grade B with 1 finding 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 7d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

For Codex, add to `~/.codex/config.toml`:
src/lean_probe/skill/SKILL.md · 246 lines

How it starts

The opening of the file, as written. The whole thing — 246 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Using LeanProbe

LeanProbe gives coding agents fast Lean 4 feedback through a warm LeanInteract REPL. Use it in the inner loop to verify Lean code far faster than lake build. LeanProbe never edits files; apply accepted code yourself and run lake build as the final whole-project gate before committing.

This skill is the usage contract for the LeanProbe MCP tools. It assumes the lean-probe MCP server is connected to your client (see "Connecting the server" at the bottom). The server also advertises a condensed version of this guide in its instructions field, so a connected agent gets the essentials on connect.

Tool Selection

Tool Use When Main Result
lean_check You have a standalone Lean snippet (imports + code) and want to know if it is valid. The default tool. Diagnostics and ok (valid, no sorry).
lean_check_target Checking or replacing one named declaration inside a project file; you want the fast warm-environment path. Pass/fail plus Lean messages; optional tactics/feedback_lean.
lean_status Setup is uncertain, or you want to pay cold-start up front. Readiness (project root, REPL, sessions); warm=true boots the REPL.
lean_proof_state Exploring a goal from code containing sorry. A session_id and one proof-state id per sorry.
lean_tactic Applying one tactic to a proof state. New goals/proof state, or ok=true when Completed.
lean_close_proof Finished with a proof-state session. Releases the session's REPL process.

lean_check is the low-friction default: no file path or declaration name needed. Reach for lean_check_target when you are iterating on one declaration inside a project file, because it reuses the file's warm prior environment and is typically tens of milliseconds after the first call.

Reading Results

Every tool returns a JSON object. Read two fields, in order:

  • success: did the tool run. false means an environment problem (no project root, file not found, timeout, REPL crash). Read error_code and hint and fix that first; do not interpret it as a Lean result.
  • ok: did Lean accept the code. success=true with ok=false is a real Lean rejection — inspect messages. ok=true means it elaborated with no errors and no sorry; warnings alone do not flip ok.

Read the full file on GitHub · 246 lines

Changes

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.

  1. 7d ago Changed · +41 lines f3425d7d97da
  2. 1mo ago First seen · 205 lines · 139 tokens per session scan B eefa5ae26671

Subscribe to this mod's changes

lean-probe is a skill published in the GitHub repository epfl-lara/LeanProbe (6 stars, last pushed 7d ago), licensed MIT. It adds 139 tokens to every session and 2,926 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

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…

homeowmorphism/mathlib-api · 234 tokens

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…

ibrahimmian36/leanscreen · 0 tokens

paper-search

Search, download, and read academic papers from 20+ sources (arXiv, PubMed, Semantic Scholar, CrossRef, etc). Use when the user asks to find papers, search for research, look up academic literature, download a paper PDF, or extract text from a paper.

openags/paper-search-mcp · 62 tokens

paper-search

Search, download, and read academic papers through the paper-search MCP tools (mcppaper-search), covering arXiv, PubMed, bioRxiv, Semantic Scholar, Crossref, OpenAlex and 15+ other sources. Use when the user asks to find papers, search research literature, download a paper PDF, or extract text from a paper.

openags/paper-search-mcp · 78 tokens

quantum-ground-state

A narrowly defined quantum solver for the ground-state energy of a two-quantum-bit Pauli Hamiltonian in a specified one-excitation sector. It uses a noiseless statevector VQE and checks the result against an exact calculation; VQE is a method that searches for a low-energy quantum state.

xi-zhao/OpenQuantum · 103 tokens

qmclaw-workbench

A local simulator for superconducting quantum-bit experiments, including measurements used to study and tune a qubit. It produces bounded synthetic results without connecting to laboratory hardware or quantum cloud services.

xi-zhao/OpenQuantum · 124 tokens