Borrowing it
Nothing to install: this file belongs to sandraschi/leanforge-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/sandraschi/leanforge-mcp/main/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/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.
<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="Reviewed on agentmods" width="80" 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.1 | $0.00900 | $0.00900 |
| Opus 5.5 | $0.00360 | $0.00360 |
| Sonnet 5.5 | $0.00180 | $0.00180 |
| Haiku 4.5 | $0.00090 | $0.00090 |
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 9d 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 — 112 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\leanforge_mcp\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)
→ {"success": true, "job_id": "uuid", "status": "queued"}
get_proof_status(job_id)
→ {"success": true, "status": "running|complete|failed", "proof": "...", "turns_used": int}
validate_lean(lean_source)
→ {"success": bool, "proven": bool, "errors": [...]}
verify_proof(lean_source)
→ {"success": true, "proven": bool, "verified": bool} (needs Lean >= 4.35.0 workspace, else supported:false)
get_mathlib_search(query)
→ {"success": true, "results": [{"name": "...", "statement": "..."}]}
leanforge_shutdown()
→ {"success": true} then the process exits (use before restarts)
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.
- 9d ago Changed · +6 lines · +89 tokens per session ff022703c643
- 1mo 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 (3 stars, last pushed 4d ago), licensed MIT. It adds 900 tokens to every session, about $0.0036 per session on Opus 5.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
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.