root-cause-analysis-first

A troubleshooting method that identifies the mechanism causing a failure before changing code or configuration. It asks you to explain why the symptom occurs and test that explanation.

In plain words
What is it for?
Use it when a service crashes, hangs, restarts, returns incorrect results, or has a flaky test.
Why use it?
It reduces guesswork and helps prevent changes that only hide a problem without fixing its 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/everywan-dev/claude-code-engineering/root-cause-analysis-first
Any agent
npx skills add everywan-dev/claude-code-engineering --skill root-cause-analysis-first
Clone the repo
git clone --depth 1 https://github.com/everywan-dev/claude-code-engineering

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,414 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.00048 $0.01414
Opus 5 $0.00024 $0.00707
Sonnet 5 $0.00010 $0.00283
Haiku 4.5 $0.00005 $0.00141

Measured yesterday against content hash 87965471ae18, 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-analysis-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 yesterday.

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-analysis-first/SKILL.md · 132 lines

How it starts

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

Root cause analysis first

Before you touch anything, finish this sentence with a mechanism:

This happens because ______.

If the honest ending is "I don't know, but this makes it go away", you do not have a fix. You have a change that coincides with the symptom disappearing, which is a different and much worse thing: the failure is still there, now without its warning light.

When to use this

  • A service crashes, restarts, hangs, or returns the wrong thing
  • A test is flaky
  • Someone says "just bump the timeout / add a retry / restart it nightly"
  • You are on your second attempted fix for the same symptom

The failure this prevents

A reverse proxy was restarting every 45 seconds. Three explanations were put forward, each plausible, each acted on:

  1. Memory — it must be getting killed for using too much.
  2. A startup timer — something must be tearing it down before it settles.
  3. The restart policy — the policy must be misconfigured.

All three were wrong. Not unlucky: wrong in the same way. Every one of them started from a suspect and went looking for evidence that fit. Evidence that fits is always available.

The cause showed up only when someone stopped proposing and started collecting: follow the process tree upward from the thing being killed, and keep following it. It ended at a container that was talking to the runtime socket and stopping the proxy on a loop. Nothing to do with memory, timers, or policy — and nothing that any of those three lines of investigation could ever have found, however long they ran.

The lesson is not "look at process trees". It is that a hypothesis you are trying to confirm cannot be disproved by you. You have to go at it the other way round.

The procedure

1. Collect facts before you allow yourself a theory. Timestamps, exit codes, signal numbers, the last 200 log lines before the event and not after, what changed in the last 24 hours, who else has access.

Read the full file on GitHub · 132 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. yesterday First seen · 132 lines · 48 tokens per session scan A 87965471ae18

Subscribe to this mod's changes

root-cause-analysis-first is a skill published in the GitHub repository everywan-dev/claude-code-engineering (2 stars, last pushed 13d ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,414 once invoked, about $0.0002 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-31.