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.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.1 | $0.00037 | $0.01014 |
| Opus 5 | $0.00018 | $0.00507 |
| Sonnet 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 8d 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.
- 8d 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 (216 stars, last pushed 21d ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,014 once invoked, about $0.0002 per session on Opus 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.
Other agents, from other repositories
hex-library-researcher
Researches Elixir libraries on hex.pm. Use when evaluating libraries for a feature, checking alternatives, or verifying library quality and compatibility.
frontend-dev
Frontend Developer (Aria Chen) - React, Next.js, TypeScript, accessibility, performance.
go-expert
Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.
macos-developer
Expert macOS native developer for AppKit, Catalyst, and macOS-specific features.
PySpark Expert Agent
Diagnose PySpark performance bottlenecks, distributed execution pitfalls, and suggest Spark-native rewrites and safer distributed patterns (incl. mapInPandas guidance).
go-expert
Go programming language strategist. Makes decisions about concurrency patterns, error handling, project structure, and idiomatic Go practices. Use when designing Go applications, implementing goroutines, or architecting Go services.