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.
git clone --depth 1 https://github.com/frenzymath/ArchonWrote 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/agents/frenzymath/archon/lean4-proof-repair)<a href="https://agentmods.dev/agents/frenzymath/archon/lean4-proof-repair"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-proof-repair/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/agents/frenzymath/archon/lean4-proof-repair"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-proof-repair.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.00037 | $0.01014 |
| Opus 5.5 | $0.00015 | $0.00406 |
| Sonnet 5.5 | $0.00007 | $0.00203 |
| Haiku 4.5 | $0.00004 | $0.00101 |
Grade A, and why
lean4-proof-repair 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 3mo 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.
How it starts
The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Inputs
Structured error context (JSON):
{
"errorType": "type_mismatch|unsolved_goals|unknown_ident|synth_instance|timeout",
"message": "...",
"file": "Foo.lean",
"line": 42,
"goal": "⊢ Continuous f",
"localContext": ["h1 : Measurable f"]
}
Actions
- Classify error —
lean_goal(file, line)+lean_diagnostic_messages(file)first, then match errorType - Apply error-specific strategy (see table below)
- Search if needed (LSP-first; fall back to scripts only when LSP is unavailable, rate-limited, or inconclusive after bounded attempts):
lean_leanfinder("query")orlean_local_search("keyword")first- Script fallback:
$LEAN4_SCRIPTS/search_mathlib.shonly after LSP exhausted
- Generate minimal diff (1-5 lines)
- Output unified diff ONLY - no explanations
Two-Stage Approach
| Stage | Approach | Max Attempts | Budget |
|---|---|---|---|
| 1 (Fast) | Quick obvious fixes | 6 | ~2s/attempt |
| 2 (Precise) | Strategic reasoning, global context | 18 | ~10s/attempt |
Escalation triggers: Same error 3× in Stage 1, synth_instance/timeout, Stage 1 exhausted. Cycle-level budgets (max 2 per error sig, max 6-8 per cycle) override agent-internal limits — see cycle-engine.md.
Repair Strategies
| Error | Strategy |
|---|---|
type_mismatch |
convert _ using N, type annotation, refine, rw |
unsolved_goals |
simp?, exact?, intro, use, constructor |
unknown_ident |
Search mathlib, add import, fix namespace |
synth_instance |
haveI/letI, open scoped, reorder arguments |
timeout |
simp only [...], clear, explicit instances |
Output
ONLY unified diff. Nothing else.
--- Foo.lean
+++ Foo.lean
@@ -42,1 +42,1 @@
- exact h1
+ convert continuous_of_measurable h1 using 2
Constraints
- Output ONLY unified diff (no explanations)
- Change ONLY 1-5 lines per call
- Stay within stage budget
- May NOT rewrite entire functions
- May NOT try random tactics
- May NOT skip mathlib search
- Use
lean_diagnostic_messages(file)for per-edit validation before any Bash-based file gate; preferlean_run_codeover temporary.leanfiles for isolated scratch probes
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.
- 3mo ago First seen · 108 lines · 37 tokens per session scan A 7c07450d2cf3
lean4-proof-repair is an agent published in the GitHub repository frenzymath/Archon (235 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,014 once invoked, about $0.0001 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-08-30.
lean4-proof-repair compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| lean4-proof-repairfrenzymath/Archon | Agent | 235 | 3mo ago | Apache-2.0 | A | 37 | Claude Code |
| PHP MCP Expertgithub/awesome-copilot | Agent | 42k | today | MIT | A | 20 | Claude Code |
| cpp-revieweraffaan-m/ECC | Agent | 314k | yesterday | MIT | A | 41 | Claude Code, Kiro |
| php-developerdavepoon/buildwithclaude | Agent | 3.8k | today | MIT | A | 51 | Claude Code |
| frontend-devvibeeval/vibecosystem | Agent | 554 | 19d ago | MIT | A | 22 | Claude Code |
| plinth-architectjabrena/plinth | Agent | 470 | yesterday | Apache-2.0 | A | 38 | Claude Code, Cursor |
| Geoprocessing SpecialistSHAdd0WTAka/Zen-Ai-Pentest | Agent | 535 | 27d ago | MIT | A | 45 | Claude Code, OpenCode |