Capture session insights, decisions, learnings, and subagent analysis into a structured markdown file. Run at end of session or anytime.
Capture and save learnings from the current working session.
Detect file changes — run these commands to understand what changed:
git status --short
git diff --stat HEAD
Determine the next sequential number — count existing files:
ls claude_session_learnings/*.md 2>/dev/null | wc -l
The next number is count + 1, zero-padded to 3 digits (e.g., 001, 012).
Generate the filename using format: NNN_YYYY-MM-DD_HHMM_short-slug.md
NNN: zero-padded sequential numberYYYY-MM-DD: today's dateHHMM: current time (24h)short-slugGet current date and time:
date +"%Y-%m-%d_%H%M"
Review the full conversation context and extract insights across these categories:
Write the session file to claude_session_learnings/NNN_YYYY-MM-DD_HHMM_slug.md using this exact template:
# Session: YYYY-MM-DD — <Session Title>
## Summary
Brief 2-3 sentence overview of what was accomplished in this session.
## Files Changed
- `path/to/file.py` — What changed and why
- `path/to/other.ts` — What changed and why
## Decisions & Rationale
| Decision | Alternatives Considered | Why Chosen |
|----------|------------------------|------------|
| Choice made | Other options explored | Reasoning |
## Learnings
- Insight discovered during this session
- Another learning
## Subagent Analysis
| Agent | Task | Outcome | Notes |
|-------|------|---------|-------|
| agent-type | What it was asked to do | Success/Failed/Partial | Why this agent was chosen, what happened |
## Mistakes & Corrections
- **Mistake**: What went wrong
- **Fix**: How it was corrected
- **Prevention**: How to avoid this next time
## Unfinished Work
- [ ] Remaining TODO item
- [ ] Another item to pick up next session
## Memory Promotion Candidates
> These insights may be worth adding to MEMORY.md:
- Insight that should persist across sessions
- Pattern or convention discovered