proof-golfer

proof-golfer is an agent for Claude Code from jkomyno/.dotfiles. It costs 45 tokens per session (2,707 once invoked), scanned A, a copy of proof-golfer, MIT.

A Lean 4 proof-cleanup worker that shortens or clarifies proofs after they already compile. Lean 4 is a programming language and proof checker for formal mathematics.

In plain words
What is it for?
Use it to find repetitive or indirect proof patterns, assess whether local definitions are safe to inline, and improve proof directness or brevity.
Why use it?
It removes unnecessary proof steps while preserving the result, without starting from a failing proof.

Agent for Claude Code

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

Part of the lean4 plugin — 12 commands, 4 agents, 1 hook shipped together

Good fit Use it to find repetitive or indirect proof patterns, assess whether local definitions are safe to inline, and improve proof directness or brevity.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/jkomyno/.dotfiles/proof-golfer
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/jkomyno/.dotfiles

Made for: Claude Code.

Or install lean4, the plugin that ships this one along with the rest of its 12 commands, 4 agents, 1 hook.

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 proof-golfer

README.md
[![agentmods](https://agentmods.dev/badge/agents/jkomyno/.dotfiles/proof-golfer/github.svg)](https://agentmods.dev/agents/jkomyno/.dotfiles/proof-golfer)
Your own site
<a href="https://agentmods.dev/agents/jkomyno/.dotfiles/proof-golfer"><img src="https://agentmods.dev/badge/agents/jkomyno/.dotfiles/proof-golfer/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 proof-golfer

Your own site · 80×15
<a href="https://agentmods.dev/agents/jkomyno/.dotfiles/proof-golfer"><img src="https://agentmods.dev/badge/agents/jkomyno/.dotfiles/proof-golfer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,707 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 89% copy Near-identical to another mod 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.00045 $0.02707
Opus 5.5 $0.00018 $0.01083
Sonnet 5.5 $0.00009 $0.00541
Haiku 4.5 $0.00005 $0.00271

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

Security

Grade A, and why

proof-golfer 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 6d 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.

Origin

This is a copy

89% identical to proof-golfer — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

target/home/.local/share/lean4-skills/lean4/agents/proof-golfer.md · 161 lines

How it starts

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

Inputs

Consume the run-contract/v1 dispatch record (record == "dispatch"): read target, the context envelope, and owned_files + file_baseline (fail closed — see below). Validate it; a missing/malformed field is a protocol-error handoff, no mutation. A passing build is required (verify before starting).

parameters shape for this worker: {search_mode: "off" | "quick" | "full", golfable_patterns: [...], candidate_targets: [...]} (default search_mode quick).

Actions

MCP canary runs before step 3 (after pure-script steps 1-2). See step 2 for details and fallback behavior.

  1. Find patterns (in policy order: directness → structural → conditional) with false-positive filtering:

    lean4-skills-find-golfable FILE.lean --filter-false-positives
    

    For direct-proof discovery when search_mode ≠ off or syntactic pass stalls:

    lean4-skills-find-exact-candidates FILE.lean
    
  2. Verify safety before inlining any binding:

    lean4-skills-analyze-let-usage FILE.lean --line LINE
    
    • 1-2 uses: Safe to inline
    • 3-4 uses: Check carefully (40% worth optimizing)
    • 5+ uses: NEVER inline

    MCP canary: Before step 3, test lean_diagnostic_messages(file). If unavailable (tool-not-found, missing from context, or inaccessible), emit "⚠ Lean MCP tools unavailable — golfing limited to syntactic patterns", skip steps 3-4 (require lean_multi_attempt), and reduce step 5 to max 1 hunk with lake env lean <file> (from project root) per-hunk verification; reserve lake build for final verification only.

    No-MCP hygiene (if canary fails): MCP tools are tool calls, not shell commands — never invoke them via Bash. Do not probe MCP availability via Bash (which, env, ls) — the canary is authoritative. Stop retrying MCP for this run. Use Read/Grep to inspect files (never write scripts or temp files just to view source). Start from pre-collected context in the parent prompt.

Read the full file on GitHub · 161 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. 6d ago First seen · 161 lines · 45 tokens per session scan A ee39467b07f2

Subscribe to this mod's changes

proof-golfer is an agent published in the GitHub repository jkomyno/.dotfiles (5 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 2,707 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 89% identical to proof-golfer, differing in 0 lines, and is treated as a copy.

Related

proof-golfer compared with agents from other repositories

proof-golfer next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
proof-golferjkomyno/.dotfilesAgent52d agoMITA45Claude Code
review-obsidian-guidelinesuphy/obsidian-reminderAgent668yesterdayMITA63Claude Code
loom-advisorcosmix/loomAgent66yesterdayMITA51Claude Code
debuggerTT-Wang/forgeAgent3513d agoMITA17Claude Code
debuggerNickCrew/Claude-CortexAgent7610d agoMITA38Claude Code
evolve-retrospectivemickeyyaya/evolve-loopAgent8todayApache-2.0A51Claude Code
debuggerbostonaholic/rpikitAgent1922d agoMITA28Claude Code