harness-doctor

harness-doctor is a command for Claude Code from kimsanguine/hplan. It costs 51 tokens per session (1,024 once invoked), scanned B, original, MIT.

An installation health check for the hplan workflow. It checks whether the coding-agent hook, safety gate, saved checkpoints, exclusions list, and Git pre-commit hook are set up correctly.

In plain words
What is it for?
Use it to verify the agent hook is registered, test that protected files are blocked when required, and check the integrity of workflow state and Git safeguards.
Why use it?
It helps find setup problems when hplan was newly installed or when its checks do not behave as expected. The result marks each check as passed, needing attention, or failed.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is | python3 hplan/hooks/gate_guard.py.

Part of the hplan plugin — 8 skills, 11 commands, 4 agents shipped together

Good fit Use it to verify the agent hook is registered, test that protected files are blocked when required, and check the integrity of workflow state and Git safeguards.

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/kimsanguine/hplan
agentmods
npx agentmods add commands/kimsanguine/hplan/harness-doctor

Made for: Claude Code.

Or install hplan, the plugin that ships this one along with the rest of its 8 skills, 11 commands, 4 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/kimsanguine/hplan/harness-doctor"><img src="https://agentmods.dev/badge/commands/kimsanguine/hplan/harness-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 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,024 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.00051 $0.01024
Opus 5 $0.00026 $0.00512
Sonnet 5 $0.00010 $0.00205
Haiku 4.5 $0.00005 $0.00102

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

Security

Grade B, and why

harness-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 10d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/settings.json 2>/dev/null || cat ~/.claude/settings.json 2>/dev/null
hplan/commands/harness-doctor.md · 127 lines

How it starts

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

/harness-doctor

Runs 5 deterministic checks and reports [ PASS ], [ WARN ], or [ FAIL ] per item.

Instructions

You are running the hplan installation health check.

Execute all 5 checks in sequence. Do not skip any check. Collect all results, then output the summary block.


Check 1 — Claude Code Hook Registration

cat .claude/settings.json 2>/dev/null || cat ~/.claude/settings.json 2>/dev/null
  • PASS: Output contains gate_guard.py under PreToolUse hooks
  • WARN: settings.json not found — hook may not be registered
  • FAIL: File found but gate_guard.py not in PreToolUse

Remedy if WARN/FAIL: add the hook path to .claude/settings.json under hooks.PreToolUse.


Check 2 — gate_guard.py Execution

echo '{"tool_input": {"file_path": "docs/PRD.md"}}' \
  | python3 hplan/hooks/gate_guard.py
echo "exit=$?"
  • PASS: exit=2 — gate_guard blocked the write as expected (no checkpoint present)
  • WARN: exit=0 — gate_guard ran but did not block (checkpoint may already exist)
  • FAIL: Any Python error or hplan/hooks/gate_guard.py not found

Note: exit=2 is the correct behavior here. The hook is designed to block writes to protected files until harness/build-gate/checkpoint.json shows status: "approved".


Check 3 — Checkpoint State

python3 -c "
import json, pathlib, sys
cp = pathlib.Path('harness/build-gate/checkpoint.json')
if not cp.exists():
    print('MISSING')
    sys.exit(0)
try:
    d = json.loads(cp.read_text())
    print(d.get('status', 'NO_STATUS'))
except Exception as e:
    print(f'PARSE_ERROR: {e}')
"
  • PASS (approved): Project has passed the Build Gate — writes to PRD/spec files are unblocked
  • PASS (MISSING): No checkpoint yet — normal for a project that hasn't run /harness-build yet
  • WARN (CONDITIONAL_GO / other status): Gate was run but not fully approved
  • FAIL (PARSE_ERROR): checkpoint.json is malformed — delete it and re-run /harness-build

Read the full file on GitHub · 127 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. 10d ago First seen · 127 lines · 51 tokens per session scan B 94459afa7518

Subscribe to this mod's changes

harness-doctor is a command published in the GitHub repository kimsanguine/hplan (2 stars, last pushed 24d ago), licensed MIT. It adds 51 tokens to every session and 1,024 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.