add-rule

add-rule is a skill for Claude Code from Eigenwise/eigenwise-toolshed. It costs 37 tokens per session (1,035 once invoked), scanned A, original, MIT.

A rule manager for a project's live-rules file. It turns coding guidelines into reminders that are automatically supplied to Claude Code when they apply.

In plain words
What is it for?
Adding or editing rules such as running a linter before commits or following a convention when editing certain files.
Why use it?
It reduces the need to repeat instructions or remember them manually during every coding session. Rules are kept separately from CLAUDE.md, the main Claude Code instruction file.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the live-rules plugin — 2 skills shipped together

Good fit Adding or editing rules such as running a linter before commits or following a convention when editing certain files.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Eigenwise/eigenwise-toolshed
Claude Code
/plugin install live-rules

Made for: Claude Code.

Or install live-rules, the plugin that ships this one along with the rest of its 2 skills.

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 add-rule

README.md
[![agentmods](https://agentmods.dev/badge/skills/eigenwise/eigenwise-toolshed/add-rule/github.svg)](https://agentmods.dev/skills/eigenwise/eigenwise-toolshed/add-rule)
Your own site
<a href="https://agentmods.dev/skills/eigenwise/eigenwise-toolshed/add-rule"><img src="https://agentmods.dev/badge/skills/eigenwise/eigenwise-toolshed/add-rule/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 add-rule

Your own site · 80×15
<a href="https://agentmods.dev/skills/eigenwise/eigenwise-toolshed/add-rule"><img src="https://agentmods.dev/badge/skills/eigenwise/eigenwise-toolshed/add-rule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,035 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.00037 $0.01035
Opus 5.5 $0.00015 $0.00414
Sonnet 5.5 $0.00007 $0.00207
Haiku 4.5 $0.00004 $0.00103

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

Security

Grade A, and why

add-rule 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 4d 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.

plugins/live-rules/skills/add-rule/SKILL.md · 77 lines

How it starts

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

Add a rule

Claude Code loads .claude/rules/*.md by itself. You write the file and check it. No hook runs.

1. Pick the shape

Infer as much as you can from the request. Ask only for what you cannot tell, and only one question: where should it apply?

Applies You write How it loads
Always .claude/rules/<name>.md, no paths At session start, and again after compaction
Files matching a glob .claude/rules/<name>.md with paths When Claude touches a matching file
A directory .claude/rules/<name>.md with paths: ["<dir>/**"] Same
A prompt keyword or a procedure to run on request .claude/skills/<name>/SKILL.md The description is the trigger. The body loads when it is used

Rules cannot match words in a prompt. A "when I say X" request is always a skill.

A rule that has to hold through a long session gets no paths. A path rule sits in the conversation, so compaction summarises it away and it only comes back when a matching file is touched again. Keep always-loaded rules few and short: they cost context on every turn, and a CLAUDE.md past about 200 lines is followed less well.

Project scope is the default. Use ~/.claude/rules/ or ~/.claude/skills/ only when the user says user scope or "everywhere". Say which one you used.

If the instruction is a hard check (it must never be skipped), tell the user a rule only advises and a hook or CI check enforces. Write the rule anyway, and say so in one line.

2. Write the file

One concern per file. A name that says the rule: commit-message-style.md, not rules1.md. The first line of the body is an H1 that states the rule. Then a few short imperative lines. Aim well under 1.5 KB for an always-loaded rule and 2 KB for a path-scoped one.

Path-scoped rule:

---
paths:
  - "src/**/*.tsx"
---
# Components are function components

- Use hooks. No class components.
- Keep the test next to the component.

Always-loaded rule: same, with no frontmatter at all.

Read the full file on GitHub · 77 lines

Files

What ships with it

2 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. 4d ago Changed · -66 lines · +1 tokens per session b3d71669c156
  2. 2mo ago Changed · -1 lines bb8248493880
  3. 3mo ago First seen · 144 lines · 36 tokens per session scan A 7aadd1505ab8

Subscribe to this mod's changes

add-rule is a skill published in the GitHub repository Eigenwise/eigenwise-toolshed (290 stars, last pushed today), licensed MIT. It adds 37 tokens to every session and 1,035 once invoked, about $0.0001 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-08-30.

Related

add-rule compared with skills from other repositories

add-rule next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
add-ruleEigenwise/eigenwise-toolshedSkill290todayMITA37Claude Code
claude-code-bash-patternssecondsky/claude-skillsSkill2578d agoMITB52Claude Code
complainsaadshahd/moo.mdSkill38yesterdayMITA88Claude Code
discovery-call-scoringstefanoskarakasis/Product-Marketing-SkillsSkill21yesterdayMITA114Claude Code
session-relayclaude-world/director-mode-liteSkill801mo agoMITA82Claude Code, Codex
developer-experienceoborchers/fractional-ctoSkill391mo agoMITA96Claude Code
smoothsaadshahd/moo.mdSkill38yesterdayMITA85Claude Code