/cc-skills-analysis:whyfrom cc-skills-analysis
Decision archaeology — trace backward through sessions to reconstruct why something exists, what caused it, and the reasoning chain behind it. NOT a debug tool — answers "why are we doing X?"
Ships in cc-skills-analysis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Problem solved: "I forgot why we're doing this. What caused it? What was the reasoning?"
This is NOT /recap. /recap tells you what happened chronologically. /why traces backward through decisions to reconstruct causal chains — who decided what, why, based on what assumptions.
Extract the topic from the user's input. Strip the "/why" prefix and any question framing.
Classify the question type:
| Type | Pattern | Focus |
|---|---|---|
| Decision chain | /why did we change X?, /why auth flow | What decisions led to current state |
| Existence rationale | /why do we have X?, /why does X exist? | What pain point prompted X, what alternatives were considered, why this solution |
| Self-referential | /why are we building a /why skill? | Meta — trace the skill's own creation |
| Open | /why (no args) | Ask: "What topic do you want to trace?" |
| Input | Type | Topic |
|---|---|---|
/why auth flow | Decision chain | auth flow decisions |
/why do we have nlm? | Existence rationale | nlm |
/why are we building a /why skill? | Self-referential | /why skill creation |
/why did we change the notebooklm skill? | Decision chain | notebooklm skill changes |
Run these data sources in parallel to find all mentions of the topic:
Tier 1 — Primary (terminal-attributed, authoritative):
Session history — python "$CLAUDE_ROOT/skills\recap\scripts\recap_cli.py" recap
sessionId/session_chain_idCKS knowledge — mcp__search-research__cks_search with topic keywords
Memory files — Search C:\Users\brsth\.claude\projects\P--\memory\ for topic keywords
CLAUDE.md + ADRs — Grep for topic in $CLAUDE_ROOT/CLAUDE.md and $__CSF_ROOT/arch_decisions\
Tier 2 — Supplementary (corroboration only, no terminal attribution):
Git log — git log --oneline --all --grep="{topic}" -20
Git blame — git log -S "topic" --oneline and git log --follow -p -- {file}
From gathered data, identify these signals:
Decisions (what was chosen):
Triggers (what caused the decision):
Assumptions (what the decision rests on):
Corrections (where reasoning changed):
Constraints (what limited options):
For existence rationale questions, also extract:
Pain points (what hurt before this existed):
Solution selection (why THIS solution vs alternatives):
Maintenance contract (how it stays current):
Build backward from current state to origin:
Current State → Last Decision → What Triggered It → Earlier Decision → Original Need
For each link in the chain, identify:
After reconstructing the initial chain, examine each link for surprise — an answer that doesn't fully explain the link above it, or that raises a new question:
For each link in the chain:
Ask: "Why was THIS specific answer true, and not something else?"
If the answer is unexpected or unexplained → run a targeted search for that gap
If the answer is obvious from context → move on
This recovers the iterative "ask why about each answer" quality of the five whys. One-shot evidence gathering is efficient but risks anchoring on the first narrative that fits. The surprise check forces a second pass where each layer gets challenged.
Surprise signals to look for:
When surprise is found: Do a targeted search (one of the 6 data sources) specifically for the gap. Don't re-run all searches — just the one most likely to fill the gap.
Before presenting, identify what you would expect to find but didn't:
Missing expected evidence is itself a signal — it suggests the decision may have been:
Flag absent evidence as [ABSENT EVIDENCE] in the output.
For decision chain questions:
## Why: {topic}
### Origin
{What first prompted this work — the original need/problem}
### Decision Chain
1. **{Decision}** — {when} — {rationale}
- Triggered by: {what caused it}
- Assumption: {what it rests on}
2. **{Decision}** — {when} — {rationale}
- Course correction from #1: {what changed and why}
### Branching Analysis (if multiple causes)
If multiple valid causes exist at any decision point:
- **Path A**: {cause + evidence + where it leads}
- **Path B**: {cause + evidence + where it leads}
- **Selected**: {which path was taken and why}
### Current State
{Where things stand now and why}
### Key Assumptions
- {Assumption}: {still valid? yes/no/unknown}
### Verification
{How to confirm this causal chain is correct — what would disprove it?}
### Absent Evidence
{What you'd expect to find but didn't — what this absence suggests}
For existence rationale questions ("why do we have X?"):
## Why: {topic}
### Pain Point (what hurt before this existed)
{The original problem that X was created to solve — what was annoying/broken/missing}
### Solution Selection (why THIS approach)
{What alternatives were considered and why this one was chosen}
- **Considered**: {alternatives found in evidence}
- **Chosen**: {what was selected and the rationale}
- **Rejected because**: {why alternatives didn't work}
### How it works now
{Current state — what it does, how it's maintained}
### Maintenance Contract
{How it stays current: upstream-managed? manually updated? version-locked?}
### Key Assumptions
- {Assumption}: {still valid? yes/no/unknown}
### Verification
{How to confirm this rationale is correct — what would disprove it?}
### Absent Evidence
{What you'd expect to find but didn't}
GATE 1 (STOP after Step 2: Gather Evidence): Before moving to Step 3 (Extract Causal Markers), verify:
If gate fails: re-gather evidence before proceeding.
GATE 2 (STOP after Step 3: Extract Causal Markers): Before moving to Step 4 (Reconstruct Causal Chain), verify:
If gate fails: extract more causal markers before reconstructing chain.
GATE 3 (STOP after Step 5: Surprise Check): Before moving to Step 6 (Absent Evidence Check), verify:
If gate fails: run surprise check before absent evidence check.
STOP between generation (Steps 1-4) and validation (Steps 5-7):
| Source | Provides | How to access |
|---|---|---|
/recap CLI | Session chain + semantic content | python "$CLAUDE_ROOT/skills\recap\scripts\recap_cli.py" recap |
| TranscriptParser | Decisions, patterns, corrections | Via recap output or direct grep of transcript |
| CKS | Prior decisions in knowledge base | mcp__search-research__cks_search |
| Memory | Feedback rules, project context | Search C:\Users\brsth\.claude\projects\P--\memory\ |
| CLAUDE.md | Architectural constraints | Grep for topic keywords |
| ADRs | Documented architecture decisions | Glob in $__CSF_ROOT/arch_decisions\ |
| Source | Provides | How to access |
|---|---|---|
| Git log | Commit history and messages | git log --oneline --all --grep="{topic}" |
| Git blame | Who introduced changes | git log -S "topic" --oneline, git log --follow -p -- {file} |
Why git is Tier 2: In multi-terminal environments, git cannot attribute commits to specific terminals. Git shows author + timestamp but NOT which terminal session produced the change. Use git to corroborate transcript evidence, never as primary source for "which terminal/why."
If no evidence found for the topic:
Before claiming code is absent, unchanged, or non-existent — search the codebase and verify with tools first. Claims of absence are only valid after confirmed Read/Grep/git failures.
Do NOT answer without reading relevant source files first. Do not ask the user for information you can obtain yourself via Read, Grep, Bash, git, or available MCP tools.
Prohibited:
git log --follow -p -- {file}[UNVERIFIED].history.jsonl summaries via walk_chain_simple(). Compacted summaries retain decision markers even when full transcripts are garbage-collected./recap/why traces causal chains. /recap provides the chronological overview that feeds into causal analysis:
/why surfaces a decision chain, use /recap brief to get the broader session context around those decisions/recap surfaces something interesting (e.g., a recurring problem pattern), use /why "why did we keep hitting X?" to dig into the root causeWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (enduser123/cc-skills-analysis) — no native marketplace selected
npx claudepluginhub p/enduser123-cc-skills-analysis14 skills in this plugin
/behaveStructured behavioral analysis for LLM performance debugging — hypothesis testing for session patterns (loops, context degradation, decision inefficiency, cognitive overload, attention drift)/claude-auditAudit and optimize Claude Code configuration (CLAUDE.md, .claude/rules/, skills, hooks, agents, MCP, plugins, MEMORY.md) for over-engineering, token waste, and rule-shape — whether each rule lives in the right mechanism. Consolidates claudit + config-audit. Self-contained; no external subagent fleet./debriefUnified analysis hub — mines transcripts for unfinished work + origin-anchored tasks. Modes: default (transcript → root-cause tasks), chain (multi-session retrospective: /recap→gaps→/friction→/red-team→/rns + SCORES), gaps (deterministic gap detectors + mandatory haiku gap reviewer + RNS + artifact contract), top (6-source problem scan → ranked tasks). Trigger phrases: 'debrief this transcript', 'mine the chat history', 'victim log', 'why is this broken', 'run a retro', 'top problems', 'what gaps remain'. Absorbs /retro and /top-problems; gap detection is debrief-owned.