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?"
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 "P:\.claude\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 P:\.claude\CLAUDE.md and P:\__csf\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}
| Source | Provides | How to access |
|---|---|---|
/recap CLI | Session chain + semantic content | python "P:\.claude\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 P:\__csf\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:
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 cause