diagnose

diagnose is a skill for Claude Code from tranhieutt/software_development_department. It costs 58 tokens per session (3,560 once invoked), scanned A, original, MIT.

A structured investigation process for complex or intermittent software bugs whose cause is unclear.

In plain words
What is it for?
Use it for flaky tests, race conditions, unfamiliar failures, repeatedly reverted fixes, or bugs that need deeper investigation rather than a small obvious patch.
Why use it?
It separates finding a possible cause, challenging that explanation, and weighing solutions before handing the fix to a programmer.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it for flaky tests, race conditions, unfamiliar failures, repeatedly reverted fixes, or bugs that need deeper investigation rather than a small obvious patch.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tranhieutt/software_development_department/diagnose
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.

Any agent
npx skills add tranhieutt/software_development_department --skill diagnose
Clone the repo
git clone --depth 1 https://github.com/tranhieutt/software_development_department

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tranhieutt/software_development_department/diagnose.svg)](https://agentmods.dev/skills/tranhieutt/software_development_department/diagnose)
Your own site
<a href="https://agentmods.dev/skills/tranhieutt/software_development_department/diagnose"><img src="https://agentmods.dev/badge/skills/tranhieutt/software_development_department/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,560 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.00058 $0.03560
Opus 5 $0.00029 $0.01780
Sonnet 5 $0.00012 $0.00712
Haiku 4.5 $0.00006 $0.00356

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

Security

Grade A, and why

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

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/skills/diagnose/SKILL.md · 329 lines

How it starts

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

Skill: /diagnose — Complex Bug Diagnostic Pipeline

When to invoke (and when NOT to)

Use /diagnose when:

  • Bug reproduces but root cause is unclear after one read-pass of the failing code
  • Previous fix attempts have been reverted ≥ 2 times (symptoms return)
  • Failure is intermittent (flaky test, race condition, timing-dependent)
  • Failure occurs in unfamiliar code (agent has no prior context)
  • User has explicitly requested /diagnose or "deep investigation"
  • Circuit Breaker (Rule 14) tripped on the specialist agent that normally handles this domain

Do NOT use /diagnose when:

  • Cause is obvious (null ref, typo, missing import, incorrect import path)
  • Fix is < 10 LOC and has a clear success check
  • Bug is in code you just wrote this session (read-pass + local reasoning is faster)
  • User wants a quick patch and has accepted the tradeoff

Pipeline overview

Feedback Loop -> Investigation -> Verification -> Solution -> Lead Programmer
  (signal)         (hypothesis)    (devil's adv.)   (tradeoffs)   (assign + exec)

  repro/check command      investigation.json      verification.json      solution.json          implementation
  (fast deterministic      (root_cause,           (status: confirmed |    (3 options:           (delegates to
   pass/fail signal)       evidence[],            refuted | inconclusive, Quick/Strategic/     backend-developer,
                           confidence)            reproduction_steps)    Future-Proof)         qa-engineer, etc.)

Each stage produces a required artifact saved to .investigations/<task_id>/ and a handoff contract (per Rule 16) to the next agent.

Stage 0 — Feedback Loop

Goal: Build the fastest reliable pass/fail signal for the exact symptom before explaining the cause.

The feedback loop is the highest-leverage part of diagnosis. Do not proceed to root-cause analysis until there is a loop that can reproduce the user's symptom or a documented reason why no loop is possible.

Read the full file on GitHub · 329 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. 8d ago First seen · 329 lines · 58 tokens per session scan A 84d980cbe76d

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository tranhieutt/software_development_department (72 stars, last pushed 3mo ago), licensed MIT. It adds 58 tokens to every session and 3,560 once invoked, about $0.0003 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.

Related

Other skills, from other repositories