Plan-to-Learnings Distiller
Target: $ARGUMENTS
Extracts structured learnings from Claude Code plan files. Distills decisions
made, alternatives rejected, and patterns discovered into a persistent document
that compounds project knowledge over time.
Arguments
| Position |
Name |
Required |
Default |
Description |
| 1 |
time-range |
no |
7d |
E.g. 7d, 30d, this-week. Filter plans by modification time. |
| 2 |
output-path |
no |
docs/learnings/from-plans.md |
Where to write/append output. |
Examples:
/distilling-plan-learnings # Last 7 days → docs/learnings/from-plans.md
/distilling-plan-learnings 30d # Last 30 days
/distilling-plan-learnings 7d ./my-learnings.md # Custom output path
Data Source
~/.claude/
├── plans/*.md # Plan mode files (filtered by mtime)
When to Use
- After completing a plan or sprint — capture what was learned
- At week/sprint boundaries — accumulate decision history
- Before starting a new plan — review past decisions and patterns
Do Not Use
- For real-time plan editing (use plan mode directly)
- For cross-project synthesis (use
/synthesizing-cc-bigpicture)
- For session-level context (use session-memory)
Workflow
Parse arguments — Apply defaults per Arguments table. Resolve output path.
Create parent directories if needed.
Glob plans — Glob ~/.claude/plans/*.md. Filter by modification time
against the time-range argument. Sort by mtime descending (newest first).
If no plans match, report "No plans found in time range" and stop.
Read each plan — Read matching plan files sequentially. Extract content
sections, noting plan title and date.
Extract learnings into three categories:
- Decisions made — Choices that were committed to. Look for: selected
approaches, accepted trade-offs, finalized designs, chosen tools/patterns.
- Alternatives rejected — Options considered but not chosen. Look for:
crossed-out items, "decided against", "considered but", trade-off
discussions, pros/cons where one side won.
- Patterns discovered — Recurring themes or insights. Look for: repeated
blockers, successful strategies, workflow improvements, reusable solutions.
Format output — Structure with date headers per plan. Group by category
within each plan section.
Write or append — If output file exists, append new entries below
existing content with a separator. If new, write with header.
Output Format
# Learnings from Plans
## <Plan Title> — <YYYY-MM-DD>
### Decisions Made
- <decision>: <rationale>
### Alternatives Rejected
- <alternative>: <why rejected>
### Patterns Discovered
- <pattern>: <context and implication>
---
Common Pitfalls
- Inventing learnings: Only extract what is explicitly stated or strongly
implied in plan text. Do not infer decisions that aren't there.
- Duplicating entries: When appending, check existing content for duplicates
before adding.
- Over-extraction: Prefer fewer, high-quality entries over exhaustive lists.
Each entry should be actionable or informative.
Quality Check
- Correct > Complete > Minimal (ACE-FCA)
- Every entry traces to a specific plan file
- Decisions include rationale, not just the choice
- Alternatives include why they were rejected
- Patterns are genuinely recurring (seen in 2+ plans) or significant
1---2name: distilling-plan-learnings3description: Plan-to-Learnings Distiller4---56# Plan-to-Learnings Distiller78**Target**: $ARGUMENTS910Extracts structured learnings from Claude Code plan files. Distills decisions11made, alternatives rejected, and patterns discovered into a persistent document12that compounds project knowledge over time.1314## Arguments1516| Position | Name | Required | Default | Description |17|----------|------|----------|---------|-------------|18| 1 | `time-range` | no | `7d` | E.g. `7d`, `30d`, `this-week`. Filter plans by modification time. |19| 2 | `output-path` | no | `docs/learnings/from-plans.md` | Where to write/append output. |2021**Examples:**2223```24/distilling-plan-learnings # Last 7 days → docs/learnings/from-plans.md25/distilling-plan-learnings 30d # Last 30 days26/distilling-plan-learnings 7d ./my-learnings.md # Custom output path27```2829## Data Source3031```32~/.claude/33├── plans/*.md # Plan mode files (filtered by mtime)34```3536## When to Use3738- After completing a plan or sprint — capture what was learned39- At week/sprint boundaries — accumulate decision history40- Before starting a new plan — review past decisions and patterns4142## Do Not Use4344- For real-time plan editing (use plan mode directly)45- For cross-project synthesis (use `/synthesizing-cc-bigpicture`)46- For session-level context (use session-memory)4748## Workflow49501. **Parse arguments** — Apply defaults per Arguments table. Resolve output path.51 Create parent directories if needed.52532. **Glob plans** — Glob `~/.claude/plans/*.md`. Filter by modification time54 against the `time-range` argument. Sort by mtime descending (newest first).55 If no plans match, report "No plans found in time range" and stop.56573. **Read each plan** — Read matching plan files sequentially. Extract content58 sections, noting plan title and date.59604. **Extract learnings** into three categories:6162 - **Decisions made** — Choices that were committed to. Look for: selected63 approaches, accepted trade-offs, finalized designs, chosen tools/patterns.64 - **Alternatives rejected** — Options considered but not chosen. Look for:65 crossed-out items, "decided against", "considered but", trade-off66 discussions, pros/cons where one side won.67 - **Patterns discovered** — Recurring themes or insights. Look for: repeated68 blockers, successful strategies, workflow improvements, reusable solutions.69705. **Format output** — Structure with date headers per plan. Group by category71 within each plan section.72736. **Write or append** — If output file exists, append new entries below74 existing content with a separator. If new, write with header.7576## Output Format7778```markdown79# Learnings from Plans8081## <Plan Title> — <YYYY-MM-DD>8283### Decisions Made84- <decision>: <rationale>8586### Alternatives Rejected87- <alternative>: <why rejected>8889### Patterns Discovered90- <pattern>: <context and implication>9192---93```9495## Common Pitfalls9697- **Inventing learnings**: Only extract what is explicitly stated or strongly98 implied in plan text. Do not infer decisions that aren't there.99- **Duplicating entries**: When appending, check existing content for duplicates100 before adding.101- **Over-extraction**: Prefer fewer, high-quality entries over exhaustive lists.102 Each entry should be actionable or informative.103104## Quality Check105106- Correct > Complete > Minimal (ACE-FCA)107- Every entry traces to a specific plan file108- Decisions include rationale, not just the choice109- Alternatives include why they were rejected110- Patterns are genuinely recurring (seen in 2+ plans) or significant