Borrowing it
Nothing to install: this file belongs to chris-peterson/ClaudeWatch. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/chris-peterson/ClaudeWatch/main/AGENTS.mdgit clone --depth 1 https://github.com/chris-peterson/ClaudeWatchWrote 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/instructions/chris-peterson/claudewatch/agents-md)<a href="https://agentmods.dev/instructions/chris-peterson/claudewatch/agents-md"><img src="https://agentmods.dev/badge/instructions/chris-peterson/claudewatch/agents-md/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/instructions/chris-peterson/claudewatch/agents-md"><img src="https://agentmods.dev/badge/instructions/chris-peterson/claudewatch/agents-md.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.03331 | $0.03331 |
| Opus 5.5 | $0.01332 | $0.01332 |
| Sonnet 5.5 | $0.00666 | $0.00666 |
| Haiku 4.5 | $0.00333 | $0.00333 |
Grade E, and why
ClaudeWatch AGENTS.md scanned grade E with 2 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 25d 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.
Reaches for credential fileshighPrivilege escalation
SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.
`~/.aws/credentials`). These are user-home patterns, not platform-specific Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
`except` to skip prompts on demonstrably-safe variants (`rm -rf /tmp/...`), How it starts
The opening of the file, as written. The whole thing — 238 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Working on ClaudeWatch
This is the build philosophy and key constraints document for ClaudeWatch.
The contract lives in SPEC.md; this document captures the how to
think about it. Every Claude Code session should read this before making
non-trivial changes.
What ClaudeWatch is
A Claude Code plugin that wraps every shell invocation — Bash and Monitor,
which runs its command in the same shell — in a PreToolUse hook and applies
regex-based safety rules. The core safety advantage over Claude
Code's built-in deny rules is that patterns match anywhere in the command
string (re.search()), so compound commands (git add . && git push --force),
heredocs, and reordered flags are not bypassable by syntactic tricks.
Core contracts (don't break these)
- Determinism. Given the same command, the same
cwdand project root, the samewatches/tree, and the same on-disk state of the paths those name, the engine must always produce the same decision. No clocks, no randomness, no network on the decision path.cwdandCLAUDE_PROJECT_DIRenter the decision only as the deterministic per-invocation inputs theis_in_project_treepredicate ([RL-15], [RL-16]) resolvesrmtargets against — pure string work, no filesystem access.CLAUDE_PROJECT_DIRis the one environment variable on the decision path;CLAUDEWATCH_LOGgoverns a side channel only. The one predicate that does read the filesystem isis_recoverable([RL-18]), which asks git whether a delete target could be restored — a question with no textual answer. Its calls are read-only, bounded, and fail closed, so the decision stays a function of the command, the roots, and the on-disk state those name; a second predicate wanting filesystem access is a spec change, not a local call. Decision logging (on by default, see [LOG-01]–[LOG-04];CLAUDEWATCH_LOG=offopts out) is a side channel: it stamps a timestamp and writes a file after the decision is computed, never feeding back into it. Keep it that way — the clock stays in_log_event, not inevaluate_rules. - Exit code is always 0. A non-zero exit blocks the host (Claude Code)
from getting a useful decision. All errors are surfaced as
denydecisions with explanatory messages. - Single coalesced decision per invocation. Multiple matching rules
across multiple rule sets aggregate into one
deny(preferred) or oneask. Never emit more than one decision. - The engine ships self-contained.
scripts/watchdog.pyand everything on the decision path use only the Python standard library (with a minimal built-in YAML parser), so the plugin installs cleanly and evaluates rules fast in any environment Claude Code runs in — no pip step on the hot path. Build- and release-time tooling that never runs on the decision path (e.g. shipyard'sgen-plugin-json, run by CI's project job) may use PyYAML; it never runs in the hook. - Allow-by-default. When no rule matches, the engine produces no stdout output. Silence is allow.
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.
- 25d ago Changed · +1 lines · +4 tokens per session c3cde939f472
- 1mo ago Changed · +10 lines · +182 tokens per session 1d8e80be6477
- 1mo ago Changed · +18 lines · +345 tokens per session bfb9c930c848
- 1mo ago First seen · 209 lines · 2,800 tokens per session scan E 7a52d5abe7d2
ClaudeWatch AGENTS.md is an instructions file published in the GitHub repository chris-peterson/ClaudeWatch (3 stars, last pushed today), licensed MIT. It adds 3,331 tokens to every session, about $0.0133 per session on Opus 5.5. A static security scan graded it E with 2 findings (reaches for credential files, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.