Claude Code / Codex skill that mines the last N days of Claude Code transcripts across every project on the machine into five fact tables — bash, errors, tokens, human corrections, fan-out — and returns a ranked list of fixes with the measured number behind each one.
Install it with:
npx skills add Mark-Life/agent-skills@harness-doctor -gThen run it:
claude /harness-doctor [days]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. /harness-doctor is the fleet view over the agent's own history — the last 30 days by default, across every project on the machine, workflow and subagent transcripts included — answering where the wall-clock, the tokens, and the repeated human corrections went, and what change stops the bleeding. A zero-dependency script mines every transcript into five JSONL fact tables and prints a ranked summary; the model's job starts after the numbers exist.
The auditor ships twice with no build step, scripts/audit.ts and scripts/audit.py, same flags and same tables, so it runs under Node ≥ 22.18, Bun, npx tsx, or plain python3 when there's no JS runtime at all. Because the counting is a script it's cheap. And the fact tables are the contract, not the script: if neither runtime works, or your transcripts live somewhere other than ~/.claude/projects, you write your own extractor to the same five tables and everything downstream is unchanged.
From there it digs along seven angles — bash economics, errors and environment gaps, context and token economics, human friction, workflow/subagent fan-out, per-repo setup gaps, web research — each with what to compute from which table and the trap that angle carries. Every section of the summary routes to one, and past ~500 sessions in the window it fans out one agent per angle and merges. What comes back is a ranked fix list, ordered by impact over effort rather than grouped by angle, and the rule is that a fix with no number attached does not ship: not "consider caching your builds" but "typecheck": "tsc -b --incremental" next to the measurement behind it, that bun run typecheck ran 412 times for 3.9h of tool time, median 34s, plus the table and filter that produced the number.
It also documents its own failure modes, which is rarer than it should be. Two real errors from a run of this analysis: the headline reported the window's total spend as a saving, and a keyword scan counted the skill's own echoed text as user complaints, 41 reported where 24 were real. Both passed a casual read, so every number now has to be recomputed and every correction re-read in its own row before it's quoted.
Retention is the closing move. Claude Code deletes sessions older than cleanupPeriodDays at startup, default 30, so a 90-day audit on a default install quietly reads 30 days and next quarter's audit is no richer than this one. Every run ends by reporting the setting and offering the exact widening edit, naming the disk cost in the same breath, since transcripts are uncompressed JSONL and a heavy user accumulates gigabytes a year. Two caveats worth knowing going in: v1 parses Claude Code transcripts only, Codex rollouts are skipped; and the fact tables land on disk holding real prompts and real command output, where redaction is best-effort and on by default.
It pairs with context-doctor without overlapping it. context-doctor audits the fixed tax one session pays before you type anything, what's loaded but unused. harness-doctor audits what actually happened across hundreds of sessions and every project, where the time, the tokens and the corrections went. One is a single session's inventory, the other a fleet-wide history.