ClaudeWatch AGENTS.md

ClaudeWatch AGENTS.md is an instructions file for Codex, OpenCode from chris-peterson/ClaudeWatch. It costs 2,800 tokens per session, scanned E, original, MIT.

Repository instructions for ClaudeWatch, a Claude Code plugin that checks shell commands before they run and applies regular-expression safety rules. A shell is the command environment used to run tools such as Bash.

In plain words
What is it for?
Maintaining the command-safety engine, its project-path checks, watched files, and behavior for allowing, asking about, or denying shell commands.
Why use it?
They explain the safety rules and fixed decision requirements, including checks that cannot be bypassed by combining commands or rearranging options.

Instructions file for CodexOpenCode

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 instructions/chris-peterson/claudewatch/agents-md
Clone the repo
git clone --depth 1 https://github.com/chris-peterson/ClaudeWatch

Made for: Codex, OpenCode.

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 ClaudeWatch AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/chris-peterson/claudewatch/agents-md.svg)](https://agentmods.dev/instructions/chris-peterson/claudewatch/agents-md)
Your own site
<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="Measured on agentmods" height="20"></a>
Per session 2,800 This file is loaded in full into every session.
When invoked 2,800 The same file — it is already loaded in full.
Security scan E 2 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.02800 $0.02800
Opus 5 $0.01400 $0.01400
Sonnet 5 $0.00560 $0.00560
Haiku 4.5 $0.00280 $0.00280

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

Security

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 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.

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/...`),
AGENTS.md · 209 lines

How it starts

The opening of the file, as written. The whole thing — 209 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)

  1. Determinism. Given the same command, the same cwd and project root, the same watches/ 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. cwd and CLAUDE_PROJECT_DIR enter the decision only as the deterministic per-invocation inputs the is_in_project_tree predicate ([RL-15], [RL-16]) resolves rm targets against — pure string work, no filesystem access. CLAUDE_PROJECT_DIR is the one environment variable on the decision path; CLAUDEWATCH_LOG governs a side channel only. The one predicate that does read the filesystem is is_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=off opts 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 in evaluate_rules.
  2. Exit code is always 0. A non-zero exit blocks the host (Claude Code) from getting a useful decision. All errors are surfaced as deny decisions with explanatory messages.
  3. Single coalesced decision per invocation. Multiple matching rules across multiple rule sets aggregate into one deny (preferred) or one ask. Never emit more than one decision.
  4. The engine ships self-contained. scripts/watchdog.py and 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's gen-plugin-json, run by CI's project job) may use PyYAML; it never runs in the hook.
  5. Allow-by-default. When no rule matches, the engine produces no stdout output. Silence is allow.

Read the full file on GitHub · 209 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 · 209 lines · 2,800 tokens per session scan E 7a52d5abe7d2

Subscribe to this mod's changes

ClaudeWatch AGENTS.md is an instructions file published in the GitHub repository chris-peterson/ClaudeWatch (3 stars, last pushed 2d ago), licensed MIT. It adds 2,800 tokens to every session, about $0.0140 per session on Opus 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.

Related

Other instructions, from other repositories

living-manual CLAUDE.md

Instructions for dougstanford/living-manual, covering living-manual, start of every session, how work lands — non-negotiable, user's manual (living-manual) and releasing.

dougstanford/living-manual · 1,108 tokens

ship-it open-pr.instructions.md

Instructions for khrichtchatyi/ship-it: When the user asks to open, create, or submit a pull request, follow the skill in skills/open-pr/SKILL.md in full: verify gh is authenticated, resolve the target repository and default branch, push the current branch, open one pull request with a title and body derived from the…

khrichtchatyi/ship-it · 84 tokens

agent-skills CLAUDE.md

Instructions for mindbox-cloud/agent-skills, covering agent-skills — developer guide for claude code, repository purpose, repository structure, how to add a new plugin and step 1 — create the directory structure.

mindbox-cloud/agent-skills · 1,143 tokens

my-claude-skills CLAUDE.md

Instructions for brody-0125/my-claude-skills, covering claude code skills repository, validation commands, sub-kopring-engineer: kotlin/java 코드 컨벤션 검증, numerical: 수치 연산 코드 검증 and sub-test-engineer: 문서 일관성 검증.

brody-0125/my-claude-skills · 1,093 tokens

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.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens