harness-anchor

A warn-only runtime layer for Claude Code agents.
superpowers gives an agent process
(brainstorm → plan → TDD → review). harness-anchor gives it environment and
state discipline: where am I, what is the active feature, what counts as
"done", and what to do when stuck.
It never blocks a tool call. It keeps state on disk, injects it back at session
start, and makes the agent show its evidence before it claims anything.
What the agent sees
Every session opens with this — real output, from an anchored project:
<harness-anchor-state>
Plugin: harness-anchor v0.18.0
Project root: /home/you/invoice-service
Active feature: feat-3: PDF export pipeline
Project type: generic
Platform: linux
TOC freshness: fresh (8243585b3b97b927cd16672b6095d9270ccc3a3f)
Golden rules: 3 rule(s) — /gc scans changed code against them
Last session handoff (first 10 lines):
# Session Handoff
Last updated: 2026-07-30
Active feature: feat-3
Next action: wire the renderer into the CLI, then run scripts/lint.sh
</harness-anchor-state>
The failure modes it's built around
"Done." — with nothing run. Every criterion starts false. A feature cannot
reach status: pass while its evidence is null, and feature_list.schema.json
rejects that combination — the gate is a schema, not a good intention. Evidence
means a path you can open: a build log, test output, a lint report.
"That's not installed." — after checking one place. The same contract runs
in reverse. Asserting absence requires the scope searched and the date checked —
searched PATH + VS-bundled LLVM, not found (as of 2026-07-31). An empty
command -v proves nothing: VS-bundled LLVM needs vcvars, and Homebrew's is
keg-only.
State that lived in the chat, and a compaction ate it. Feature status,
progress and handoff live in files, not scrollback. Four warn-only sentinels
fire at the danger moments: context filling, compaction imminent,
just-compacted, session stopping.
The change that quietly grew. One active feature at a time. Scope jumps are
caught on the prompt side ("also, could you…") and on the action side — a new
module written while a feature is still in progress.
What it deliberately does not do
- Never blocks. No hook returns
deny or block. They inject context the
agent can correct itself with — feedback loops, not gates.
- Never auto-refactors.
/gc reports drift and stops there.
- Never installs anything. bash + git. JSON parsing walks a
python3 → python → py -3 → node → pure-bash chain, and degrades honestly when
none of them exist.
- Never floods your context. SessionStart injects ≤3000 tokens — banner,
project index, meta-skill; C/C++ and per-OS sections are dropped when they
don't apply, and depth loads on demand.
Install
claude /plugin marketplace add Redtropig/harness-anchor
claude /plugin install harness-anchor@harness-anchor-local
Start a session; the banner above should appear in the agent's context.
(harness-anchor-local is the marketplace id, not a dev build.)
Quick start
/anchor # scaffold the state files
/index-project # build PROJECT-TOC.md from git-tracked files
bash init.sh # health-check the environment
# ...work...
/session-end # write handoff, append progress.md, offer archival + commit
Commands
| Command | What it does |
|---|
/anchor | Scaffold the state files (never overwrites without explicit approval) |
/index-project | (Re)build PROJECT-TOC.md from git-tracked sources |
/status | Read-only snapshot: active feature, counts, git tree, TOC freshness, handoff head |
/verify | Fresh-context subagent runs build + lint + tests, reports evidence paths (--fix = bounded ≤2-cycle auto-fix) |
/test-plan | Fresh-context coverage-gap analysis: obligations from code + spec, plus paths outside the runner's scope |
/gc | Fresh-context drift scan against golden-rules.md + slop heuristics. Report-only (not git gc) |
/session-end | Write handoff, append progress.md, offer archival + commit |
/cpp-init | C/C++: tune init.sh, drop .clang-format / .clang-tidy / lint.sh / sanitizer-build.sh |
/sanitize | C/C++: build under ASan+UBSan, run tests, report with a log evidence path |
Full manual — arguments, prerequisites, outputs: docs/commands.md.
Skills (14, auto-triggered — you never invoke these)