harness-doctor

harness-doctor is a skill for Claude Code, Codex from Mark-Life/agent-skills. It costs 85 tokens per session (2,490 once invoked), scanned A, original, MIT.

A report generator that examines recent coding-agent transcripts across projects and summarizes time, token use, and repeated human corrections.

In plain words
What is it for?
Use it to audit a chosen number of past days, produce fact tables, and identify which workflow changes could reduce recurring costs or corrections.
Why use it?
It reveals waste that is hard to notice in one session, such as an expensive command repeated many times.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it to audit a chosen number of past days, produce fact tables, and identify which workflow changes could reduce recurring costs or corrections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mark-life/agent-skills/harness-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.

Any agent
npx skills add Mark-Life/agent-skills --skill harness-doctor
Clone the repo
git clone --depth 1 https://github.com/Mark-Life/agent-skills

Made for: Claude Code, Codex.

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/skills/mark-life/agent-skills/harness-doctor/github.svg)](https://agentmods.dev/skills/mark-life/agent-skills/harness-doctor)
Your own site
<a href="https://agentmods.dev/skills/mark-life/agent-skills/harness-doctor"><img src="https://agentmods.dev/badge/skills/mark-life/agent-skills/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/skills/mark-life/agent-skills/harness-doctor"><img src="https://agentmods.dev/badge/skills/mark-life/agent-skills/harness-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,490 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00085 $0.02490
Opus 5 $0.00043 $0.01245
Sonnet 5 $0.00017 $0.00498
Haiku 4.5 $0.00009 $0.00249

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

Security

Grade A, and why

harness-doctor scanned grade A 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 11d ago.

The scan reads SKILL.md. This mod also ships 27 executable files (scripts/audit.py, scripts/audit.ts, scripts/lib/__init__.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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 directorieslowAgent snooping

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

As the last step of every run, after the fix list, read `~/.claude/settings.json` and report the retention window:

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/inspect-and-debug/harness-doctor/SKILL.md · 107 lines

How it starts

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

Harness Doctor

Harness Doctor is the fleet view over the agent's own history. It mines the last $days of agent transcripts across every project on this machine and answers one question — where did the wall-clock, the tokens, and the repeated corrections go, and what change stops the bleeding. It reads the whole session tree, workflow and subagent transcripts included, and turns it into five fact tables plus a ranked fix list. The waste is invisible from inside any single session: a command that costs 9 seconds is nothing until you see it ran 1,400 times.

This is a user-invoked command (/harness-doctor); the window in days arrives as $days. When it is empty, use 30 — the templates below already do.

How to run

The auditor is zero-dependency with no build step, shipped twice: scripts/audit.ts and scripts/audit.py. They take the same flags and write the same tables — pick whichever runtime exists. Detect with command -v node bun python3 on macOS/Linux, or where node bun python on Windows, then run from the skill's scripts/ dir:

node audit.ts --days "${days:-30}"        # Node >= 22.18 (native TS type-stripping)
bun run audit.ts --days "${days:-30}"     # Bun
npx tsx audit.ts --days "${days:-30}"     # older Node, no install needed
python3 audit.py --days "${days:-30}"     # no JS runtime at all

The summary goes to stdout; progress goes to stderr, so node audit.ts --format json > facts.json stays clean. In md mode the last stdout line is the work dir holding the fact tables — --no-tables writes none and prints none.

Three more flags carry the work: --project <substr> narrows to project dirs matching the substring (repeatable); --top <n> sets rows per ranking (default 15), but --format md clamps every table to 25 rows whatever --top says, so ask for a deeper table with --format json; --format json emits the machine shape documented in reference/stats.md. The rarer ones — --out, --root, --no-tables, --no-redact, --pricing — are in the CLI table in reference/stats.md. --no-redact writes prompts and command output verbatim, secrets included: pass it only when the user asks for it by name.

Read the full file on GitHub · 107 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. 11d ago First seen · 107 lines · 85 tokens per session scan A 31e2946e727b

Subscribe to this mod's changes

harness-doctor is a skill published in the GitHub repository Mark-Life/agent-skills (2 stars, last pushed 26d ago), licensed MIT. It adds 85 tokens to every session and 2,490 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A 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.

Related

Other skills, from other repositories