rules-distill

rules-distill is a skill for Claude Code from shimo4228/claude-harness. It costs 123 tokens per session (2,028 once invoked), scanned A, original, MIT.

A maintenance tool that reviews installed skills and finds environment-specific facts that should be kept in always-loaded rule files.

In plain words
What is it for?
Use it to review skills, propose rule changes, and create or update rule files after installing skills or finding gaps. It shows suggestions for approval before editing.
Why use it?
It helps prevent important setup details, connections, and known traps from being buried in skill documents or forgotten.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: reads .claude/ paths.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is [ADR-0018](../../docs/adr/0018-rules-rightsize-for-claude5.md) and.

Good fit Use it to review skills, propose rule changes, and create or update rule files after installing skills or finding gaps. It shows suggestions for approval before editing.

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/shimo4228/claude-harness
agentmods
npx agentmods add skills/shimo4228/claude-harness/rules-distill

Made for: Claude Code.

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 rules-distill

README.md
[![agentmods](https://agentmods.dev/badge/skills/shimo4228/claude-harness/rules-distill/github.svg)](https://agentmods.dev/skills/shimo4228/claude-harness/rules-distill)
Your own site
<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.

agentmods 80×15 button for rules-distill

Your own site · 80×15
<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>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,028 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.00123 $0.02028
Opus 5 $0.00062 $0.01014
Sonnet 5 $0.00025 $0.00406
Haiku 4.5 $0.00012 $0.00203

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

Security

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.

skills/rules-distill/SKILL.md · 152 lines

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-stocktake reveals 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/**/*.md in full — the corpus is small (measure live with wc -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_cache is 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:

  1. 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.
  2. 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.
  3. 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.
  4. Actionable behavior change — expressible as "do X" / "don't do Y", not "X is important"
  5. Clear violation risk — what goes wrong if ignored, in one sentence
  6. Not already in rules — check the full rules text, including the same idea in different words

Read the full file on GitHub · 152 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. 3d ago Changed · -31 lines 97feb01a3079
  2. 9d ago First seen · 183 lines · 123 tokens per session scan A fc4499cefa94

Subscribe to this mod's changes

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.

Related

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.

terva-sh/terva · 66 tokens

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…

Rockielab/rockie-claude · 117 tokens

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.

Rockielab/rockie-claude · 63 tokens

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.

terva-sh/terva · 56 tokens

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…

shimo4228/agent-adoption-triage · 143 tokens

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…

terva-sh/terva · 76 tokens