Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/shimo4228/claude-harnessnpx agentmods add skills/shimo4228/claude-harness/rules-distillWrote 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/shimo4228/claude-harness/rules-distill)<a href="https://agentmods.dev/skills/shimo4228/claude-harness/rules-distill"><img src="https://agentmods.dev/badge/skills/shimo4228/claude-harness/rules-distill/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.
<a href="https://agentmods.dev/skills/shimo4228/claude-harness/rules-distill"><img src="https://agentmods.dev/badge/skills/shimo4228/claude-harness/rules-distill.svg" alt="Reviewed on agentmods" width="80" 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.00123 | $0.02028 |
| Opus 5 | $0.00062 | $0.01014 |
| Sonnet 5 | $0.00025 | $0.00406 |
| Haiku 4.5 | $0.00012 | $0.00203 |
Grade A, and why
rules-distill 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 3d 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 — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.
rules-distill — promote environment-specific facts to rules
Scan installed skills, find principles that belong in the always-loaded rules layer, and distill them into rules — appending to, revising, or creating rule files. The skill produces candidates and verdicts; it never edits rules without your approval.
When to Use
- Periodic rules maintenance (monthly, or after installing new skills)
- After a
skill-stocktakereveals patterns that should be rules - When rules feel incomplete relative to the skills in use
Phase 1 — Inventory (Glob, exhaustive)
Enumerate with Glob (no script):
- Skills:
~/.claude/skills/*/SKILL.md - Rules: read every
~/.claude/rules/**/*.mdin full — the corpus is small (measure live withwc -l; do not hardcode the count here, it drifts every time a rule is added or rightsized), so no grep pre-filter is needed
Glob targets only skill definition files, so dependency markdown under
.venv/.pytest_cacheis excluded structurally.
Present the counts (skills scanned, rule files, headings) before analysis.
Phase 2 — Cross-read & Verdict (inline, holistic)
Read every skill body and every rule into one context and analyze them together — extraction and matching are a single pass. Seeing all skills at once is what makes the recurrence count exact and the "not already in rules" test reliable.
A principle is a candidate only if ALL of these hold:
- Environment-specific — a fact, a wiring, or a trap particular to this machine, harness, or set of accounts. A general engineering principle is not a candidate no matter how many skills repeat it.
- Substrate does not already do it — if the current model handles it natively, a written rule does not add behaviour; it freezes an older default and competes with the newer one.
- Not a procedure — steps and workflows belong in a skill. Residency is for facts and wiring, which have to be true before any particular task starts.
- Actionable behavior change — expressible as "do X" / "don't do Y", not "X is important"
- Clear violation risk — what goes wrong if ignored, in one sentence
- Not already in rules — check the full rules text, including the same idea in different words
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.
- 3d ago Changed · -31 lines 97feb01a3079
- 9d ago First seen · 183 lines · 123 tokens per session scan A fc4499cefa94
rules-distill is a skill published in the GitHub repository shimo4228/claude-harness (2 stars, last pushed 3d ago), licensed MIT. It adds 123 tokens to every session and 2,028 once invoked, about $0.0006 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-31.
Other skills, from other repositories
write-terva-lore
Author terva lore. Lore is context that a person authors in files. terva injects it only when it is keyword-relevant, or always-on. Use to create/add/write lore, "world info", a lorebook entry, keyed background, or a book of facts for a character.
onboard
One-time researcher onboarding interview that compiles a taste/ corpus (SOUL.md, STYLE.md, METHODOLOGY.md, DISMISSALS.md, MEMORY.md, INDEX.md) capturing the researcher's intellectual taste, beliefs, and values. Auto-injects INDEX.md into every future session via SessionStart. Triggers on first install ("no taste…
scheduled-notes
Persistent notes a scheduled/recurring agent reads as its FIRST action and writes as its LAST action, so a weekly/nightly autonomous run "knows where it left off." Use inside /loop or /schedule tasks that span multiple wake-ups. Pairs with hypothesis calibration and the experiment queue.
handoff
Compact the current session into a handoff document. A fresh session or another agent can pick it up with no need to re-derive context. Use when asked to hand off, hand over, wrap up for another session or agent, or park work mid-stream.
agent-adoption-triage
Five-question triage for routing AI work to the right architecture — script, algorithmic search, LLM workflow, or autonomous agentic loop — before any agent is built. Use when someone says "let's build an agent for X", when deciding whether a use case actually needs an autonomous agent, when reviewing an agent…
retrospective
Distill the reusable lessons of this session into the durable homes that shape future sessions. The lessons are corrections, conventions you discovered, and traps you hit. The homes are the project or global AGENTS.md, a project skill, and memory when available. Use when asked for a retro, to capture or remember…