5-whys — Claude Code command: what it does, how to install
5-whys runs the five whys technique on the problem you hand it and returns a root cause with one action to take. Useful when a bug keeps coming back after a fix.
MIT ★ 1,988 updated 2026-04-01
/plugin marketplace add glittercowboy/taches-cc-resources
/plugin install taches-cc-resources@taches-cc-resourcesWhat 5-whys does
Pass a problem as the argument and the command walks it down a chain of why questions. Each answer has to go one level deeper than the last, until you reach something you can actually fix. The reply follows a fixed layout: the problem restated, the why steps, the root cause, and an intervention aimed at that root.
Call it with no argument and it works on whatever is being discussed in the session. So if the conversation is still vague, describe the failure first — otherwise the chain digs into the wrong thing. It stops at an actionable cause rather than the first plausible explanation.
The command is a single markdown file holding the process steps, the output template and the criteria for a finished chain.
What it helps with
- trace a recurring bug back to its cause instead of its symptom
- work out why a CI failure never shows up locally
- find the reason an earlier fix did not hold
- pick one action that removes the cause rather than the symptom
- turn a vague complaint into a chain of concrete steps
Example prompts for the agent
/5-whysthe build breaks after a dependency bump — get me to the root./5-whystests pass on my machine but fail in CI.- Run
/5-whyswith no argument and dig into this session: why do we keep rewriting the same module?
How to install 5-whys
1Plugin marketplace
/plugin marketplace add glittercowboy/taches-cc-resources/plugin install taches-cc-resources@taches-cc-resources2Manually: put the files in place
.claude/commands/5-whys.mdCall it with /5-whys. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/5-whys.mdCall it with /prompts:5-whys. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/5-whys.prompt.mdManually: put the files in place
.gemini/commands/5-whys.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about 5-whys
How do I install 5-whys in Claude Code?
Add the marketplace with /plugin marketplace add glittercowboy/taches-cc-resources, then install the plugin: /plugin install taches-cc-resources@taches-cc-resources. The command is then available as /5-whys.
What does 5-whys do?
It asks why about the problem, then why about each answer, until the chain reaches a root cause. You get that root stated plainly plus one action that removes it.
Can I run it without naming a problem?
Yes. With an empty argument it works on the current discussion, so describe the failure in the session first if you have not already.
Source text
5-whys.md · MIT
--- description: Drill to root cause by asking why repeatedly argument-hint: [problem or leave blank for current context] --- <objective> Apply the 5 Whys technique to $ARGUMENTS (or the current discussion if no arguments provided). Keep asking "why" until you hit the root cause, not just symptoms. </objective> <process> 1. State the problem clearly 2. Ask "Why does this happen?" - Answer 1 3. Ask "Why?" about Answer 1 - Answer 2 4. Ask "Why?" about Answer 2 - Answer 3 5. Continue until you hit a root cause (usually 5 iterations, sometimes fewer) 6. Identify actionable intervention at the root </process> <output_format> **Problem:** [clear statement] **Why 1:** [surface cause] **Why 2:** [deeper cause] **Why 3:** [even deeper] **Why 4:** [approaching root] **Why 5:** [root cause] **Root Cause:** [the actual thing to fix] **Intervention:** [specific action at the root level] </output_format> <success_criteria> - Moves past symptoms to actual cause - Each "why" digs genuinely deeper - Stops when hitting actionable root (not infinite regress) - Intervention addresses root, not surface - Prevents same problem from recurring </success_criteria>
© Lex Christopherson · MIT · glittercowboy/taches-cc-resources