lean_expert

lean_expert is a skill for Claude Code, Codex from sandraschi/leanforge-mcp. It costs 0 tokens per session (1,228 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 CodeCodex

Written for no agent in particular: nothing here depends on one.

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, 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_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 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,228 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.00000 $0.01228
Opus 5.5 $0.00000 $0.00491
Sonnet 5.5 $0.00000 $0.00246
Haiku 4.5 $0.00000 $0.00123

Measured 3d ago against content hash 5b31d263d1cb, 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 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.

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

How it starts

The opening of the file, as written. The whole thing — 109 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 · 109 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. 3d 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 (2 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,228 tokens. 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

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…

ibrahimmian36/leanscreen · 0 tokens

reading_recommendations

Description: Get personalized reading recommendations from your Calibre library using series progress, ratings, tags, reading history, and collaborative filtering across similar books.

sandraschi/calibremcp · 0 tokens

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…

epfl-lara/LeanProbe · 139 tokens

rq-problematization

Generates impactful research questions using Alvesson & Sandberg's (2011) problematization framework. Collects prior research, surfaces the assumptions a literature takes for granted across five types, and dialectically challenges them via a devil's-advocate subagent — moving beyond gap-spotting to…

etoyama/insight-blueprint · 148 tokens

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

hr-onboarding

A new-hire onboarding plan as a single page — first week schedule, buddy + manager intro, learning track, equipment checklist, and "you're set when…" outcomes. Use when the brief mentions "onboarding", "new hire", "first week plan", or "入职".

nexu-io/open-design · 62 tokens