doctor

doctor is a command for coding agents from Lee-W/maigo. It costs 47 tokens per session (1,826 once invoked), scanned A, original, MIT.

A read-only diagnostic command for checking whether the Maigo workflow and project are configured correctly. It checks command-line tools, memory files, test settings, retry logs, and recent token-use records.

In plain words
What is it for?
Use `/maigo:doctor` to check GitHub CLI, Git, Python, Maigo memory, test configuration, the verifier, failure logs, token metadata, and old artifact filenames.
Why use it?
It gathers common environment and project problems in one report without changing or deleting the files it examines.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the maigo plugin — 24 skills, 15 commands, 5 agents, 4 hooks shipped together

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.

agentmods
npx agentmods add commands/lee-w/maigo/doctor
Clone the repo
git clone --depth 1 https://github.com/Lee-W/maigo

Or install maigo, the plugin that ships this one along with the rest of its 24 skills, 15 commands, 5 agents, 4 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/lee-w/maigo/doctor.svg)](https://agentmods.dev/commands/lee-w/maigo/doctor)
Your own site
<a href="https://agentmods.dev/commands/lee-w/maigo/doctor"><img src="https://agentmods.dev/badge/commands/lee-w/maigo/doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 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,826 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00047 $0.01826
Opus 5 $0.00023 $0.00913
Sonnet 5 $0.00009 $0.00365
Haiku 4.5 $0.00005 $0.00183

Measured 4d ago against content hash ac28643700c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

doctor 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.

commands/doctor.md · 112 lines

How it starts

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

/maigo:doctor

「哪裡不舒服嗎。讓我看看。」 —— 🌑 Mortis

檢查 Maigo 運行所需的外部依賴與配置是否到位。

檢查項目

  1. 環境依賴
    • gh CLI:是否安裝、是否已登入(用 gh auth status)。
    • git:是否可用。
    • python3:版本是否 ≥ 3.13。
  2. Maigo 配置
    • ~/.config/maigo/memory/:目錄是否存在。
    • MEMORY.md:索引檔是否存在且格式正確。
  3. 專案配置
    • .claude/test-command:是否有自定義測試指令。
    • .claude/skip-test-verification:是否被標記跳過。
    • Taki 試跑:嘗試偵測當前專案類型並跑一個最小化的檢查(例如 ruff --version 或嘗試跑一個不存在的 test 來確認 test runner 有反應)。
  4. Retry / failure 統計(read-only,只讀不清):讀 .maigo/soyo-must-fix.jsonl (🟡 爽世 must-fix 觸發,teammate_quality_check.py 寫入)與 .maigo/test-failures.jsonl (🟣 立希 test failure 觸發,verify_completion.py 寫入),彙整各 key 的觸發次數 + 最近 3 筆摘要。兩個 log 都是相對當前 repo 的 .maigo/ 底下,不存在或是空的 → 印正常訊息 (新環境 / 還沒觸發過 retry 本來就不該有),不算 error。
  5. Token usage(read-only):讀 .maigo/token-usage.jsonl,彙整最近 7 天總量並依角色/model 分組。只採用 harness 已提供的 foreground subagent metadata;背景 agent、Codex 或舊版 harness 沒資料時標示 unavailable,不自行估算、不算 error。
  6. 舊固定檔名孤兒檔(read-only,只列不刪):.maigo/ 底下的產物已改成帶識別碼命名 (plan-<id>.md / review-rubric-<id>.md / triage-rubric-<id>.md / pr-comments-<id>.md), 舊固定檔名(.maigo/plan.md.maigo/review-rubric.md.maigo/triage-rubric.md.maigo/pr-comments.md)若還存在,代表是升級前留下的孤兒——只列出來,不自動刪除, 由使用者自己決定要不要清(見 artifact-ownership)。

流程

  1. Orchestrator
    • 執行 gh --versiongh auth status
    • 執行 python3 --version
    • 檢查 ~/.config/maigo/memory/ 路徑。
  2. 立希 (Taki)
    • 執行專案偵測。
    • 報告當前專案被識別為什麼類型。
    • 嘗試執行基本 lint/test 指令(dry-run 模式,不要求過,只要求「能跑」)。
  3. Orchestrator:讀 retry / failure log,彙整統計(不存在 / 空 → 印正常訊息,不中止):
python3 scripts/retry_log_summary.py
  1. Orchestrator:讀 token usage metadata(Claude Code plugin 安裝環境用 ${CLAUDE_PLUGIN_ROOT} 定位;在 Maigo repo 開發時可直接用 scripts/):
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/token_usage_summary.py" --root "$PWD"

Read the full file on GitHub · 112 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. 4d ago First seen · 112 lines · 47 tokens per session scan A ac28643700c4

Subscribe to this mod's changes

doctor is a command published in the GitHub repository Lee-W/maigo (14 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 1,826 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.