lean-expert

lean-expert is a skill for Claude Code from sandraschi/leanforge-mcp. It costs 47 tokens per session (1,281 once invoked), scanned A, original, MIT.

A reference guide for Lean 4, a programming language and theorem prover used to write machine-checked mathematical proofs. It covers current versions, syntax, tactics, and the surrounding tools.

In plain words
What is it for?
It is for checking Lean versions, explaining proof concepts, choosing tactics, and guiding attempts to prove theorems.
Why use it?
It helps answer Lean questions and suggest proof steps using known information instead of guessed or outdated advice.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the leanforge-mcp plugin — 1 skill, 1 hook, 1 MCP server shipped together

Good fit It is for checking Lean versions, explaining proof concepts, choosing tactics, and guiding attempts to prove theorems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sandraschi/leanforge-mcp/lean_expert
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 sandraschi/leanforge-mcp --skill lean_expert
Clone the repo
git clone --depth 1 https://github.com/sandraschi/leanforge-mcp

Made for: Claude Code.

Or install leanforge-mcp, the plugin that ships this one along with the rest of its 1 skill, 1 hook, 1 MCP server.

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/sandraschi/leanforge-mcp/lean_expert/github.svg)](https://agentmods.dev/skills/sandraschi/leanforge-mcp/lean_expert)
Your own site
<a href="https://agentmods.dev/skills/sandraschi/leanforge-mcp/lean_expert"><img src="https://agentmods.dev/badge/skills/sandraschi/leanforge-mcp/lean_expert/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-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandraschi/leanforge-mcp/lean_expert"><img src="https://agentmods.dev/badge/skills/sandraschi/leanforge-mcp/lean_expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,281 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00047 $0.01281
Opus 5.5 $0.00019 $0.00512
Sonnet 5.5 $0.00009 $0.00256
Haiku 4.5 $0.00005 $0.00128

Measured 1mo ago against content hash 31357eb147e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lean-expert 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 1mo 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.

src/leanforge_mcp/skills/lean_expert/SKILL.md · 114 lines

How it starts

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

Lean 4 Expert -- Skill Context

You are an expert on the Lean 4 theorem prover and its ecosystem. This skill gives you the current state of the Lean world so you can answer version questions, suggest tactics, explain concepts, and guide proof attempts without guessing or hallucinating.

Current versions (2026-07)

Component Version Notes
Lean 4 language 4.18.0 Stable release, June 2026
Lean 4 nightly 4.19.0-rc1 Nightly as of 2026-07-01
elan (version manager) 4.1.2 winget install leanprover.elan
Mathlib4 v4.18.0 Monorepo: 800k+ theorems, 300+ contributors
Lake (build system) 5.0.0 Bundled with Lean 4.18

Key syntax patterns

Basic tactic block

theorem add_comm (a b : Nat) : a + b = b + a := by
  induction a with
  | zero => simp
  | succ a ih =>
    simp [Nat.succ_eq_add_one, add_assoc, ih]

Calc block (readable multi-step)

theorem example (a b : Nat) : (a + b) * 2 = a * 2 + b * 2 := by
  calc
    (a + b) * 2 = (a + b) + (a + b) := by ring
    _ = a + b + a + b := by ring
    _ = (a + a) + (b + b) := by ring
    _ = a * 2 + b * 2 := by ring

Common tactics by use case

Goal Tactic
Break ∧ into two goals constructor
Break ∨ into cases left / right / cases h
Use an equality hypothesis rw [h] or rw [← h]
Prove equality of Nat omega (automatic) or simp + ring
Prove equality of structures ext (extensionality)
Induction on Nat induction n with ... or cases n
Cases on Option / List cases x
Apply a lemma apply / exact / have h := ...
Inline simplification simp [h1, h2]
Arithmetic with Nat omega (complete decision procedure)
Ring arithmetic ring (works for Nat, Int, ℚ, ℝ)
Field arithmetic field_simp (for ℚ, ℝ, ℂ)
Linarith linarith (linear arithmetic over ℤ, ℚ, ℝ)
Nlinarith nlinarith (nonlinear arithmetic)
Positivity positivity (prove positivity of expressions)
Tauto tauto (propositional logic)

Read the full file on GitHub · 114 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. 1mo ago Changed · +5 lines · +47 tokens per session 31357eb147e1
  2. 1mo ago First seen · 109 lines · 0 tokens per session scan A 5b31d263d1cb

Subscribe to this mod's changes

lean-expert is a skill published in the GitHub repository sandraschi/leanforge-mcp (3 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 1,281 once invoked, about $0.0002 per session on Opus 5.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-10-14.

Related

lean-expert compared with skills from other repositories

lean-expert next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lean-expertsandraschi/leanforge-mcpSkill3yesterdayMITA47Claude Code
formalyamafaktory/formalSkill272d agoMITA65Claude Code, Codex
screenibrahimmian36/leanscreenSkill73mo agononeA0Claude Code
reading_recommendationssandraschi/calibremcpSkill54todayMITA0Claude Code
lay-summaryberntpopp/genefoundry-routerSkill7yesterdayMITA74Claude Code, Codex
lean-probeepfl-lara/LeanProbeSkill81mo agoMITB139Claude Code, Codex
rq-problematizationetoyama/insight-blueprintSkill01mo agoMITA148Claude Code