diagnose

A bug-diagnosis workflow that examines error logs or reproduction steps, fixes the problem, and creates a GitHub issue and pull request.

In plain words
What is it for?
Use it to investigate reproducible failures, verify the fix at checkpoints, record the issue, and prepare a GitHub pull request.
Why use it?
It turns an observed bug into a tracked, reviewable change instead of leaving diagnosis, documentation, and code updates as separate manual tasks.

Skill for Claude CodeCodex

Part of the claude-dev-kit plugin — 23 skills, 33 agents, 9 hooks shipped together

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 skills/pillip/claude-dev-kit/diagnose
Any agent
npx skills add pillip/claude-dev-kit --skill diagnose
Clone the repo
git clone --depth 1 https://github.com/pillip/claude-dev-kit

Made for: Claude Code, Codex.

Or install claude-dev-kit, the plugin that ships this one along with the rest of its 23 skills, 33 agents, 9 hooks.

Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,272 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.00024 $0.02272
Opus 5 $0.00012 $0.01136
Sonnet 5 $0.00005 $0.00454
Haiku 4.5 $0.00002 $0.00227

Measured 3d ago against content hash ae7ef872fc9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

skills/diagnose/SKILL.md · 164 lines

How it starts

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

Kit Preamble — diagnose

Kit Script Root

Kit root: ${CLAUDE_PLUGIN_ROOT}

  • Absolute path above → plugin install (substituted at load time; no project scripts/ dir): prefix every kit script command with it, e.g. bash <kit-root>/scripts/checkpoint.sh …. Absolute paths also work from worktrees.
  • Literal ${…} placeholder above → standalone layout: run commands as written.

Project Context Detection

Run these checks silently at the start. Use results to adapt behavior:

  • [ -f issues.md ] — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.
  • [ -f docs/sprint_state.md ] — if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.
  • [ -f docs/prd_digest.md ] — if true, read it for quick project context before starting.

Kit Rules

  • Verify gh auth status before any GitHub operation.

Checkpoint Verification Pattern

Every phase has a checkpoint. Run the verification command and check the exit code.

  • Exit non-zero (blocking gate): STOP immediately, report failure, do NOT proceed.
  • Exit 0 with an ADVISORY: line (advisory gate): report the gap, self-correct, continue. Standard prefix:
bash scripts/checkpoint.sh

Append --skill <name> --phase <phase> --issue <ID> for the specific check. checkpoint.sh resolves the main repo root internally, so the command stays a single prefix-matchable form (safe to allowlist as Bash(bash scripts/checkpoint.sh *)).

Worktree Setup Pattern

Pipeline skills operate in git worktrees to isolate changes from main.

  • Create + freeze: WT="$(bash scripts/wt_setup.sh <branch>)" — creates the worktree via scripts/worktree.sh create and writes .claude-kit/freeze-dir.txt inside it in a single step.
  • Resolve main root: bash scripts/worktree.sh root
  • Remove safely: bash scripts/wt_cleanup.sh <branch> — cd's to main root inside a subshell, then removes the worktree (never leaves CWD dangling). All file operations happen inside $WT/. Shared files live on main only.

Read the full file on GitHub · 164 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. 3d ago First seen · 164 lines · 24 tokens per session scan A ae7ef872fc9b

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository pillip/claude-dev-kit (11 stars, last pushed 17d ago), licensed MIT. It adds 24 tokens to every session and 2,272 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.