root-cause-first

root-cause-first is a skill for Claude Code, Codex from benjaminard/fable-skills. It costs 57 tokens per session (639 once invoked), scanned A, original, MIT.

A debugging guide that requires finding and explaining the actual cause of an error before changing code. It emphasizes reproducing the problem, tracing the failing path, and checking real system state.

In plain words
What is it for?
Use it for bugs, crashes, failing tests, regressions, flaky behavior, and unexpected output before applying a fix.
Why use it?
It reduces guesswork and avoids patches that hide symptoms while leaving the underlying problem. This is especially useful when earlier fixes did not work or failures look familiar but may have another cause.

Skill for Claude CodeCodex

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/benjaminard/fable-skills/root-cause-first
Any agent
npx skills add benjaminard/fable-skills --skill root-cause-first
Clone the repo
git clone --depth 1 https://github.com/benjaminard/fable-skills

Made for: Claude Code, Codex.

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 root-cause-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/benjaminard/fable-skills/root-cause-first.svg)](https://agentmods.dev/skills/benjaminard/fable-skills/root-cause-first)
Your own site
<a href="https://agentmods.dev/skills/benjaminard/fable-skills/root-cause-first"><img src="https://agentmods.dev/badge/skills/benjaminard/fable-skills/root-cause-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 639 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.00057 $0.00639
Opus 5 $0.00028 $0.00319
Sonnet 5 $0.00011 $0.00128
Haiku 4.5 $0.00006 $0.00064

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

Security

Grade A, and why

root-cause-first 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 5d 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/root-cause-first/SKILL.md · 40 lines

How it starts

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

Root Cause First

Fix causes, not symptoms. A fix applied to an undiagnosed problem is a guess, and guesses compound: each one changes the system, making the real cause harder to see.

Before you fix anything

  1. Reproduce it. Run the failing thing and watch it fail. If you cannot reproduce the failure, you cannot know your fix works, and you say so instead of claiming a fix.
  2. Trace it. Follow the failure from the symptom back to the cause: read the actual error, read the code path that produced it, inspect the actual state (logs, variables, files, network) rather than assuming it. Stop tracing only when you can explain the mechanism: "X happens because Y does Z."
  3. Beware pattern-matching. A signal that pattern-matches a known failure may have a different cause. "This looks like the usual CORS issue" is a hypothesis, not a diagnosis. Verify the mechanism before acting on the resemblance, especially before any state-changing action like a restart, delete, or config edit.
  4. Then fix the cause. If the honest fix is upstream (a data problem, a wrong assumption in a caller, a stale dependency), fix it there. Do not patch the symptom downstream and call it done. If a downstream patch is genuinely the right short-term call, label it a bridge and state the debt it creates.

The failed-approach ledger

When a fix attempt fails, write down (in a scratch file or your working notes) before doing anything else:

  • What you tried
  • What you expected
  • What actually happened
  • What this rules out

Then, and only then, form the next hypothesis. The ledger exists to enforce one rule: never retry a failed approach verbatim. If you find yourself making the same edit a second time, or re-running the same command hoping for a different result, stop. That is the signal you are guessing.

The two-failure rule

After two failed fix attempts, stop fixing and restart diagnosis from scratch:

  1. Re-read the original error with fresh eyes. The answer is often in a line you skimmed.
  2. Question your framing: is the bug even where you think it is? Check one layer up and one layer down.
  3. Shrink the reproduction: find the smallest input or code path that still fails.
  4. If available, hand the evidence (not your theory) to a fresh-context subagent and ask it to diagnose independently. Your accumulated assumptions are now part of the problem.

Read the full file on GitHub · 40 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. 5d ago First seen · 40 lines · 57 tokens per session scan A 0aa91e9853fa

Subscribe to this mod's changes

root-cause-first is a skill published in the GitHub repository benjaminard/fable-skills (30 stars, last pushed 2mo ago), licensed MIT. It adds 57 tokens to every session and 639 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

metrics-instrumentation

Specification for instrumenting an opik-backend workflow with operational OpenTelemetry metrics — per-stage throughput/latency/error counters and native histograms, dimensioned per-customer (workspace). Use when a pipeline (scoring, ingestion, experiments, jobs) needs per-stage visibility. Covers metric emission only…

comet-ml/opik · 93 tokens

flux-analyzer

Analyse FBA flux distributions to extract biological insights. Covers gene essentiality, phenotypic phase planes, flux sampling, pathway-level aggregation, secretion product prediction, and production of publication- quality figures.

aiming-lab/AutoResearchClaw · 44 tokens

a-evolve

Apply A-Evolve's agentic evolution methodology to improve AI agent performance across runs. Use when the user wants to diagnose agent failures, generate targeted skills from error patterns, evolve system prompts, or accumulate episodic knowledge. Works standalone or inside AutoResearchClaw pipelines. Triggers on…

aiming-lab/AutoResearchClaw · 100 tokens

statistical-method-design

Design statistical methods, baselines, diagnostics, variants, and ablations that directly address a formal problem formulation.

aiming-lab/AutoResearchClaw · 27 tokens

happiness-skill

当用户问「怎么才能更幸福/为什么得到了还不满足/怎么减少焦虑」时调用。 核心理念: 幸福是缺憾感清空的默认状态, 是可训练的技能; 欲望是与自己的契约(得到前不快乐), 同时只留一个重大欲望; 活在当下。 不适用于: 临床抑郁等需要专业治疗的场景(本书方法不能替代医疗)。 Triggers: 幸福/不快乐/欲望/焦虑/知足/活在当下/happiness/desire/anxiety.

kangarooking/cangjie-skill · 136 tokens

experimental-design

Best practices for designing reproducible ML experiments. Use when planning ablations, baselines, or controlled experiments.

aiming-lab/AutoResearchClaw · 25 tokens