diagnose-negatives

diagnose-negatives is a command for Claude Code from iliaal/whetstone. It costs 22 tokens per session (1,772 once invoked), scanned A, original, MIT.

A command for studying failed skill sessions, finding recurring problems, and applying targeted fixes to a skill.

In plain words
What is it for?
Use it with a skill name to diagnose failure patterns, review examples, generate a diagnosis, and validate the proposed changes.
Why use it?
It replaces guesswork with evidence from real sessions that produced negative results.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents; positional $N argument.

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 with a skill name to diagnose failure patterns, review examples, generate a diagnosis, and validate the proposed changes.

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/diagnose-negatives

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 diagnose-negatives

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/iliaal/whetstone/diagnose-negatives"><img src="https://agentmods.dev/badge/commands/iliaal/whetstone/diagnose-negatives.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 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,772 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.00022 $0.01772
Opus 5 $0.00011 $0.00886
Sonnet 5 $0.00004 $0.00354
Haiku 4.5 $0.00002 $0.00177

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

Security

Grade A, and why

diagnose-negatives 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/diagnose-negatives.md · 112 lines

How it starts

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

Diagnose and fix skill failures

Read real negative-signal sessions for a skill, identify recurring failure patterns, and propose targeted skill text edits. This is the practical alternative to automated evolution -- it reads what actually went wrong and fixes the specific gaps.

Arguments

SKILL_NAME=$1  (required)

Parse from: $ARGUMENTS

If no skill name provided, run analyze-misfires first to show which skills have the most issues, then ask which one to diagnose.

Pipeline

Step 1: Run diagnosis

python3 distillery/scripts/distiller.py harvest-sessions

Run the diagnosis judge as an in-session sub-agent (no billed claude -p):

  1. python3 distillery/scripts/distiller.py diagnose-negatives <skill> --max-examples 10 --emit-prompt{count, prompt, meta}. If count is 0, stop — no negatives to diagnose.
  2. Spawn ONE sub-agent (Agent tool, general-purpose) whose entire instruction is the prompt; it returns the JSON diagnosis. Write that response to a temp file.
  3. python3 distillery/scripts/distiller.py diagnose-negatives <skill> --max-examples 10 --format-result --response @<file> → validates against the rubric and prints the report.

The judge classifies each finding under exactly one of seven smallest-failing-decision categories:

Category Failure mode Default edit target
wrong_trigger Skill fired when not relevant, or didn't fire when it should hooks/skill-patterns.sh regex; SKILL.md description
missing_source Skill ran but didn't load a reference it needed Add or expand references/; update SKILL.md routing table
skipped_reference Reference exists, agent had access, didn't read it Tighten SKILL.md routing; promote content into SKILL.md
weak_output Output format loose or missing structure Add output template / table format to SKILL.md
missing_validation Skill claimed completion without running a check Add gate to SKILL.md; add validator check if catchable
unsafe_path Destructive action without confirmation Add confirmation requirement; ban destructive verbs
other None of the above; only valid with deferred_reason Manual decision

Read the full file on GitHub · 112 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 · 112 lines · 22 tokens per session scan A 89bee2cfee29

Subscribe to this mod's changes

diagnose-negatives is a command published in the GitHub repository iliaal/whetstone (33 stars, last pushed 2d ago), licensed MIT. It adds 22 tokens to every session and 1,772 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.