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 instructions/sandraschi/leanforge-mcp/claude-mdgit clone --depth 1 https://github.com/sandraschi/leanforge-mcpWrote 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/instructions/sandraschi/leanforge-mcp/claude-md)<a href="https://agentmods.dev/instructions/sandraschi/leanforge-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/sandraschi/leanforge-mcp/claude-md.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.00811 | $0.00811 |
| Opus 5 | $0.00405 | $0.00405 |
| Sonnet 5 | $0.00162 | $0.00162 |
| Haiku 4.5 | $0.00081 | $0.00081 |
Grade A, and why
leanforge-mcp CLAUDE.md scanned grade A 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 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
stdin=asyncio.subprocess.PIPE, How it starts
The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md -- leanforge-mcp
Claude Desktop / Claude Code notes for working in this repo.
What this repo does
leanforge-mcp is a FastMCP server wrapping a Lean 4 formal proof search pipeline. An agent submits a theorem; the server runs N parallel subagents each looping: LLM proposes a proof edit → Lean compiler checks → error feeds back → repeat. First subagent to produce a sorry-free compile wins.
Key concepts
sorryin Lean = "trust me, skip this proof" -- invalid until all sorry replaced- The Lean compiler is the oracle -- its error messages ARE the training signal
- Mathlib has ~150k theorems; LLMs know it well from training data
import Mathlibat top of file gives access to all of it
When working on agent.py
Core loop in src\core\agent.py. The LLM's job each turn:
- Read current
.leanfile - Read last compiler error (if any)
- Propose a search-replace edit filling
sorry - Never change the theorem statement
Lean 4 compiler error format:
error: unknown tactic 'magic'
at Proof.lean:7:4
Feed the full error string back verbatim. LLM uses it to self-correct.
When working on lean_client.py
proc = await asyncio.create_subprocess_exec(
str(lean_path), "--stdin",
stdin=asyncio.subprocess.PIPE,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
stdout, stderr = await asyncio.wait_for(
proc.communicate(input=lean_source.encode()), timeout=30
)
Check proc.returncode == 0 AND no sorry in source for a proven result.
MCP tool quick reference
submit_theorem(statement, hints?, tier=1, parallel_agents=4, max_turns=100)
→ {"job_id": "uuid", "status": "queued"}
get_proof_status(job_id)
→ {"status": "running|complete|failed", "proof": "...", "turns_used": int}
validate_lean(lean_source)
→ {"success": bool, "errors": [...]}
get_mathlib_search(query)
→ {"results": [{"name": "...", "statement": "..."}]}
Typical escalation for hard problems
# Start cheap local
submit_theorem(statement="...", tier=1, max_turns=100)
# If stalled, escalate
submit_theorem(statement="...", tier=2, max_turns=200)
# Hard open problem
submit_theorem(statement="...", tier=3, max_turns=500)
# At $50/M output -- budget carefully
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 · 106 lines · 811 tokens per session scan A 000970cbafcb
leanforge-mcp CLAUDE.md is an instructions file published in the GitHub repository sandraschi/leanforge-mcp (0 stars, last pushed 3d ago), licensed MIT. It adds 811 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
formal CLAUDE.md
Instructions for yamafaktory/formal, covering formal, rust, the files that judge changes, hints and lean.
verified-polygon-intersection CLAUDE.md
Instructions for schildep/verified-polygon-intersection, covering guideline on placement of definitions/theorems, network access and bash commands.
VCVio AGENTS.md
AGENTS.md instructions for Verified-zkEVM/VCVio, covering vcvio — ai agent guide, fast start, attribution, headers, and docstrings, module scopes and what this project is.
sagemath-mcp CLAUDE.md
Instructions for XBP-Europe/sagemath-mcp, covering claude.md, project, commands, linting and testing.
blender-mcp copilot-instructions.md
Copilot instructions for sandraschi/blender-mcp: You have access to a Blender 3D automation server. You can control Blender scenes, objects, materials, rendering, and physics through MCP tools.
lean-interact CLAUDE.md
Instructions for nasqret/lean-interact, covering claude.md — operating instructions for this repository, 0. start of every session, 1. the formalization loop, turn length, and deferred bookkeeping and when the proof is the interesting part.