skills/thinking-occams-razor/SKILL.md
Use when multiple causes could explain a bug — test the fewest-assumption hypothesis first; escalate to complex only when evidence forces it. Skip the full procedure when one step resolves it.
npx skillsauth add tjboudreaux/cc-thinking-skills thinking-occams-razorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Occam's Razor states: among competing hypotheses that fit the evidence equally well, prefer the one with the fewest assumptions. This skill operationalizes that principle for debugging: test the simplest hypothesis first, and escalate to complex explanations only when evidence forces it.
The skill has a trigger-shrink gate: if the simplest hypothesis can be tested in one step, just test it — don't run the full enumeration-and-scoring procedure. Reserve the full procedure for situations where multiple hypotheses genuinely compete and the simplest is not obviously testable.
Core Principle: "Everything should be made as simple as possible, but no simpler." — Einstein
Decision flow:
Multiple explanations exist?
→ No → Use the available explanation
→ Yes → Can the simplest be tested in one step?
→ Yes → JUST TEST IT (trigger-shrink — skip full procedure)
→ No → Do they explain the evidence equally well?
→ No → Prefer the better explanation
→ Yes → RUN FULL OCCAM'S RAZOR PROCEDURE
Before running the full enumeration-and-scoring procedure, ask one question: "Can I test the simplest hypothesis in one step?"
If evidence already points to a specific cause, follow the evidence — don't downgrade to a "simpler" hypothesis it contradicts. For irreducibly complex domains (distributed consensus, concurrency), the simplest model is wrong.
Before running the full procedure, ask: "Can I test the simplest hypothesis in one step?"
List all plausible explanations for the observed behavior:
Bug: Users intermittently can't log in
Hypotheses:
A. Session token expiration edge case
B. Race condition in auth service
C. Database connection pool exhaustion
D. Complex interaction between CDN cache, load balancer, and session service
| Hypothesis | Assumptions | |------------|-------------| | A. Token expiration | 1. Token validation has an edge case | | B. Race condition | 1. Concurrent requests possible, 2. Shared mutable state exists | | C. DB pool exhaustion | 1. Pool is undersized, 2. Connections are leaking | | D. Complex interaction | 1. CDN caches auth, 2. LB sticky sessions fail, 3. Session sync delayed |
Count each independent assumption: +1 per assumption, +1 per component involved, +2 per external dependency, +2 for timing-dependent behavior, +3 for rare conditions, +5 for "perfect storm" scenarios.
Ensure simpler hypotheses actually explain the evidence:
Evidence: Failures correlate with high traffic periods
Hypothesis A (token edge case): Doesn't explain traffic correlation ✗
Hypothesis C (DB pool exhaustion): Explains traffic correlation ✓ — fewer assumptions than D
→ PREFERRED by Occam's Razor
Investigate hypotheses from fewest to most assumptions. Do not skip to complex hypotheses until simple ones are ruled out.
When simple explanations are ruled out with evidence, move to more complex ones. Never escalate on intuition alone.
A completed Occam's Razor analysis produces:
For trigger-shrink cases, the output may be a single line: "Tested simplest hypothesis X — confirmed/refuted."
| Anti-Pattern | Symptom | Correction | |---|---|---| | Oversimplifying irreducible domains | Applying "simplest" to distributed consensus or security models | "But no simpler" — respect domain complexity | | Complexity bias | Assuming complex = sophisticated, testing complex hypotheses first | Test fewest-assumption hypotheses first, always | | Trigger inflation | Running the full enumeration for a one-step test | If the simplest is one-step testable, just test it | | Ignoring explanatory power | Choosing the simplest hypothesis that doesn't fit the evidence | Fewer assumptions doesn't beat not fitting the data | | Local simplicity, systemic risk | Choosing a simple local fix that creates fragility elsewhere | Prefer systemic simplicity over local simplicity | | Ritualistic assumption counting | Spending more time counting assumptions than testing | The point is prioritization, not precision; rough count is enough |
tools
About to add a feature/layer/process to fix a problem. First ask what to remove instead — subtraction is often more robust than addition. Use for simplification and complexity reduction.
development
Use when stuck between two architecture or API requirements that seem mutually exclusive — name the contradiction precisely, then separate the conflicting states in time, space, or condition.
testing
You need to trace how a system would fail or behave at a scale you can't cheaply test or measure. Use to imagine the scenario and walk the consequence chain step by step.
devops
Use when optimizing latency or throughput in a pipeline and one stage dominates—focus all effort on that single bottleneck, since speeding up the others changes nothing until it's fixed.