capturing-golden-rules

capturing-golden-rules is a skill for Claude Code from Redtropig/harness-anchor. It costs 87 tokens per session (1,532 once invoked), scanned A, original, MIT.

A method for recording a recurring coding mistake or project convention as a durable rule in golden-rules.md. It turns repeated feedback into a written check for future work.

In plain words
What is it for?
Use it when the same mistake happens again, a review comment reveals a shared convention, or generated code repeatedly introduces the same drift.
Why use it?
It prevents the same problem from being rediscovered and fixed one time at a time. The rules capture patterns that affect more than one change.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions AGENTS.md.

Part of the harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Good fit Use it when the same mistake happens again, a review comment reveals a shared convention, or generated code repeatedly introduces the same drift.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/redtropig/harness-anchor/capturing-golden-rules
Install

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.

Any agent
npx skills add Redtropig/harness-anchor --skill capturing-golden-rules
Clone the repo
git clone --depth 1 https://github.com/Redtropig/harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 agents, 5 hooks.

Wrote 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.

agentmods badge for capturing-golden-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/redtropig/harness-anchor/capturing-golden-rules/github.svg)](https://agentmods.dev/skills/redtropig/harness-anchor/capturing-golden-rules)
Your own site
<a href="https://agentmods.dev/skills/redtropig/harness-anchor/capturing-golden-rules"><img src="https://agentmods.dev/badge/skills/redtropig/harness-anchor/capturing-golden-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for capturing-golden-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/redtropig/harness-anchor/capturing-golden-rules"><img src="https://agentmods.dev/badge/skills/redtropig/harness-anchor/capturing-golden-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.01532
Opus 5 $0.00044 $0.00766
Sonnet 5 $0.00017 $0.00306
Haiku 4.5 $0.00009 $0.00153

Measured 11d ago against content hash c1f817a4d9f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

capturing-golden-rules 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 11d 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.

skills/capturing-golden-rules/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Capturing Golden Rules

A one-off fix repairs today's symptom. A golden rule repairs the whole class — it makes the harness learn so the same mistake can't recur. This skill is the ratchet: turn a recurring failure into a durable, checkable rule in golden-rules.md.

Hashimoto's principle: "Anytime an agent makes a mistake, engineer a solution so it never makes that mistake again." The fix is a guardrail, not a scolding — blame the process, not the agent. You're improving the environment, not the model.

When to capture

Capture when the signal is recurring, not a one-off:

  • The same mistake or bad pattern appears a second time.
  • A code-review comment is really a convention ("we always do X here"), not a one-time nit.
  • /gc (the drift-analyst) flags drift that should have been a rule.

One-off edge cases and personal style stay personal — capture what recurs, or what any contributor would hit. (The archive's lesson: 3 rules, not 30.)

When to write — the same turn, not session end

Capture happens in the turn you recognize the signal — append the rule, then continue the task. Context is a volatile medium: compaction and attention dilution mean a deferred write gets reconstructed from decayed memory (bias) or never happens at all (the intent itself is displaced).

A rough stub written now beats a polished rule written later:

### GR-<n> — <one-line rule>
- **Why / origin:** <paste the evidence at hand: exact error text, file:line, commit sha>
- **Check:** manual review — <what to look at>
  • Quote, don't summarize. An origin pasted at the moment of failure cannot be misremembered; a session-end reconstruction can. This is the anti-bias mechanism, not a convenience.
  • A manual review Check lands in /gc's [MANUAL] tier — mechanically harmless until graduated.
  • Polishing (Check upgrades, tighter wording) is idempotent — /gc adjudication and /session-end's flywheel do it later; a lost lesson cannot be recovered.

Read the full file on GitHub · 119 lines

Changes

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.

  1. 11d ago First seen · 119 lines · 87 tokens per session scan A c1f817a4d9f6

Subscribe to this mod's changes

capturing-golden-rules is a skill published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 87 tokens to every session and 1,532 once invoked, about $0.0004 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.