diagnose-hard-bug

diagnose-hard-bug is a skill for Claude Code from martineserios/thebrana. It costs 17 tokens per session (612 once invoked), scanned A, original, MIT.

A structured workflow for investigating difficult bugs by building a tight feedback loop and ranking possible causes. It adapts an upstream bug-diagnosis method to this project's tasks and memory.

In plain words
What is it for?
Use it for bugs that are difficult to reproduce or explain, especially when tests or another repeatable feedback loop can be created.
Why use it?
Hard bugs can produce many plausible explanations and waste time. A ranked, evidence-based investigation keeps the diagnosis focused.

Skill for Claude Code

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

Part of the brana plugin — 56 skills, 4 commands, 14 agents, 13 hooks shipped together

Good fit Use it for bugs that are difficult to reproduce or explain, especially when tests or another repeatable feedback loop can be created.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/martineserios/thebrana/diagnose-hard-bug
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 martineserios/thebrana --skill diagnose-hard-bug
Clone the repo
git clone --depth 1 https://github.com/martineserios/thebrana

Made for: Claude Code.

Or install brana, the plugin that ships this one along with the rest of its 56 skills, 4 commands, 14 agents, 13 hooks.

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-hard-bug

README.md
[![agentmods](https://agentmods.dev/badge/skills/martineserios/thebrana/diagnose-hard-bug/github.svg)](https://agentmods.dev/skills/martineserios/thebrana/diagnose-hard-bug)
Your own site
<a href="https://agentmods.dev/skills/martineserios/thebrana/diagnose-hard-bug"><img src="https://agentmods.dev/badge/skills/martineserios/thebrana/diagnose-hard-bug/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-hard-bug

Your own site · 80×15
<a href="https://agentmods.dev/skills/martineserios/thebrana/diagnose-hard-bug"><img src="https://agentmods.dev/badge/skills/martineserios/thebrana/diagnose-hard-bug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 612 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.00017 $0.00612
Opus 5 $0.00009 $0.00306
Sonnet 5 $0.00003 $0.00122
Haiku 4.5 $0.00002 $0.00061

Measured 7d ago against content hash 46866fadc726, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

diagnose-hard-bug 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 7d 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.

system/skills/diagnose-hard-bug/SKILL.md · 24 lines

What it actually says

Diagnose Hard Bug (adapter)

ADR-084 vendor+wrap pilot (t-2834). Thin adapter, not a copy — the actual discipline lives in the vendored organ, read fresh every invocation (no state to lose across compaction — steps 1-2 below are the whole procedure):

  1. Read the vendored skill: Skill(skill: "diagnosing-bugs").claude/skills/diagnosing-bugs/SKILL.md, verbatim upstream, pinned v1.2.3, tracked in skills-lock.json. Follow its six phases as written.
  2. While following it, remap:
    • "Issue tracker" / "issue" / "ticket" → this project's tasks.json / t-NNN task. Never prompt for /setup-matt-pocock-skills — not installed, not needed.
    • CONTEXT.md (upstream expects a repo-root glossary file that doesn't exist here) → use this project's own memory instead: the 2-3 most relevant docs/architecture/*.md files + the task's own context, inline, rather than looking for a file.
    • Cross-skill references → redirect-check.md, the committed list; re-verify it against the vendored SKILL.md on every upstream bump (ADR-084 §1 pump).
  3. Early exit (inherited from the vendored skill's own Phase 1): if no tight, red-capable feedback loop can be built, stop and say so explicitly rather than hypothesising — this is a valid, complete exit, not a failure to route around.
  4. Record on completion or early exit: append one line to ~/.claude/run-state/pocock-diagnosing-bugs.jsonl via a single shell redirect — printf '%s\n' '{"task_id":...}' >> ~/.claude/run-state/pocock-diagnosing-bugs.jsonl — never read-then-rewrite-the-file; this is a cross-session shared log and a single >> of one line (well under PIPE_BUF) is the only append form safe against two concurrent /brana:fix sessions racing on it. Fields: {"task_id", "phase_reached", "tight_loop_command", "hypotheses_ranked", "outcome", "date"} — the invocation evidence ADR-084 §7's kill/expand evaluation reads.
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. 7d ago First seen · 24 lines · 17 tokens per session scan A 46866fadc726

Subscribe to this mod's changes

diagnose-hard-bug is a skill published in the GitHub repository martineserios/thebrana (3 stars, last pushed today), licensed MIT. It adds 17 tokens to every session and 612 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-09-03.

Related

Other skills, from other repositories

bug-fix-workflow

Structured bug diagnosis and repair workflow using the 5-Whys root cause analysis method. Ensures fixes include tests, documentation, and knowledge capture.

pan94u/forge · 36 tokens

ask-codex

Consult OpenAI Codex for investigation, debugging, or code review. Use when user explicitly asks to "ask codex", "check with codex", "codex review", or as a last resort when stuck after 4+ failed attempts at debugging, investigation, or bug fix and completely out of ideas. Codex is slow (2-5 min), so only escalate…

umputun/cc-thingz · 103 tokens

root-cause-investigator

Systematic root cause analysis for errors, bugs, and unexpected behaviors using 5-Why methodology. Use when user reports errors, build failures, test failures, performance issues, integration problems, or any "it's not working" scenarios.

umputun/cc-thingz · 53 tokens

create-issue

Transitional alias — prefer /prflow:specs, which runs the same issue-drafting pipeline. Use when a rough user story, bug report, feature idea, piece of feedback, or an implementation plan should be recorded as a GitHub issue rather than built right now. This command name is retained so existing /prflow:create-issue…

The01Geek/prflow · 89 tokens

retrospective-audit

Stage B of /prflow:retrospective-weekly: given a most-recent-first subset of one recurring pattern's occurrence-PR context bundles (bounded by auditbundlecap), re-derive the root cause and return one JSON object carrying a ranked findings array (one to three sub-patterns) — no edits, no worktree. Invoked as a subagent…

The01Geek/prflow · 91 tokens

debug

Use when something is broken — a failing or flaky test, crash, wrong result or regression — and the root cause must be reproduced and proven before any fix. On-demand; callable mid-implement. NOT a feature to spec or build (that is specify/implement), NOT the lint/test gate (that is verify), NOT adversarial diff…

ericrisco/rsc-harness · 85 tokens