Skip to main content
command CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add glittercowboy/taches-cc-resources
/plugin install taches-cc-resources@taches-cc-resources
Open on GitHub

What 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-whys the build breaks after a dependency bump — get me to the root.
  • /5-whys tests pass on my machine but fail in CI.
  • Run /5-whys with 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-resources

2Manually: put the files in place

.claude/commands/5-whys.md

Call it with /5-whys. For all projects use ~/.claude/commands/

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

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set48

The whole set →
debug debug is a Claude Code command that sends an issue description to the debug-like-expert skill for investigation. It applies a methodical debugging process to a specific problem. CX Codex +1 ★ 1,988repo stars audit-slash-command Invokes a subagent to audit slash command files for compliance. Checks YAML syntax, arguments, dynamic context, tool restrictions, and content quality. CX Codex +1 ★ 1,988repo stars audit-subagent audit-subagent — a Claude Code command that runs a configuration audit for subagents: checks XML structure, settings, tool selection, and compliance with standards. Takes a path to the subagent .md file as argument. CX Codex +1 ★ 1,988repo stars audit-skill audit-skill is a Claude Code command that checks a skill against YAML, XML, and progressive disclosure requirements before structural changes or publication. CX Codex +1 ★ 1,988repo stars first-principles first-principles deconstructs problems down to irreducible truths, removes conventions, and designs solutions from the ground up. CX Codex +1 ★ 1,988repo stars one-thing one-thing is a Claude Code command that picks one action with the greatest effect on the rest of a goal. Run it with a goal or let it use the current discussion. CX Codex +1 ★ 1,988repo stars inversion Applies inversion thinking: instead of asking “how do I succeed”, it asks “what guarantees failure” and builds a plan by avoiding those traps. Surfaces risks that optimistic planning misses. CX Codex +1 ★ 1,988repo stars via-negativa via-negativa applies the principle of subtraction to your code, features, or plans, identifying bloat to cut rather than adding new complexity. CX Codex +1 ★ 1,988repo stars

Project sponsors

Companies that keep this analytics open