speckit.companion.doctor

speckit.companion.doctor is a command for Claude Code from alfredoperez/speckit-companion. It costs 59 tokens per session (1,718 once invoked), scanned A, original, MIT.

A read-only diagnostic command that reconstructs the health of a specification workflow from its status file and documents. It checks unfinished steps, missing task records, phase mix-ups, documentation drift, and failed completion records.

In plain words
What is it for?
Use it to inspect the active specification, a named specification, or all specifications in a repository.
Why use it?
It helps explain what happened during a run when the displayed status or completion claim is incomplete or inaccurate.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 .specify/extensions/companion/scripts/doctor.py.

Good fit Use it to inspect the active specification, a named specification, or all specifications in a repository.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/alfredoperez/speckit-companion
agentmods
npx agentmods add commands/alfredoperez/speckit-companion/speckit.companion.doctor

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/alfredoperez/speckit-companion/speckit.companion.doctor"><img src="https://agentmods.dev/badge/commands/alfredoperez/speckit-companion/speckit.companion.doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 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,718 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 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.00059 $0.01718
Opus 5 $0.00030 $0.00859
Sonnet 5 $0.00012 $0.00344
Haiku 4.5 $0.00006 $0.00172

Measured 6d ago against content hash 7746c4e647d6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

speckit.companion.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 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.

speckit-extension/commands/speckit.companion.doctor.md · 63 lines

How it starts

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

Pipeline Doctor

Say what actually happened in a run — and where the record, the display, or the run's own claim is at fault. Everything here is recomputed, never read off a prior verdict: a run that claimed it was drift-clean gets checked against a fresh drift computation, not believed.

Read-only. It creates, modifies, and deletes nothing. Never halts — it always exits 0, and a check that crashes becomes that check's skip reason while the rest still run. Retroactive — every core check derives from .spec-context.json and the spec's own documents, so it produces a meaningful verdict on a spec created long before this command existed.

Prerequisites

  • Verify Python is available by running python3 --version.
  • If python3 is not available, warn the user and skip: [companion] Warning: python3 not detected; skipped doctor. Do not fail the host command.

Execution

Run the doctor from the repository root. With no argument it examines the active spec, resolved the same way every capture call resolves it:

python3 .specify/extensions/companion/scripts/doctor.py

Name a spec explicitly, or sweep every spec in the repository:

python3 .specify/extensions/companion/scripts/doctor.py --feature-dir specs/<NNN>-<slug>
python3 .specify/extensions/companion/scripts/doctor.py --all

Add --json for the machine-readable report (stable top-level keys: checks, findings, bleed, drift, completion, chat), and --chat for the deep transcript audit described below.

What it checks

Each check reports whether it ran, was skipped (always with a reason), or is not applicable. A check that could not look never prints as clean — the summary counts checks, not just findings.

  • record — steps that started and never finished, tasks checked off in tasks.md with no journal entry, task finishes clustered into one burst (journaling that was batched, so the per-task durations mean nothing), and steps closed by the wrong author.
  • triage — the "status says one thing, the pipeline bar offers another" symptom, resolved into exactly one of two verdicts: records disagree with each other (a capture defect — the stepper is derived from history[], so a missing step-level complete is why it will not advance) or records are consistent (look at the display).
  • bleed — where one step did the next step's work: plan content in the spec, a task checklist in the plan, implementation code in the task list, one task list living in two documents, source files committed before implement started, and a pre-implement step that outlasted implement itself.
  • drift — re-runs the drift computation and shows its work: which capability, which files, which commits. Every flag is classified real, self-inflicted (the only changes are records the companion writes during a run), suspect baseline (the comparison commit is not an ancestor of HEAD, or the change is a rename git can follow), or unknown (the baseline could not be reached — never reported as clean). A recorded drift-clean claim the recomputation contradicts is reported as a false claim, with both sides and their timestamps.
  • completion — when a spec did not land as completed, which of four things happened: the write was refused (with the writer's own reason), it reported success and never arrived, it landed and the display disagrees, or completion was never attempted at all.
  • verification — whether the run actually executed anything before implement closed. Running the project's own checks is an instruction with nothing observing it, so a run can write code, tick off a task naming a test, and finish having proven nothing. An implement step that closed with no executed check recorded against the run is reported. A spec that never reached implement reports no record, never a problem.
  • artifact — whether each step left behind the file it declared it would write. Every author node names its output in writes:, and the build collects those into a manifest of what a run of this pipeline must produce; a step that quietly stops writing its document otherwise closes exactly like one that wrote it. Reported as a warning, never a gate: the manifest describes the pipeline as built today, and a spec on disk may have been produced by an earlier one. An artifact the size budget is allowed to fold away is not judged, and a step that produced none of what this pipeline declares reports no record — it ran some other pipeline.
  • template — whether tasks.md still has the shape it was generated with: user-story phases containing waves, ⟶ Wait join lines and checkpoints intact. A file whose story sections were renamed or flattened is reported with the offending headings named.
  • trace — what the run self-trace recorded: capture calls that failed and why, call counts, payload sizes, and how many times each file was rewritten. Calls that could not resolve a spec at all land in the repo-level unattributed log and are reported here too, because a spec whose own trace is clean is not evidence that nothing broke while it was being built. The marker naming calls that succeeded but could not be written to the trace is read before the check decides a spec has no trace evidence — a run that could not write into its spec directory has no trace file at all, and that is precisely the run with something to report.
  • chat (only with --chat) — reads the AI session transcript covering the run's recorded time window and explains causes: work tried and failed, work retried, and steps that stopped rather than failed. It surfaces claims the run made that the recomputation contradicts, and quantifies waste — narration, repeated commands, the same file rewritten over and over. Claude-first; on a provider that keeps no transcript it prints one line and exits successfully. The transcript format is not a stable contract, so treat this as a builder's tool, not a product promise.

Read the full file on GitHub · 63 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 Changed · +2 lines · +18 tokens per session 7746c4e647d6
  2. 9d ago First seen · 61 lines · 41 tokens per session scan A ae635ba03b5c

Subscribe to this mod's changes

speckit.companion.doctor is a command published in the GitHub repository alfredoperez/speckit-companion (90 stars, last pushed today), licensed MIT. It adds 59 tokens to every session and 1,718 once invoked, about $0.0003 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-09-03.

Related

Other commands, from other repositories

incident-triage

Triage a concrete observed technical failure (stack trace, error, failing test, runtime symptom, production alert), classify the failure type (REGRESSION/NEWBUG/CONFIG/EXTERNALDEPENDENCY/REPRODUCIBILITY/DIAGNOSTICINSUFFICIENT), recommend fix size (HOTFIX/SLICE/INVESTIGATION/ESCALATE), and validate against locked…

Mozurok/fhorja.dev · 213 tokens

state-reconcile

Detect drift between TASKSTATE.md, other task-memory artifacts, and observable reality (code, tests, diff when provided), then propose the minimum set of updates so operational memory is trustworthy again. Use when TASKSTATE.md is stale or internally inconsistent after many edits, IMPLEMENTATIONPLAN.md or SLICES/.md…

Mozurok/fhorja.dev · 192 tokens

statusbar-doctor

Run cs doctor to diagnose why the status bar isn't showing what you expect.

leeguooooo/claude-code-usage-bar · 14 tokens

camp-init

Create a new camp with the standard directory structure. A camp was previously called a campaign; camp init is the same command either way.

Obedience-Corp/festival · 7 tokens

fest-next

Get the next actionable festival task with full context.

Obedience-Corp/festival · 12 tokens

sddp-amend

Command description: Propagate a bootstrap change across canonical project artifacts and the project plan. Argument hint: [project-level change to propagate across bootstrap artifacts] Command category: project-bootstrap Prerequisites: project-instructions, product-document, technical-context, project-plan.

attilaszasz/sdd-pilot · 0 tokens