doctor

doctor is a command for Claude Code from simonrowland/goal-flight. It costs 18 tokens per session (1,698 once invoked), scanned A, original, MIT.

A command that checks whether Goal Flight can safely run in the current coding session and project.

In plain words
What is it for?
Use it to run readiness checks, produce machine-readable results, or test whether a worker can write files.
Why use it?
It finds missing tools, outdated versions, setup problems, and project-state issues before work begins.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md; mentions Codex; built for gstack.

Part of the goal-flight plugin — 10 skills, 17 commands, 3 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/simonrowland/goal-flight/doctor
Clone the repo
git clone --depth 1 https://github.com/simonrowland/goal-flight

Made for: Claude Code.

Or install goal-flight, the plugin that ships this one along with the rest of its 10 skills, 17 commands, 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/simonrowland/goal-flight/doctor.svg)](https://agentmods.dev/commands/simonrowland/goal-flight/doctor)
Your own site
<a href="https://agentmods.dev/commands/simonrowland/goal-flight/doctor"><img src="https://agentmods.dev/badge/commands/simonrowland/goal-flight/doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 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,698 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.1 $0.00018 $0.01698
Opus 5 $0.00009 $0.00849
Sonnet 5 $0.00004 $0.00340
Haiku 4.5 $0.00002 $0.00170

Measured today against content hash ea1b0b38185a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 today.

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 · 137 lines

How it starts

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

doctor

Diagnose whether goal-flight can run safely in the current session. Read protocols/tool-readiness.md, protocols/project-state-layout.md, protocols/task-lifecycle.md, and protocols/progress-dashboard.md, then run the procedural doctor.

Command

python3 <skill-root>/scripts/goalflight_doctor.py --project-root "$PWD"

For machine-readable output:

python3 <skill-root>/scripts/goalflight_doctor.py --project-root "$PWD" --json

For a live worker write-file probe:

python3 <skill-root>/scripts/goalflight_doctor.py --project-root "$PWD" --worker-write-probe --write-probe-agent grok-code

Required Checks

The script owns the checks; this file names the contract so tests and humans can verify drift. Doctor separates host-global install readiness from project-local Goal Flight readiness.

Host-global checks cover PATH/binary presence, selected CLI versions, host-wrapper installation, context-mode registration, gstack, autoreview, capacity, model currency probes, and rate-pressure signals.

Project-local checks cover docs-private/env-caveats.md, the canonical docs-private/ state tree, repository SKILL.md, AGENTS.md Goal Flight routing, the AGENTS.md newest-RESUME-NOTES living-state pin, project verification commands, resume notes, missing state files, managed-view schema/template skew, and the tasks.jsonl <-> tasks-data.js mirror. Package plugin validation applies only when --project-root is the Goal Flight package repository; for normal target projects it is skipped as INFO.

  • Validate goal-flight packaging and adapter manifests. Host-native validators are adapter-owned compatibility probes, not the core readiness source.
  • Check Codex Desktop:
    • /Applications/Codex.app
    • mdfind 'kMDItemCFBundleIdentifier == "com.openai.codex"'
  • Check codex --version.
  • If Codex Desktop exists but codex CLI is missing, WARN with: Codex Desktop found, but codex CLI missing. Install CLI with npm install -g @openai/codex && codex login. Desktop install implies the user likely already has an OpenAI account; CLI login should use that account.
  • Check Codex context-mode registration with scripts/register-context-mode-codex.py --check.
  • Check Cursor context-mode registration with scripts/register-context-mode-cursor.py --scope global --check and scripts/register-context-mode-cursor.py --scope project --project-root "$PWD" --check.
  • Check gstack --version.
  • Check autoreview: scripts/autoreview.sh executable and vendored helper at autoreview/scripts/autoreview (AUTOREVIEW_HELPER overrides).
  • Check first-class local worker/controller candidates:
    • Codex: Desktop/CLI present, context-mode registered when large-output work will run, ACP adapter binary present when the Codex ACP path is considered.
    • Cursor: Desktop, cursor, and cursor-agent present when Cursor is routed as orchestrator or worker; global or project mcp.json has context-mode when large-output work will run.
      • /Applications/Cursor.app
      • command -v cursor
      • command -v cursor-agent
      • ~/.cursor/mcp.json
      • .cursor/mcp.json
    • Grok: Grok Build present, headless flags available. File-writing routes require the live write-file e2e probe to pass in the current environment; otherwise use Grok for read-only analysis/research only.
      • --prompt-file
      • --permission-mode
      • --os-sandbox
      • Each configured seat home must have permission_mode in that home's .grok/config.toml. Doctor warns and dispatch refuses when the key is absent; do not add a grok CLI --permission-mode flag to compensate.
    • Claude compatibility path: CLI/plugin checks pass before Claude-specific compatibility examples are used. NOTE: presence/PATH only — a green doctor does NOT confirm the remote claude-acp credential. Headless subscription seat readiness is verified per node by the fleet auth probe (claude auth status --json), not by host-global doctor; pty headroom is covered by pty_shim_health (orphan reaping), not a pre-dispatch free-pty gate.
  • Check ACP worker adapters for presence/PATH only: codex-acp, cursor-agent, claude-code-cli-acp, grok agent stdio.
  • Check claude_acp_stopgap; when the stopgap is required but absent, use scripts/install_claude_acp_patch.sh and re-run doctor.
  • Check project git state.
  • Check project Goal Flight readiness:
    • docs-private/env-caveats.md
    • canonical docs-private/ files/dirs from templates/state-skeleton/ and protocols/project-state-layout.md
    • root SKILL.md
    • AGENTS.md Goal Flight routing with skill-root/load-order guidance
    • AGENTS.md pins the newest docs-private/RESUME-NOTES-*.md living state
    • project test/lint/build commands
    • optional docs-private/RESUME-NOTES*.md
    • managed static view assets match the templates from templates/state-skeleton/; schema/template skew is a layout warning
    • docs-private/tasks.jsonl and dashboard/tasks-data.js mirror validation when either task-store file exists
  • Check machine capacity profile.
  • Cursor model currency (cursor_models_probe): runs cursor-agent models, identifies the leading internal composer-X.Y (non--fast), compares against ~/.cursor/cli-config.json modelId. Flags user_behind when the user is on an older internal model or on a paid-passthrough model. Surfaces as [OK] or [WARN] with the cli-config edit recommendation.
  • Worker CLI currency (worker_currency_probe): proxy for model currency for workers without a native list-models API. grok update --check --json for grok; npm view <pkg> version for @openai/codex / @anthropic-ai/claude-code / claude-code-cli-acp. Behind workers get [WARN]; verified-current workers [OK]; probe-failed (registry unreachable) workers [INFO] as a separate line.
  • Rate-pressure summary (_rate_pressure_summarygoalflight_rate_pressure): scans the dispatch ledger for provider-level rate-limit signatures over the last 10 minutes. [WARN] per pressured provider with recommended caps and fallback providers; [OK] when all providers clear.
  • PTY shim health (pty_shim_health): orphaned claude-acp shims and pty cap pressure. Remediation: bin/gf-reap-shims --exec (or python3 scripts/goalflight_reap_shims.py --exec).

Read the full file on GitHub · 137 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. today Changed · +10 tokens per session ea1b0b38185a
  2. 6d ago First seen · 137 lines · 8 tokens per session scan A e945217fb399

Subscribe to this mod's changes

doctor is a command published in the GitHub repository simonrowland/goal-flight (20 stars, last pushed yesterday), licensed MIT. It adds 18 tokens to every session and 1,698 once invoked, about $0.0001 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.