session-summarizer
Session Summarizer
Overview
Every session generates knowledge: decisions made, patterns that worked, problems encountered, questions that arose. Session summaries capture this for future compound learning.
Core principle: Document sessions to build knowledge that compounds across time.
When to Use
User runs /summarize command to create a session summary.
Create summaries to capture:
- What worked and why
- What didn't work and why
- Questions encountered
- Patterns to remember
- Context for future sessions
Information Sources (Required)
You MUST integrate all three sources:
-
Session logs:
~/.claude/projects/[project-path]/[session-id]/session-memory/summary.md- Contains context, decisions, learnings that commit messages miss
- Read this FIRST before writing summary
-
Git history:
git log --oneline -n 20andgit diffsince session start- What actually changed
- Commit messages and patterns
-
Conversation context: Your memory of the session
- Questions asked, approaches tried, decisions made
Using session logs:
# Find current session log
ls -la ~/.claude/projects/$(pwd | sed 's/\/Users\/[^/]*\/Projects\///g')/*/session-memory/summary.md | tail -1
# Read it
cat [path-from-above]
Summary Structure
# Session Summary - [Date]
## Context
[One-line: what was the goal/problem]
## Victories
- [What worked, solutions found]
- [Patterns that were effective]
## Failures
- [What didn't work, why]
- [Dead ends, wrong assumptions]
## Root Causes
- [For each failure above: What in your system prompt or tooling made you make this mistake?]
- [Analyze prompt assumptions, tool limitations, missing context that led to errors]
- [Example: "Assumed Write tool would create parent directories - tooling doesn't support this"]
- [Example: "System prompt emphasized speed over verification - led to skipping file reads"]
## Tough Questions
- [Questions that came up, answered or not]
- [Ambiguities encountered]
## Improvements
- [What could be better next time]
- [Patterns to codify, failures to document]
## Git Activity
- [Commit count, key changes]
- [Files modified, tests added]
## Next Session
- [Unfinished items, follow-ups needed]
Workflow
- User runs
/summarizecommand - Read session logs at
~/.claude/projects/.../summary.md - Check git log and git diff
- Write structured summary integrating all three sources
- For each failure, analyze root causes in system prompt/tooling
- Ask user if they want summary saved anywhere specific
Root Cause Analysis
For each failure or mistake documented:
- What in the system prompt made you assume something incorrect?
- What tool limitations were you unaware of?
- What context was missing that would have prevented the error?
Examples:
- "Assumed Edit tool would preserve formatting - tool doesn't guarantee this"
- "System prompt didn't mention needing parent directories - led to Write failures"
- "Believed git hooks were disabled by default - prompt never specified"
Purpose: Understand what gaps in prompts or tooling cause errors, enabling systemic improvements.
Example
User: /summarize
You: "I'll create a session summary capturing what we accomplished and learned today."
[Read session logs, check git, write summary with root cause analysis...]
You: "Here's the summary:
Session Summary - 2025-01-18
Context
Fixed authentication bug in React app where tokens weren't persisting across page refreshes.
Victories
- Identified root cause in localStorage timing
- Implemented useEffect hook with proper dependencies
- All tests pass, authentication now persists correctly
Failures
- Initially tried sessionStorage (wrong storage type)
- First useEffect implementation had dependency array issues causing infinite loops
Root Causes
- sessionStorage attempt: System prompt didn't emphasize localStorage vs sessionStorage differences - I assumed sessionStorage would persist but it's page-scoped only
- useEffect infinite loop: Tool limitations - no linter feedback in Edit tool, had to discover through testing rather than static analysis
Tough Questions
- Should tokens go in httpOnly cookies instead of localStorage? (security trade-off)
Improvements
- Add localStorage persistence patterns to project documentation
- Consider adding ESLint rules for useEffect dependencies
Git Activity
- 3 commits
- Modified: src/hooks/useAuth.ts, src/components/Login.tsx
- Added: tests for token persistence
Next Session
- Consider cookie-based auth implementation for better security
Would you like me to save this anywhere specific, or is the session log sufficient?"
More from fimoklei/pm-ai-playbook
first-principles-decomposer
Break any problem down to fundamental truths, then rebuild solutions from atoms up. Use when user says "firstp", "first principles", "from scratch", "what are we assuming", "break this down", "atomic", "fundamental truth", "physics thinking", "Elon method", "bedrock", "ground up", "core problem", "strip away", or challenges assumptions about how things are done.
20optimize-docs
Condense markdown documentation for token efficiency while preserving all semantic meaning. Use when rules, documentation, or config files need optimization. Target 25-40% reduction through systematic condensation patterns.
18idea-challenger
Pre-launch red team analysis that identifies failure modes and validates assumptions before resource commitment. Use when evaluating new products/features/strategies, before significant resource allocation, when stakeholders seem overly optimistic, or when cost of failure would be high (reputation, budget, market position).
18pre-mortem-analyst
Imagine the project already failed, then work backward to find why. More powerful than risk assessment because it assumes failure is certain. Use when user says "pre-mortem", "premortem", "imagine this failed", "what could go wrong", "risk analysis", "before we launch", "stress test", "what would kill this", "project risks".
18inversion-strategist
Flip problems upside down - instead of "how to succeed", ask "how to definitely fail" then avoid those paths. Use when user says "invert", "inversion", "flip it", "opposite approach", "how would this fail", "avoid failure", "what NOT to do", "Munger", "anti-goals", "guarantee failure".
18security-threat-model
Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppSec threat modeling.
16