analyze-misfires

analyze-misfires is a command for Claude Code from iliaal/whetstone. It costs 18 tokens per session (1,164 once invoked), scanned A, original, MIT.

A command for finding cases where a coding skill was added to tasks that did not need it. It examines examples of these incorrect matches and suggests narrower matching rules and descriptions.

In plain words
What is it for?
Use it to review skill-matching errors, inspect overly broad regular expressions, study irrelevant task examples, and propose specific fixes.
Why use it?
It helps reduce irrelevant instructions being added to tasks, which can distract the agent and lead to unsuitable guidance.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 distillery/scripts/distiller.py harvest-sessions.

Good fit Use it to review skill-matching errors, inspect overly broad regular expressions, study irrelevant task examples, and propose specific fixes.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/iliaal/whetstone
agentmods
npx agentmods add commands/iliaal/whetstone/analyze-misfires

Made for: Claude Code.

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 analyze-misfires

README.md
[![agentmods](https://agentmods.dev/badge/commands/iliaal/whetstone/analyze-misfires/github.svg)](https://agentmods.dev/commands/iliaal/whetstone/analyze-misfires)
Your own site
<a href="https://agentmods.dev/commands/iliaal/whetstone/analyze-misfires"><img src="https://agentmods.dev/badge/commands/iliaal/whetstone/analyze-misfires/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 analyze-misfires

Your own site · 80×15
<a href="https://agentmods.dev/commands/iliaal/whetstone/analyze-misfires"><img src="https://agentmods.dev/badge/commands/iliaal/whetstone/analyze-misfires.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,164 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.00018 $0.01164
Opus 5 $0.00009 $0.00582
Sonnet 5 $0.00004 $0.00233
Haiku 4.5 $0.00002 $0.00116

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

Security

Grade A, and why

analyze-misfires 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 10d 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.

.claude/commands/analyze-misfires.md · 94 lines

How it starts

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

Analyze skill injection misfires

Identify skills whose trigger regex matches too broadly, causing injection into irrelevant tasks. Propose concrete fixes to skill-patterns.sh and skill descriptions.

Arguments

MIN_EXAMPLES=30  (default)
TOP=5            (how many worst misfires to investigate, default: 5)

Parse from: $ARGUMENTS

Pipeline

Step 1: Harvest + analyze

python3 distillery/scripts/distiller.py harvest-sessions
python3 distillery/scripts/distiller.py analyze-misfires --min-examples <MIN_EXAMPLES>

Present the full misfire table. Flag skills with misfire rate > 15%.

Step 2: Investigate top misfires

For each of the top TOP misfiring skills:

  1. Read the current regex from plugins/whetstone/hooks/skill-patterns.sh (grep for SKILL_PATTERNS[<skill-name>])
  2. Read the skill's YAML description from its SKILL.md
  3. Review the irrelevant task samples from the analyze-misfires output
  4. Identify what the regex is matching that it shouldn't (e.g., "database" matching audit tasks that mention databases)

Step 3: Propose fixes

For each misfiring skill, propose:

  1. Tightened regex -- remove overly broad terms, add word boundaries, require more specific combinations
  2. Description update -- add explicit "not for X" exclusions if the description is attracting wrong matches
  3. Tier adjustment -- if the skill is Tier 1 but shouldn't fire as eagerly, suggest moving to Tier 2

Present each proposed change for review before applying. Format:

=== ia-postgresql (51% misfire) ===
Current regex: SKILL_PATTERNS[ia-postgresql]='postgres|jsonb|rls|cte[s]?|window\.?function'
Problem: "postgres" matches any mention of PostgreSQL in task context, including Laravel tasks that reference a postgres database
Proposed regex: SKILL_PATTERNS[ia-postgresql]='postgres.*(?:query|schema|index|optim)|jsonb|rls|\bcte[s]?\b|window\.?function|explain\s+analyze'
Description change: Add "Not for tasks that merely use PostgreSQL as a backend"

Read the full file on GitHub · 94 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. 10d ago First seen · 94 lines · 18 tokens per session scan A f7d45e246211

Subscribe to this mod's changes

analyze-misfires is a command published in the GitHub repository iliaal/whetstone (33 stars, last pushed 2d ago), licensed MIT. It adds 18 tokens to every session and 1,164 once invoked, about $0.0001 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-30.