By Redtropig
Warn-only, zero-dependency runtime harness layer for Claude Code (companion to superpowers): persistent state, scope control (prompt + action side), Default-FAIL verification & coverage gates, entropy governance (golden-rules + drift detection), and first-class C/C++ engineering (CMake/Meson/Make/Bazel + clang-tidy + sanitizers).
Scaffold harness-anchor state files (AGENTS.md, feature_list.json, init.sh, progress.md, session-handoff.md, PROJECT-TOC.md) into the current project.
Initialize C/C++ project-specific harness files (.clang-format, .clang-tidy, sanitizer build, init.sh tuned per build system). Run AFTER /anchor.
On-demand code-drift / entropy scan (garbage collection) via a fresh-context drift-analyst subagent. Checks changed/active code against golden-rules.md + generic drift heuristics (dead code, duplication, doc-drift) and reports findings with an evidence path. Read-only — recommends, never auto-refactors. Not `git gc`.
(Re)build PROJECT-TOC.md — one-line index of every git-tracked source file, with git-commit freshness anchor.
Build a C/C++ project under runtime sanitizers (ASan+UBSan by default; TSan separately) and run its tests, reporting findings in fixed sections. Use for crashes, leaks, use-after-free, undefined behavior, or data races — or before merging C/C++ changes. Heavy build, so it is a command, never a hook.
Use when /test-plan runs or the calling agent needs a fresh-context coverage-gap analysis before a feature is called done. Derives test obligations from code + spec (post-implementation, gray-box), finds gaps — including paths and built binaries that sit OUTSIDE what the test runner executes — and recommends a minimal, oracle-independent-first test set. Read-only.
Use when C/C++ build fails — compile/link/configure error, missing header or package. Diagnoses root cause from build output. Read-only.
Use when /gc runs or the calling agent needs a fresh-context scan for code drift, entropy, or AI slop before wrapping up. Checks changed/active code against the project's golden-rules.md plus generic drift heuristics (duplicated helpers, inconsistent error handling, copy-paste blocks, oversized files, TODO pileup, doc-drift) and reports violations with an evidence path. Read-only — recommends, never refactors.
Use when PROJECT-TOC.md needs rebuilding — after refactors, renames, or SessionStart toc_stale. Runs index-builder.mjs. Writes only PROJECT-TOC.md.
Use when user invokes /verify or calling agent needs fresh-context evaluation of done-ness. Runs build/tests/lint, reports evidence paths. Read-only.
Use before claiming "done", "fixed", "complete", "passing". Default-FAIL contract — every criterion needs evidence; express uncertainty if missing.
Use when the same mistake or bad pattern recurs, when a code-review comment is really a convention worth enforcing, or when you catch AI-generated drift/slop and want it to never happen again. Encodes the lesson as a durable rule in golden-rules.md — the feedback-flywheel / harness-layer-learning ratchet — instead of a one-off fix. Generic (language-agnostic).
Use when sessions run long, adding subagents, fetching large files, or planning context-heavy work. SELECT/WRITE/COMPRESS/ISOLATE discipline.
Use in C/C++ projects for build configure/errors, compile_commands.json generation, or selecting CMake/Meson/Make/Bazel commands.
Use in C/C++ projects for clang-format. Changed-lines-only; never reformat unchanged code mid-feature. .clang-format from root or LLVM baseline.
Modifies files
Hook triggers on file write and edit operations
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Runtime constraint layer for Claude Code agents. Companion to
superpowers. Anchors your agent to project state, scope boundaries, evidence-based completion, test-coverage design, entropy governance (golden rules + drift scan), C/C++ engineering best practices, and a strict docs-lookup discipline.
superpowers gives your agent process methodology (brainstorm → plan → TDD → review).
harness-anchor gives your agent environment & state discipline (where am I, what's the active feature, what counts as "done", which files exist, what to do when stuck on an unfamiliar tool).
Together they form a complete harness based on Anthropic's Effective Harnesses for Long-Running Agents and the learn-harness-engineering 5-subsystem model:
| Subsystem | Provided by |
|---|---|
| Instructions | superpowers + harness-anchor (using-harness-anchor) |
| State | harness-anchor (feature_list.json, progress.md, session-handoff.md, golden-rules.md) |
| Verification | harness-anchor (anti-hallucination-gates, /verify) + superpowers (TDD) |
| Scope | harness-anchor (active-feature lock, scope-jump detection) |
| Lifecycle | harness-anchor (init.sh, /session-end) |
# 1. Register the marketplace (from the published GitHub repo)
claude /plugin marketplace add Redtropig/harness-anchor
# 2. Install
claude /plugin install harness-anchor@harness-anchor-local
# 3. Start a session; SessionStart hook injects harness-anchor banner
claude
You should see a <harness-anchor-state>...</harness-anchor-state> block in the agent's awareness on session start.
# In your project root:
/anchor # scaffolds AGENTS.md, feature_list.json, init.sh, progress.md,
# session-handoff.md, PROJECT-TOC.md, context-budget.md, golden-rules.md
/cpp-init # (C/C++ projects only) tunes init.sh, drops .clang-format,
# .clang-tidy, scripts/sanitizer-build.sh
/index-project # builds PROJECT-TOC.md from your git-tracked files
bash init.sh # health-check the environment
# Then work normally; on session end:
/session-end # writes structured handoff, appends progress.md, suggests commit
| Skill | When it fires |
|---|---|
using-harness-anchor | Auto-loaded at every session start (meta-skill) |
project-indexing | Locating files; consults PROJECT-TOC.md before Glob |
feature-state-keeper | Starting/advancing/finishing/blocking a feature |
init-verification | Start of work; after env change; when something stops working |
self-correction-loop | After tool/hook returns warning, lint/type/build error |
anti-hallucination-gates | Before claiming "done", "fixed", "passing" |
test-coverage-design | Deciding what to test; is a feature covered before "done" (dispatches coverage-analyst) |
capturing-golden-rules | The same mistake recurs / a review comment is really a convention — encode it as a durable rule (the feedback flywheel) |
context-budget-discipline | Long sessions; subagents; large file fetches |
docs-lookup | Looking up unfamiliar tools/APIs/errors (Context7 → WebSearch → uncertainty) |
cpp-build-systems | CMake/Meson/Make/Bazel projects |
cpp-static-analysis | clang-tidy / cppcheck / IWYU |
cpp-formatting | clang-format |
cpp-sanitizers | ASan / UBSan / TSan / valgrind |
Task tool or slash commands)| Agent | Role |
|---|---|
verification-runner | Fresh-context evaluator — runs build/tests/lint, reports evidence paths. Read-only. |
coverage-analyst | Fresh-context coverage-gap analyst — derives test obligations from code + spec, flags paths outside the run scope, recommends oracle-independent-first tests. Read-only. |
drift-analyst | Fresh-context drift / entropy scanner — checks changed code against golden-rules.md + slop heuristics (dead code, duplication, doc-drift), reports findings with an evidence path. Read-only. |
cpp-build-doctor | Diagnoses C/C++ build failures from compiler output. Read-only. |
index-curator | Sole writer of PROJECT-TOC.md. Used by /index-project. |
npx claudepluginhub redtropig/harness-anchor --plugin harness-anchorMulti-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.
Memory compression system for Claude Code - persist context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.