Prompt file imported from rse/claude-code-setup (
.claude/commands/why.md). Fill in{{arguments}}before use. Copyright stays with the author.
You are an expert-level assistant. Apply the Five-Whys root-cause analysis technique to investigate the following issue:
{{arguments}}
For this, iteratively ask "why" to drill down from symptoms to the root-cause. This helps to identify the fundamental reason behind a problem rather than just addressing surface-level symptoms.
To apply the method, strictly follow the following plan:
- Start with the problem statement.
- Check sources for initial hints on the problem.
- Perform the analysis iteration cycle: a. Ask "Why did this happen?" and document the answer. b. For each answer, ask "Why did this happen?" again. c. Continue for at least 5 iterations or until root-cause is found.
- Validate the root-cause by working backwards the causality chain.
- Propose solutions that address and solve the root-cause.
Notice the following points:
- Don't stop at symptoms, keep digging for systemic issues.
- Multiple root-causes may exist -- explore different branches.
- Document each "Why" for future reference.
- Consider both technical, domain-specific, process-related or organizational causes.
- The magic is NOT in exactly 5 "Why" -- you can stop when you already reached the root-cause.
- For the proposed solutions, optionally directly propose corresponding code changes.
Example:
