doctor

doctor is a command for Claude Code from punt-labs/z-spec. It costs 5 tokens per session (1,001 once invoked), scanned B, original, MIT.

A diagnostic command for checking whether the Z formal-specification toolchain is available and healthy. It checks required programs, supporting files, and the current platform.

In plain words
What is it for?
Use it to inspect the availability of fuzz, probcli, and fuzz.sty, and to get setup suggestions when required components are absent.
Why use it?
It quickly shows which parts of the setup are missing or unusable, so you know what to install or repair before working on specifications.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the z-spec-dev plugin — 42 commands, 1 hook shipped together

Good fit Use it to inspect the availability of fuzz, probcli, and fuzz.sty, and to get setup suggestions when required components are absent.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/punt-labs/z-spec/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/punt-labs/z-spec

Made for: Claude Code.

Or install z-spec-dev, the plugin that ships this one along with the rest of its 42 commands, 1 hook.

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/punt-labs/z-spec/doctor/github.svg)](https://agentmods.dev/commands/punt-labs/z-spec/doctor)
Your own site
<a href="https://agentmods.dev/commands/punt-labs/z-spec/doctor"><img src="https://agentmods.dev/badge/commands/punt-labs/z-spec/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/punt-labs/z-spec/doctor"><img src="https://agentmods.dev/badge/commands/punt-labs/z-spec/doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5 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,001 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00005 $0.01001
Opus 5 $0.00003 $0.00500
Sonnet 5 $0.00001 $0.00200
Haiku 4.5 $0.00001 $0.00100

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

Security

Grade B, and why

doctor scanned grade B 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 8d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

— no `sudo texhash` step is needed or effective, since `TEXMFHOME` is not
plugin/commands/doctor.md · 120 lines

How it starts

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

Z Environment Health Check

Run diagnostic checks on the Z specification toolchain and report results in a status table.

Checks

Run all checks, collecting results before producing output. Run independent checks in parallel where possible.

1. Platform (informational)

uname -s   # Darwin or Linux
uname -m   # arm64, x86_64, etc.

2. Required toolchain (fuzz, probcli, plugin version)

Call mcp__plugin_z-spec_zspec__doctor. It returns {version, fuzz, probcli, healthy} — the plugin version string, the resolved fuzz and probcli binary paths (or null when absent), and an overall healthy flag for the required pair.

Report fuzz and probcli as presence, not version: installed (<path>) when the path field is set, not found when it is null. Do not report fuzz or probcli binary version strings — the tool does not provide them. (Binary versions return once DoctorReport is widened; that work is beaded.)

  • fuzz null: suggest Run /z-spec:setup fuzz.
  • probcli null: suggest Run /z-spec:setup probcli.

probcli handles both Z specifications (.tex) and B machines (.mch, .ref, .imp).

3. fuzz.sty (required)

kpsewhich fuzz.sty

If missing: suggest Run /z-spec:setup fuzz. That installs fuzz.sty into TEXMFHOME and refreshes that tree's filename database itself, unprivileged — no sudo texhash step is needed or effective, since TEXMFHOME is not the system tree texhash rebuilds.

4. Tcl/Tk (conditional — macOS only)

Only check on Darwin. Present if EITHER Homebrew has tcl-tk OR wish is on PATH (catches installs outside Homebrew). The probe always prints one line, so the status table populates even when brew is absent:

brew list tcl-tk >/dev/null 2>&1 || command -v wish >/dev/null 2>&1 && echo "Tcl/Tk: installed" || echo "Tcl/Tk: not found"

If it prints not found on macOS: suggest brew install tcl-tk.

5. elan (optional — for /z-spec:prove)

command -v elan >/dev/null 2>&1 && elan --version || echo "elan: not installed"

Read the full file on GitHub · 120 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. 8d ago First seen · 120 lines · 5 tokens per session scan B c4c1afdb2bfc

Subscribe to this mod's changes

doctor is a command published in the GitHub repository punt-labs/z-spec (5 stars, last pushed yesterday), licensed MIT. It adds 5 tokens to every session and 1,001 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.