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.
npx skills add stuartshields/claude-setup --skill debug-rulesgit clone --depth 1 https://github.com/stuartshields/claude-setupWrote 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/skills/stuartshields/claude-setup/debug-rules)<a href="https://agentmods.dev/skills/stuartshields/claude-setup/debug-rules"><img src="https://agentmods.dev/badge/skills/stuartshields/claude-setup/debug-rules/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/skills/stuartshields/claude-setup/debug-rules"><img src="https://agentmods.dev/badge/skills/stuartshields/claude-setup/debug-rules.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.00028 | $0.00968 |
| Opus 5.5 | $0.00011 | $0.00387 |
| Sonnet 5.5 | $0.00006 | $0.00194 |
| Haiku 4.5 | $0.00003 | $0.00097 |
Grade A, and why
debug-rules scanned grade A with 1 finding 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 3mo 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.
Reads agent configuration directorieslowAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
The hook script `~/.claude/hooks/log-instructions.sh` should already exist. To enable logging, add this to `~/.claude/settings.json` under `"hooks"`: Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: debug-rules
When to Use
Use this skill when:
- Conditional rules don't seem to be loading
- Claude is ignoring instructions that should be in a rule file
- You changed rule frontmatter and want to verify it works
- You want to see what rules loaded in a specific session
Prerequisites
This skill requires the InstructionsLoaded audit hook. The hook is not registered by default - it's an on-demand diagnostic tool you enable when needed.
Setup (one-time)
The hook script ~/.claude/hooks/log-instructions.sh should already exist. To enable logging, add this to ~/.claude/settings.json under "hooks":
"InstructionsLoaded": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/log-instructions.sh"
}
]
}
]
Then start a new session, do some work that touches files matching your conditional rules, and run /debug-rules again.
Remove the hook from settings.json when done - it's lightweight but unnecessary for normal use.
Step 1: Verify hook is active
- Check
~/.claude/hooks/log-instructions.shexists and is executable - Check
~/.claude/settings.jsonhas anInstructionsLoadedentry pointing to it - Check
~/.claude/instruction-audit.logexists and is non-empty
If the hook script is missing, tell the user and stop. If the hook script exists but isn't registered in settings.json, show them the setup instructions above. If the log doesn't exist or is empty, tell the user: "No audit log found. Register the hook, start a new session, do some work, then run /debug-rules again."
Step 2: Read the audit log
Read ~/.claude/instruction-audit.log. If the user provided a timestamp, filter to entries from that session. If they said "latest" or gave no argument, use the most recent session (group by timestamp - entries within 2 seconds of each other are the same session start).
Step 3: Inventory expected rules
Read all files in ~/.claude/rules/. For each file:
- If it has no
paths:frontmatter → it should appear withreason: session_start - If it has
paths:frontmatter → it should appear withreason: path_glob_matchonly when matching files are read
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.
- 3mo ago First seen · 97 lines · 28 tokens per session scan A 5acb227a9d6d
debug-rules is a skill published in the GitHub repository stuartshields/claude-setup (2 stars, last pushed 6mo ago), licensed MIT. It adds 28 tokens to every session and 968 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
debug-rules compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| debug-rulesstuartshields/claude-setup | Skill | 2 | 6mo ago | MIT | A | 28 | Claude Code |
| debug-logsWeaverse/.agents | Skill | 1 | 20d ago | MIT | A | 42 | Claude Code |
| production-debuggingWeaverse/.agents | Skill | 1 | 20d ago | MIT | A | 52 | Claude Code |
| reliability-reviewWeaverse/.agents | Skill | 1 | 20d ago | MIT | A | 59 | Claude Code |
| anomaly-alerthoangsonww/Claude-Code-Agent-Monitor | Skill | 1.2k | yesterday | MIT | A | 86 | Claude Code, Codex |
| transcript-grephoangsonww/Claude-Code-Agent-Monitor | Skill | 1.2k | yesterday | MIT | A | 73 | Claude Code, Codex |
| regression-watchhoangsonww/Claude-Code-Agent-Monitor | Skill | 1.2k | yesterday | MIT | A | 82 | Claude Code, Codex |