diagnose

diagnose is a skill for Claude Code from pitimon/8-habit-ai-dev. It costs 172 tokens per session (2,682 once invoked), scanned C, original, MIT.

A six-phase method for investigating bugs and performance slowdowns whose causes are not immediately clear.

In plain words
What is it for?
Use it to investigate unclear bugs, performance regressions, inconsistent test results, input-specific failures, and fixes that did not hold.
Why use it?
It replaces guesswork with a repeatable process: reproduce the problem, gather evidence, test explanations, and prevent the same failure from returning.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the 8-habit-ai-dev plugin — 24 skills, 2 agents, 1 hook shipped together

Good fit Use it to investigate unclear bugs, performance regressions, inconsistent test results, input-specific failures, and fixes that did not hold.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add pitimon/8-habit-ai-dev
Claude Code
/plugin install 8-habit-ai-dev

Made for: Claude Code.

Or install 8-habit-ai-dev, the plugin that ships this one along with the rest of its 24 skills, 2 agents, 1 hook.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/pitimon/8-habit-ai-dev/diagnose.svg)](https://agentmods.dev/skills/pitimon/8-habit-ai-dev/diagnose)
Your own site
<a href="https://agentmods.dev/skills/pitimon/8-habit-ai-dev/diagnose"><img src="https://agentmods.dev/badge/skills/pitimon/8-habit-ai-dev/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 172 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,682 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 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.00172 $0.02682
Opus 5 $0.00086 $0.01341
Sonnet 5 $0.00034 $0.00536
Haiku 4.5 $0.00017 $0.00268

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

Security

Grade C, and why

diagnose scanned grade C 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 8d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- The structured-output handoff block was removed in v2.21.39 (#375): it had no consumer (/post-mortem takes the diagnosis as prose; /cross-verify never globs a diagnose artifact), rendered as verbatim noise in Codex,

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- HTTP probe: `curl -sf https://endpoint | jq .field` returning known-bad output
plugin/skills/diagnose/SKILL.md · 178 lines

How it starts

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

/diagnose — Active Bug Investigation (6 Phases)

Habits: H1 (Be Proactive — prevent recurrence, not just patch the symptom) + H5 (Seek First to Understand — reproduce before fix)

When to Use

  • A bug is reported and the root cause is not obvious
  • A performance regression appeared; you need to localize what changed
  • Tests passed locally but failed in CI, or vice versa
  • A feature works for some inputs and fails for others — you need to find the boundary
  • A previous fix didn't hold; the bug returned in a different form

This skill enforces the discipline build a fast feedback loop before you guess. Documented friction: a lesson in ~/.claude/lessons/2026-04-12-compression-worker-420-investigation.md notes that a 30-minute log-analysis session could have been a 5-minute SQL-comparison session if Phase 1 had been done first.

When to Skip

  • Single-line bug with obvious root cause (typo, wrong constant, off-by-one in plain sight)
  • Lint/format errors with a clear fix
  • Rename refactors and dependency bumps with passing CI
  • Stack trace points to a single line that you can read and immediately understand

For these, fix directly and run tests. Save the 6 phases for hard bugs.

Predecessor /research Brief (Optional Input)

If you ran /research before this — or have a saved brief from a prior session — paste its path now. Standard locations:

  • ~/.claude/plans/*.md (Deep-mode briefs)
  • docs/specs/<slug>/research.md (persisted briefs)

If no prior brief exists, this skill proceeds without it. The skill never auto-globs your filesystem; user agency drives context loading.

If the repo has CONTEXT.md, CONTEXT-MAP.md, DOMAIN.md, docs/agents/domain.md, or relevant ADRs, read them before naming hypotheses. Why: a bug hypothesis phrased in the wrong domain language anchors on the wrong seam and makes the repro look more general than it is.


The 6 Phases

Phase 1 — Build the Feedback Loop

Construct a fast, deterministic pass/fail signal. This is the critical phase — every other phase depends on it. Treat the loop as a product: optimize for speed, signal clarity, and determinism.

Read the full file on GitHub · 178 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 178 lines · 172 tokens per session scan C 43e2c86e3ddd

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository pitimon/8-habit-ai-dev (3 stars, last pushed 1mo ago), licensed MIT. It adds 172 tokens to every session and 2,682 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it C with 2 findings (hidden instructions, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.