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.
npx skills add Redtropig/harness-anchor --skill self-correction-loopgit clone --depth 1 https://github.com/Redtropig/harness-anchorWrote 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.
[](https://agentmods.dev/skills/redtropig/harness-anchor/self-correction-loop)<a href="https://agentmods.dev/skills/redtropig/harness-anchor/self-correction-loop"><img src="https://agentmods.dev/badge/skills/redtropig/harness-anchor/self-correction-loop.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.01608 |
| Opus 5 | $0.00017 | $0.00804 |
| Sonnet 5 | $0.00007 | $0.00322 |
| Haiku 4.5 | $0.00003 | $0.00161 |
Grade A, and why
self-correction-loop scanned grade A with 0 findings 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 6d ago.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Self-Correction Loop
When your edit produces a warning/error signal, you're in a correction loop. This skill is the discipline that keeps the loop productive instead of thrashing.
Trigger signals
You should engage this loop when ANY of these happen after your edit:
PostToolUsehook injectedclang-tidy warnings:/lint warnings:/ similar- A
Bashcommand you ran returned non-zero exit - A test runner reports failures
- A type-checker reports errors
- The user says "that broke X" / "it's failing now"
The Loop (RED → diagnose → minimal-fix → GREEN)
This is TDD's RED-GREEN-REFACTOR adapted for correction:
1. CAPTURE the signal
- What is the EXACT error message?
- Which file / line?
- What was my last change?
2. DIAGNOSE root cause (not symptom)
- Read the error carefully — the answer is often in it
- Check if my change broke an invariant elsewhere
- Do NOT guess. If unclear, narrow with prints / smaller test cases
3. MINIMAL FIX
- Smallest possible change that resolves THE specific issue
- No "while I'm here" tangents (that's scope creep — see scope-jump)
- Do NOT mask the error (e.g. catch-and-ignore) without explicit reason
4. RE-VERIFY
- Run the same command that produced the signal
- Observe the new output
- Capture it as evidence
Loop budget
This loop is for surface signals that a quick minimal fix resolves. If a minimal fix doesn't clear the signal within 1–2 iterations — or the failure spans components / needs backward root-cause tracing — switch to superpowers:systematic-debugging (its 4-phase root-cause process). Don't keep thrashing minimal fixes here.
If you've iterated 3 times on the same signal without resolving it, stop and escalate:
- Switch to
superpowers:systematic-debuggingfor structured root-cause investigation (its budget also caps at 3 fixes → then question the architecture; the two thresholds are intentionally aligned) - Read more of the surrounding code than you have so far
- Invoke
docs-lookupskill for the specific error class (Context7 → WebSearch fallback) - Tell the user: "I've tried 3 approaches to . Latest output: <...>. I need more context. Recommend either or ?"
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.
- 6d ago First seen · 113 lines · 35 tokens per session scan A abfd0263ba13
self-correction-loop is a skill published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 1,608 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
ci-debug
Diagnose a failing CI run against an 11-pattern playbook. Classifies the failure, cites the relevant memory entry, proposes the exact fix command — but NEVER applies without explicit user approval. Use when a specific PR check or GitHub Actions run failed and you want a diagnosis instead of speculation. Don't use for…
paired-probe
Refuse a verdict a probe did not earn. Runs a check where the fault IS present and where it is NOT, and blocks the answer when both arms print the same thing, because a check that cannot disagree with you has measured nothing. Also catches the zero-sample sweep that reads as "clean" and the swallowed error that reads…
simplifier
Replatform mode ("lift, tinker, and shift") — simplify a 1:1-lifted legacy system in place: modernize code and remove external dependencies, one pass at a time, each bracketed by characterization-tests replays, structure preserved. Owns the stack-neutral pass discipline; the transformation catalog and dependency…
error-handling
Apply error handling and recovery patterns in JavaScript/TypeScript or Node.js. Use when implementing error handling, retry logic, or when the user mentions domain errors, error recovery, error escalation.
implement
Implement a feature or fix with automatic validation.
error-handling
Validate error handling completeness across languages.