rules

rules is a skill for Claude Code, Codex from chris-peterson/ClaudeWatch. It costs 60 tokens per session (1,562 once invoked), scanned A, original, MIT.

An interactive editor for ClaudeWatch safety rules. These rules decide which command-line actions are blocked or require confirmation before they run.

In plain words
What is it for?
List rule sets, add, move, remove, enable, or disable rules, create a new rule set, preview changes, and run rule tests.
Why use it?
It makes safety rules easier to inspect and change while checking for conflicts and testing the result before saving.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the ClaudeWatch plugin — 2 skills, 3 hooks shipped together

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.

agentmods
npx agentmods add skills/chris-peterson/claudewatch/rules
Any agent
npx skills add chris-peterson/ClaudeWatch --skill rules
Clone the repo
git clone --depth 1 https://github.com/chris-peterson/ClaudeWatch

Made for: Claude Code, Codex.

Or install ClaudeWatch, the plugin that ships this one along with the rest of its 2 skills, 3 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 rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/chris-peterson/claudewatch/rules.svg)](https://agentmods.dev/skills/chris-peterson/claudewatch/rules)
Your own site
<a href="https://agentmods.dev/skills/chris-peterson/claudewatch/rules"><img src="https://agentmods.dev/badge/skills/chris-peterson/claudewatch/rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,562 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00060 $0.01562
Opus 5 $0.00030 $0.00781
Sonnet 5 $0.00012 $0.00312
Haiku 4.5 $0.00006 $0.00156

Measured 5d ago against content hash df46f4cd3360, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 5d 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/SKILL.md · 172 lines

How it starts

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

A rule set is a watches/watch-*.yml file; each holds block and ask rules that the PreToolUse hook matches against commands. This skill lists them and walks any change through preview and tests before writing.

Steps

1. Find the plugin root

All paths below are relative to ${CLAUDE_PLUGIN_ROOT}, which Claude Code sets when the skill runs. If it is empty, stop and report — do not guess a path, since running against the wrong directory would edit the wrong rule files.

2. Discover rule sets

List YAML files in ${CLAUDE_PLUGIN_ROOT}/watches/. Each file is a rule set (e.g. watch-git.yml, watch-installs.yml).

Also check for disabled rule sets — files ending in .yml.disabled in the same directory. These are rule sets that have been toggled off.

3. Read and display rules for each rule set

For each enabled rule set, present rules in two tables. Use the rule set name field as the heading. Use the naming convention <ruleset>-block-NN / <ruleset>-ask-NN for IDs, where <ruleset> is the short name from the YAML name field (e.g. watch-gitgit), and NN is zero-padded (e.g. git-block-01, installs-ask-03):

watch-git (watches/watch-git.yml)

🚫 block — rejected outright:

id command reason
git-block-01 name reason

❓ ask — require confirmation:

id command reason
git-ask-01 name reason

After listing all enabled rule sets, if any disabled rule sets exist, list them:

Disabled rule sets:

  • watch-foo (watches/watch-foo.yml.disabled)

4. Check for --list flag

If the user passed --list, stop here and do not enter the edit loop.

5. Prompt for edits

Ask: "Make any changes? (Enter a command or press Enter to skip)"

Commands:
  <id>:block      — move rule to block       (e.g. git-ask-02:block)
  <id>:ask        — move rule to ask          (e.g. git-block-03:ask)
  <id>:allow      — remove rule entirely      (e.g. installs-ask-05:allow)
  add             — add a new rule
  disable <name>  — disable an entire rule set (e.g. disable watch-files)
  enable <name>   — re-enable a disabled rule set (e.g. enable watch-files)
  new             — create a new custom rule set
  done / ↵        — finish
>

Read the full file on GitHub · 172 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. 5d ago First seen · 172 lines · 60 tokens per session scan A df46f4cd3360

Subscribe to this mod's changes

rules is a skill published in the GitHub repository chris-peterson/ClaudeWatch (3 stars, last pushed 2d ago), licensed MIT. It adds 60 tokens to every session and 1,562 once invoked, about $0.0003 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.