doctor

doctor is a command for Claude Code from frenzymath/Archon. It costs 9 tokens per session (2,318 once invoked), scanned C, original, Apache-2.0.

A diagnostic and maintenance command for Lean 4 projects. Lean 4 is a programming language and proof assistant, while Lake is its build tool.

In plain words
What is it for?
Use it for full or environment-only checks, read-only migration checks, or to list and optionally remove stale files.
Why use it?
It helps identify missing tools, environment problems, old installations, and stale files when a Lean project is not working correctly.

Command for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions .claude-plugin; mentions subagents.

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

Good fit Use it for full or environment-only checks, read-only migration checks, or to list and optionally remove stale files.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/frenzymath/archon/doctor
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 doctor

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/frenzymath/archon/doctor"><img src="https://agentmods.dev/badge/commands/frenzymath/archon/doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 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,318 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00009 $0.02318
Opus 5.5 $0.00004 $0.00927
Sonnet 5.5 $0.00002 $0.00464
Haiku 4.5 $0.00001 $0.00232

Measured 3mo ago against content hash 6379e132920b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

doctor scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Default: Report findings, show `rm -rf` commands, do NOT execute
src/archon/.archon-src/skills/lean4/commands/doctor.md · 281 lines

How it starts

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

Lean4 Doctor

Diagnostics, troubleshooting, and migration assistance for the Lean4 plugin.

Usage

/lean4:doctor                    # Full diagnostic (plugin + workspace)
/lean4:doctor env                # Environment only
/lean4:doctor migrate            # Detect legacy installs (read-only)
/lean4:doctor migrate --global   # Include user-level ~/.claude scan
/lean4:doctor cleanup            # Show stale files + removal commands
/lean4:doctor cleanup --apply    # Actually remove stale files

Inputs

Arg Required Description
mode No env, migrate, cleanup, or full (default)
--global No Include user-level paths (~/); migrate only
--apply No Execute removals; cleanup only

Actions

1. Environment Check

Tool Check Required
lean lean --version Yes
lake lake --version Yes
python3 python3 --version For scripts
git git --version For commits
rg rg --version Optional (faster search)

Environment variables: LEAN4_PLUGIN_ROOT, LEAN4_SCRIPTS, LEAN4_REFS, LEAN4_PYTHON_BIN

1b. MCP Tools

Check Detection Status
Lean LSP MCP lean_goal tool available in this session Optional (sub-second feedback)
✓ … available or ⚠ … unavailable — see INSTALLATION.md

2. Plugin Check

Verify structure and permissions:

plugins/lean4/
├── .claude-plugin/plugin.json
├── commands/     (*.md command files)
├── hooks/        (executable .sh)
├── skills/lean4/ (SKILL.md + references/)
├── agents/       (4 files)
└── lib/scripts/  (12 files, executable)

3. Project Check

  • lakefile.lean and lean-toolchain present
  • lake build passes
  • Sorry count reported

4. Migration Detection (read-only)

Detects legacy v3 artifacts without making changes.

Legacy plugin installs:

~/.claude/plugins/lean4-theorem-proving/
~/.claude/plugins/lean4-subagents/
~/.claude/plugins/lean4-memories/

Read the full file on GitHub · 281 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. 3mo ago First seen · 281 lines · 9 tokens per session scan C 6379e132920b

Subscribe to this mod's changes

doctor is a command published in the GitHub repository frenzymath/Archon (235 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 9 tokens to every session and 2,318 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

doctor compared with commands from other repositories

doctor next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
doctorfrenzymath/ArchonCommand2353mo agoApache-2.0C9Claude Code
qa-changesOpenHands/extensionsCommand190todayMITA63Claude Code
auditar-cascadingluanpdd/kit-mcpCommand5yesterdayMITA54Claude Code
react-nativegetsentry/toolkitCommand977todaynoneA0Claude Code
http-serviceMadAppGang/magusCommand16todayMITA27Claude Code
doctordoncheli/don-cheli-sddCommand593mo agoApache-2.0A76Claude Code
doctorfatihkan/badiCommand81mo agoMITA0Claude Code