lean4-sorry-filler-deep

lean4-sorry-filler-deep is an agent for Claude Code from frenzymath/Archon. It costs 37 tokens per session (1,067 once invoked), scanned A, original, Apache-2.0.

A Lean 4 agent for completing difficult placeholders called “sorries,” which mark unfinished proofs. It can make carefully scoped changes across related files when a simple proof attempt fails.

In plain words
What is it for?
Use it to finish complex Lean proofs, prepare supporting helpers, adjust arguments, and refactor type-class-related code within the allowed file boundary.
Why use it?
It helps when ordinary automated proof attempts get stuck and the proof needs surrounding code, helper lemmas, or structural changes.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the lean4 plugin — 1 skill, 11 commands, 4 agents, 3 hooks shipped together

Good fit Use it to finish complex Lean proofs, prepare supporting helpers, adjust arguments, and refactor type-class-related code within the allowed file boundary.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/frenzymath/archon/lean4-sorry-filler-deep
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.

Clone the repo
git clone --depth 1 https://github.com/frenzymath/Archon

Made for: Claude Code.

Or install lean4, the plugin that ships this one along with the rest of its 1 skill, 11 commands, 4 agents, 3 hooks.

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 lean4-sorry-filler-deep

README.md
[![agentmods](https://agentmods.dev/badge/agents/frenzymath/archon/lean4-sorry-filler-deep/github.svg)](https://agentmods.dev/agents/frenzymath/archon/lean4-sorry-filler-deep)
Your own site
<a href="https://agentmods.dev/agents/frenzymath/archon/lean4-sorry-filler-deep"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-sorry-filler-deep/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 lean4-sorry-filler-deep

Your own site · 80×15
<a href="https://agentmods.dev/agents/frenzymath/archon/lean4-sorry-filler-deep"><img src="https://agentmods.dev/badge/agents/frenzymath/archon/lean4-sorry-filler-deep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,067 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.00037 $0.01067
Opus 5 $0.00018 $0.00534
Sonnet 5 $0.00007 $0.00213
Haiku 4.5 $0.00004 $0.00107

Measured 10d ago against content hash 02013d596493, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

lean4-sorry-filler-deep 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 10d 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/archon/.archon-src/skills/lean4/agents/lean4-sorry-filler-deep.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Inputs

  • Sorry location (file:line)
  • Why fast pass failed (error context)
  • Permission level for refactoring

Actions

  1. Understand why fast pass failed:

    • Start with lean_goal(file, line) and lean_diagnostic_messages(file) before any edits or Bash verification
    • Read surrounding code and dependencies
    • Check if needs: argument reordering, helper lemmas, type class refactoring (statement generalization NOT permitted — header fence)
    • Search with 1-2 LSP tools before trying fallback scripts or file-level compilation
  2. Outline plan FIRST (~200-500 tokens):

    ## Sorry Filling Plan
    **Target:** [file:line]
    **Why it's hard:** [reasons]
    **Strategy:** [phases]
    **Safety checks:** [compile after each phase]
    
  3. Execute incrementally with Lean-backed checks after each phase:

    • Phase 1: Prepare infrastructure (helpers, imports)
    • Phase 2: Fill the sorry
    • Phase 3: Clean up
    • After each edit batch: lean_diagnostic_messages(file) first; use lake env lean path/to/File.lean only as a file gate when LSP is unavailable or a file-level import/environment check is needed (run from the project root)
  4. Report progress after each phase and final summary

Output

Phase reports (~300-500 tokens each):

## Phase N Complete
**Actions:** [changes made]
**Compile status:** ✓/✗
**Next phase:** [what's next]

Final summary (~200-300 tokens):

## Sorry Filled Successfully
**Strategy:** compositional/structural/novel
**Files changed:** N
**Helpers added:** M
**Axioms:** 0

Constraints

  • May refactor across files (with compile verification)
  • May NOT generalize statements (header fence). Report next_action = redraft if statement appears wrong.
  • May NOT change statements without permission
  • May NOT introduce axioms without permission
  • May NOT make large architectural changes without approval
  • May NOT delete existing working proofs
  • Must validate after every phase: lean_goal before first edit and after material changes; lean_diagnostic_messages per edit batch
  • Prefer live-file MCP for target-context work; for isolated scratch experiments use lean_run_code (temporary .lean files only as last resort)
  • Engine creates path-scoped snapshot before deep and rolls back on regression or scope exceeded
  • Engine enforces --deep-scope, --deep-max-files, --deep-max-lines — do not bypass
  • Agent must not run git snapshot/rollback commands directly; on rollback, sorry is marked stuck and agent must stop

Read the full file on GitHub · 118 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. 10d ago First seen · 118 lines · 37 tokens per session scan A 02013d596493

Subscribe to this mod's changes

lean4-sorry-filler-deep is an agent published in the GitHub repository frenzymath/Archon (216 stars, last pushed 24d ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,067 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.

Related

Other agents, from other repositories

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 tokens

fit

Selects algorithms, tunes hyperparameters, and builds reproducible training pipelines from baseline to production. Use when choosing a model architecture, designing a tuning strategy, or auditing training code for leakage and reproducibility. Trigger with "design training pipeline", "tune model hyperparameters".

jeremylongshore/tons-of-skills-marketplace · 57 tokens

backend-reviewer

Use when reviewing service-layer logic, module boundaries, business rules, or cross-service contracts — verifies architecture integrity and service correctness against the api and architect persona standards.

jeremylongshore/tons-of-skills-marketplace · 36 tokens

docs-specialist

Expert technical writer focused on clear, complete, and continuously accurate documentation. Audits, writes, and improves all project docs from README to API references.

ZaxbyHub/opencode-swarm · 34 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

Geoprocessing Specialist

ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.

SHAdd0WTAka/Zen-Ai-Pentest · 45 tokens