rules-as-files

rules-as-files is a skill for Claude Code from tonydzi/claude-bible. It costs 69 tokens per session (1,121 once invoked), scanned A, original, MIT.

A set of instructions for keeping each human or AI-agent rule in its own markdown file, with a small always-loaded index.

In plain words
What is it for?
Use it when adding a rule, slimming CLAUDE.md or AGENTS.md, resolving conflicts, recording a deferred decision, or explaining why a proposal cannot proceed.
Why use it?
It reduces bloated instruction files and gives conflicting rules, rejected proposals, and no-go decisions a documented place.

Skill for Claude Code

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

Part of the rules-as-files plugin — 1 skill shipped together

Good fit Use it when adding a rule, slimming CLAUDE.md or AGENTS.md, resolving conflicts, recording a deferred decision, or explaining why a proposal cannot proceed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tonydzi/claude-bible/rules-as-files
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 tonydzi/claude-bible --skill rules-as-files
Clone the repo
git clone --depth 1 https://github.com/tonydzi/claude-bible

Made for: Claude Code.

Or install rules-as-files, the plugin that ships this one along with the rest of its 1 skill.

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-as-files

README.md
[![agentmods](https://agentmods.dev/badge/skills/tonydzi/claude-bible/rules-as-files/github.svg)](https://agentmods.dev/skills/tonydzi/claude-bible/rules-as-files)
Your own site
<a href="https://agentmods.dev/skills/tonydzi/claude-bible/rules-as-files"><img src="https://agentmods.dev/badge/skills/tonydzi/claude-bible/rules-as-files/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-as-files

Your own site · 80×15
<a href="https://agentmods.dev/skills/tonydzi/claude-bible/rules-as-files"><img src="https://agentmods.dev/badge/skills/tonydzi/claude-bible/rules-as-files.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,121 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.00069 $0.01121
Opus 5.5 $0.00028 $0.00448
Sonnet 5.5 $0.00014 $0.00224
Haiku 4.5 $0.00007 $0.00112

Measured 9d ago against content hash 71fa058b900f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rules-as-files 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 9d 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.

plugin/skills/rules-as-files/SKILL.md · 91 lines

How it starts

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

Rules as files

A working method for rules that a human, their assistants and their AI agents all follow. Each rule is one markdown file; the always-loaded layer carries only a short pointer to it. The full specification is in SPEC.md; fill-in templates are in templates/.

This skill is instructions only. It reads and writes markdown files in the user's own project and never runs programs or sends data anywhere.

When to use it

  • The user says a new rule in chat ("from now on...", "never again...", "always...").
  • CLAUDE.md / AGENTS.md has grown into full prose rules and needs slimming.
  • Two rules disagree and you must decide which one wins.
  • The user rejects or defers a proposal worth remembering.
  • You are about to tell the user "no-go" on something they want.

1. Write a rule (intake)

  1. Ask the routing questions in order (SPEC section 4):

    • Could a human employee follow it? Then it is a behavioral rule file.
    • Is it about how the agent works internally (models, tools, paths)? Then agent config plus a memory note.
    • Is it a fact or preference, not a behavior? Then memory.
    • Is it "every time X, do Y" and deterministic? Then a hook or scheduled script, not prose.
  2. Create one file from templates/rule-template.md. Fill the frontmatter: title, type, date_established (today, from the clock), status: active, origin (who stated it), authored_by, audience. Always write the Why section.

  3. Add exactly one index line to the always-loaded file:

    ## <Trigger: when this fires>
    <Essence in 1-3 sentences.>
    Canon: `<rule-file-name>`
    
  4. Link at least one related rule in both directions.

  5. Name the door: the skill, command, hook or scheduled job that will invoke the rule (SPEC section 9). If none exists yet, add the rule to a short list of doorless rules with the reason.

  6. Report back where the rule lives and where its index line went. Do not postpone the intake because the index file is large; report its size instead (SPEC section 10).

  7. Test before saying done: would a parallel session that never saw this chat pick the rule up by itself? If not, it is not captured.

Read the full file on GitHub · 91 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 91 lines · 69 tokens per session scan A 71fa058b900f

Subscribe to this mod's changes

rules-as-files is a skill published in the GitHub repository tonydzi/claude-bible (14 stars, last pushed 2d ago), licensed MIT. It adds 69 tokens to every session and 1,121 once invoked, about $0.0003 per session on Opus 5.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-11-21.

Related

rules-as-files compared with skills from other repositories

rules-as-files next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rules-as-filestonydzi/claude-bibleSkill142d agoMITA69Claude Code
Agent Design Principlesniels-emmer/myaceSkill1yesterdayMITA34Claude Code, Codex
memoryguardirisxc4/memoryguardSkill32mo agoMITA32Claude Code
heartwood-recalljermayne36/heartwood-memorySkill04d agononeA37Claude Code, Codex
agent-code-analyzerruvnet/rufloSkill83ktodayMITA19Claude Code
worker-integrationruvnet/rufloSkill83ktodayMITA14Claude Code
eval-dataset-designbojieli/ai-agent-bookSkill60kyesterdayApache-2.0A138Claude Code, Codex