harness
A Claude Code plugin that blocks on facts and advises on taste.
One command — /harness:plan — takes a request from a vague sentence to reviewed,
working code, stopping once for your approval. Underneath, it blocks on facts
(syntax, types, tests) and advises on taste (design, bloat, docs), with every
judgement call delegated to a specialist reading in a context of its own.
Install
claude plugin marketplace add mthanhlm/harness
claude plugin install harness@autonxt-harness
Updates come from the remote, so a change is only live once it is pushed:
claude plugin marketplace update autonxt-harness
Bump version in plugin.json with every change that must reach a running
session. That command refreshes marketplace metadata but does not re-fetch a
plugin whose version it has already seen — it finds the version directory
present, leaves it, and reports success while the hooks go on executing the old
code. The failure reads as "I fixed it and nothing changed", so the next move is
usually to go and change correct code. python3 -m pytest -m prepublish fails
when anything under plugins/ changes without the version moving — run it
before publishing. It is deselected from a plain pytest on purpose: it is the
only check here that asserts a property of the working tree rather than of the
code, so leaving it in the default run made every mutation test pass by
definition, and a sweep of eighteen scored eighteen against a suite that was
blind to several of them.
To develop against a local clone instead — edits take effect on the next session
with no push cycle:
claude plugin marketplace add ~/lam/harness
claude plugin install harness@autonxt-harness
Or load it for a single session without installing at all:
claude --plugin-dir ~/lam/harness/plugins/harness
What runs automatically
| When | What happens |
|---|
| Session start | Detects how this repo is checked and says so, once |
| Prompt submitted | Nudges toward /harness:plan when the request looks like implementation work |
| Before an edit | Past 3 files or 100 lines with no agreed plan, asks — once per session |
| After an edit | Format, lint, syntax and types on the touched file (~0.1–0.2s measured) |
| A shell command runs | Records what it changed, so the scope fence can see it |
| A worker finishes | Re-checks every file that worker touched, and only those |
| Turn ends | Full type-check, tests, build, and a scope check against the plan |
| Session ends | Records real token cost to the ledger |
What you invoke
There is one entry point. Everything else the model loads for itself.
| Command | Does |
|---|
/harness:plan | Start here. Argues with the request, works out what you actually want, gets your approval — then builds and reviews it |
/harness:review | Standalone review, for code you didn't just write (a PR, inherited code) |
Hidden but model-invocable: implement. Everything else that used to be a
skill is now either a script the flow runs or a page an agent reads — see
"Thinning the surface" below.
Two things you run by hand rather than as a command. $CLAUDE_PLUGIN_ROOT and
$CLAUDE_PLUGIN_DATA are not shell variables — Claude Code substitutes them
into skill and agent text and into hook commands, and nowhere else, so your own
terminal has neither. Set them once:
export CLAUDE_PLUGIN_ROOT=~/.claude/plugins/cache/autonxt-harness/harness/<version>
export CLAUDE_PLUGIN_DATA=~/.claude/plugins/data/harness-autonxt-harness
python3 "$CLAUDE_PLUGIN_ROOT/scripts/ledger.py" # what sessions cost, and the rework figure
python3 "$CLAUDE_PLUGIN_ROOT/scripts/switch.py" off # kill switch
CLAUDE_PLUGIN_DATA is the one that matters: the scripts read it to find the
ledger and the contracts, and without it they resolve a different directory from
the hooks and report a confident nothing. The report answered "No sessions
recorded yet" over a ledger holding ten sessions and $830.
Which model runs what
One rule decides every model in the plugin:
Searching, comparing and pattern-matching are Sonnet work. Simulating an
execution nobody wrote down is Opus work. And whichever component does the
high-volume work runs cheap, whatever else is true.
Subagents run on their own declared model regardless of the parent, so this holds
however you have your own session set. Measured: a Sonnet session spawning an
Opus judgement agent billed both, $0.075 and $0.146, in one turn.