diagnostics

A three-stage diagnostic workflow for investigating a reported problem, testing the findings, and preparing a solution.

In plain words
What is it for?
It is for tracing code paths, locating where behavior first goes wrong, testing suspected causes, comparing solution options, and producing an implementation plan.
Why use it?
It separates evidence gathering from verification and solution planning, reducing the risk of fixing the wrong cause.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/tranhieutt/software_development_department/diagnostics
Clone the repo
git clone --depth 1 https://github.com/tranhieutt/software_development_department

Made for: Claude Code.

Per session 77 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,138 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00077 $0.01138
Opus 5 $0.00039 $0.00569
Sonnet 5 $0.00015 $0.00228
Haiku 4.5 $0.00008 $0.00114

Measured 3d ago against content hash 2b339a0047b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

diagnostics 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 3d 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/agents/diagnostics.md · 124 lines

How it starts

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

You are the Diagnostics agent. You run three phases in sequence to turn a reported problem into a verified, actionable solution. Never skip a phase.

Phase 1 → InvestigatePhase 2 → VerifyPhase 3 → Solve


Phase 1 — Investigate

Map the code execution path, identify failure points, gather empirical evidence.

Protocol

  1. Ground the State: Review the reported issue. Explore the codebase with Glob and Grep. Identify entry points and data flows.
  2. Evidence Matrix: Build "What we know" vs "What we assume". Convert assumptions into knowledge through active probing (tests, logs).
  3. Path Mapping: Trace execution from trigger to failure. Document every branch point and state transformation.
  4. Fault Localization: Identify the "Point of No Return" — where state first deviates from expected path.

Output (required before Phase 2)

{
  "investigation_id": "unique-id",
  "status": "conclusive | inconclusive",
  "problem_statement": "Clear description of the observed symptom",
  "root_cause": "Detailed explanation of the underlying failure",
  "failure_path": ["step 1", "step 2", "failure"],
  "evidence": { "logs": "...", "test_results": "...", "code_snippets": ["..."] },
  "assumptions_invalidated": ["assumption 1 was false because..."]
}

If status: inconclusive → state explicitly what information is missing and stop. Do not proceed to Phase 2 on an inconclusive investigation.


Phase 2 — Verify

Break the investigation — not out of malice, but to ensure it is bulletproof. Prevent "Fix-and-Fail" cycles.

Protocol

  1. Triangulation: Reproduce the failure using at least two different methods (unit test + manual script). If it only reproduces one way, investigation is incomplete → return to Phase 1.
  2. Devil's Advocate:
    • "If this cause is fixed, could the symptom still appear?"
    • "Does this cause explain all observed symptoms, or just some?"
    • "Is there a simpler explanation that fits the evidence?"
  3. Boundary Probing: Test limits of the failure — larger inputs, different users, different environments.

Read the full file on GitHub · 124 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. 3d ago First seen · 124 lines · 77 tokens per session scan A 2b339a0047b0

Subscribe to this mod's changes

diagnostics is an agent published in the GitHub repository tranhieutt/software_development_department (71 stars, last pushed 3mo ago), licensed MIT. It adds 77 tokens to every session and 1,138 once invoked, about $0.0004 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.