session-learning-capture — Claude Code command: save session learnings
A slash command that pulls lessons out of the current Claude session and writes them into the project's memory files, so the next run starts informed.
npx claude-code-templates@latest --command team/session-learning-captureWhat session-learning-capture does
The command scans a session for things worth keeping: new project facts, fixes to the implementation, observations about structure, and workflow improvements. It sorts each find by type, picks the memory file it belongs in, and updates CLAUDE.md. You steer it with an argument — --project-learnings, --implementation-corrections, --structure-insights or --workflow-improvements.
It runs on four tools: Read, Write, Edit and Glob. The last one locates CLAUDE*.md files in the project, which is how the command decides where knowledge goes. No such files means nowhere obvious to write, so create at least one first.
Before saving, it checks that what it captured is accurate and that existing notes survive the edit. Handy on long projects where conventions pile up faster than anyone documents them.
What it helps with
- keep session takeaways in project memory files
- separate implementation fixes from general notes
- locate every
CLAUDE*.mdfile and pick which to update - record workflow improvements without writing them by hand
- append structural observations to the docs
Example prompts for the agent
- /session-learning-capture --implementation-corrections
- /session-learning-capture --project-learnings
- /session-learning-capture --workflow-improvements
How to install session-learning-capture
1claude-code-templates
npx claude-code-templates@latest --command team/session-learning-capture2Manually: put the files in place
.claude/commands/session-learning-capture.mdCall it with /session-learning-capture. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/session-learning-capture.mdCall it with /prompts:session-learning-capture. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/session-learning-capture.prompt.mdManually: put the files in place
.gemini/commands/session-learning-capture.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about session-learning-capture
How do I install session-learning-capture in Claude?
Use the templates CLI: npx claude-code-templates@latest --command team/session-learning-capture. The command file then sits at .claude/commands/session-learning-capture.md.
What does session-learning-capture do?
It captures knowledge from the current session and integrates it into the project's memory files, updating CLAUDE.md and related docs.
What arguments does the command take?
--project-learnings, --implementation-corrections, --structure-insights and --workflow-improvements — each narrows the capture to one kind of knowledge.
Source text
session-learning-capture.md · MIT
--- allowed-tools: Read, Write, Edit, Glob argument-hint: "[capture-type] | --project-learnings | --implementation-corrections | --structure-insights | --workflow-improvements" description: Capture and document session learnings with automatic knowledge integration and memory updates --- # Session Learning Capture Capture and integrate session learnings into project memory and knowledge base: **$ARGUMENTS** ## Current Learning Context - Session duration: Current Claude Code session learning opportunities - Memory files: !`find . -name "CLAUDE*.md" | wc -l` available memory files for knowledge integration - Project complexity: Assessment of project structure and documentation completeness - Learning patterns: Identification of knowledge gaps and correction opportunities ## Task Execute comprehensive learning capture with automatic knowledge integration: **Capture Type**: Use $ARGUMENTS to focus on project learnings, implementation corrections, structure insights, or workflow improvements **Learning Capture Framework**: 1. **Learning Identification** - Detect new project knowledge, identify implementation corrections, recognize structural insights, note workflow discoveries 2. **Knowledge Classification** - Categorize learning type, assess importance level, determine integration location, evaluate reusability potential 3. **Context Analysis** - Analyze session context, identify triggering conditions, assess knowledge applicability, determine documentation needs 4. **Integration Planning** - Select appropriate memory files, determine update strategy, maintain consistency, preserve existing knowledge 5. **Memory Updates** - Update CLAUDE.md files, enhance documentation, improve workflows, strengthen knowledge base 6. **Validation Process** - Verify accuracy of captured knowledge, ensure integration quality, validate accessibility, confirm usefulness **Advanced Features**: Automated learning detection, intelligent categorization, context-aware integration, knowledge graph enhancement, version control integration. **Quality Assurance**: Learning accuracy validation, integration consistency, accessibility optimization, knowledge retrieval efficiency. **Output**: Comprehensive learning integration with updated memory files, enhanced documentation, improved workflows, and validated knowledge base.
© davila7 · MIT · davila7/claude-code-templates