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.
npx agentmods add commands/frenzymath/archon/golfgit 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/commands/frenzymath/archon/golf)<a href="https://agentmods.dev/commands/frenzymath/archon/golf"><img src="https://agentmods.dev/badge/commands/frenzymath/archon/golf.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 | $0.00017 | $0.02663 |
| Opus 5 | $0.00009 | $0.01332 |
| Sonnet 5 | $0.00003 | $0.00533 |
| Haiku 4.5 | $0.00002 | $0.00266 |
Grade A, and why
golf 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 4d 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.
This is a copy
94% identical to golf — 11 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.
How it starts
The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Lean4 Golf
Improve Lean proofs that already compile. Score candidates by: correctness → directness → clarity/inference burden → performance/determinism → length. Length is still a core goal, but a tiebreaker among acceptable proofs.
Prerequisite: Code must compile. Verify code compiles first (lean_diagnostic_messages(file) or lake env lean <path/to/File.lean> from project root; lake build for project-wide).
Usage
/lean4:golf # Golf entire project
/lean4:golf File.lean # Golf specific file
/lean4:golf File.lean:42 # Golf proof at specific line
/lean4:golf --dry-run # Show opportunities without applying
/lean4:golf --search=full # Include lemma replacement pass
/lean4:golf --max-delegates=3 # Override default 2 concurrent subagents
Inputs
| Arg | Required | Description |
|---|---|---|
| target | No | File or file:line to golf |
| --dry-run | No | Preview only, no changes |
| --search | No | off, quick (default), or full — LSP lemma replacement pass |
| --max-delegates | No | 2 — max concurrent golfer subagents (preflight must pass first) |
Actions
- Verify Build - Ensure code compiles before optimizing
- Find Patterns - Detect golfable patterns (in policy order: directness → structural → conditional):
For direct-proof discovery when${LEAN4_PYTHON_BIN:-python3} "$LEAN4_SCRIPTS/find_golfable.py" [file] --filter-false-positives--searchis enabled or syntactic pass stalls:${LEAN4_PYTHON_BIN:-python3} "$LEAN4_SCRIPTS/find_exact_candidates.py" [file] - Exact-Collapse Pass (bounded) — For apply/exact chain anchors from
$LEAN4_SCRIPTS/find_golfable.py:- Mechanical (≤30 anchors/file): Construct collapsed
exactfrom tactic structure →lean_multi_attempt+lean_diagnostic_messagesbaseline check (no new diagnostics, no sorry increase). Accept if the replacement is more direct or clearer. Reject if it introduces heavier automation (simpa, rwa, broad simp) to replace an explicit proof, if term length exceeds ~80 chars, if dot-chain depth > 2, or if it removes meaningful intermediate names. A 1-line saving that raises inference burden is not a win. - Exploratory (when
--search≠off; consumes--searchbudget): On remaining single-goal anchors, build candidateexactterms from chain lemmas + local hypotheses + dot-notation rewrites →lean_multi_attempt+ diagnostics check. Probe caps are phase-local:quick≤5 probes/file;full≤15 probes/file; ≤2 probes/anchor. Time budget is shared with lemma replacement (step 4):quick30s total,full60s total across both phases. - Skip:
calc,cases/induction, multi-goal branches, blocks >7 lines, semicolon-heavy (>3), blocks withhave/refine.constructorchains are handled by the existing instant-win rule, not this pass.
- Mechanical (≤30 anchors/file): Construct collapsed
- Lemma Replacement (if
--search=quickorfull):- Run LSP searches per candidate; test with
lean_multi_attempt quick: 1 search, ≤2 candidates;full: 2 searches, ≤3 candidates; ≤3 search calls; uses remaining shared time budget- Accept the best passing replacement by the scoring order below
- Hand off to axiom-eliminator if replacement needs statement changes or multi-file refactor
- Run LSP searches per candidate; test with
- Verify Safety - Check usage before inlining:
${LEAN4_PYTHON_BIN:-python3} "$LEAN4_SCRIPTS/analyze_let_usage.py" [file] --line [line] - Apply - Make changes with
lean_diagnostic_messagesafter each;lake buildfor final verification - Report - Show savings and saturation status
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.
- 4d ago First seen · 167 lines · 17 tokens per session scan A 12d757354633
golf is a command published in the GitHub repository frenzymath/Archon (213 stars, last pushed 18d ago), licensed Apache-2.0. It adds 17 tokens to every session and 2,663 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 94% identical to golf, differing in 11 lines, and is treated as a copy.
Other commands, from other repositories
wisp-dashboard
Open the WISP dashboard in your browser.
forkmind
Start ForkMind or branch/inspect/regression-test an LLM call.
graph-open
The web UI requires the human-only full-authority token (uitoken). It is stored in no file, so you cannot know it and must not try to find it.
graph-new
Decompose a natural-language requirement into an execution graph and register it (does not run it).
graph-lock
Guide the user through locking/unlocking a graph (only a human can do it).
graph-run
Start a run and pump the cursor to the end.