
learn-history
โ 239by openshift ยท part of openshift/oc
Analyze all past sessions for this project and extract knowledge worth persisting to AGENTS.md, .claude/agents/, or memory. Deep analysis of full session history.
This is the playbook your agent receives when the skill activates โ you don't need to read it to use the skill, but it's here to audit before installing.
Analyze the full session history for this project to extract knowledge worth persisting.
Session logs location
Session logs are JSONL files at the project config path. Find them with:
ls -lhS ~/.claude/projects/$(echo "$PWD" | tr '/' '-')/*.jsonlEach line is a JSON object with a type field (user for user messages, others for assistant responses). User messages have .message.content with the prompt text.
Process
- Read the current state of AGENTS.md, .claude/agents/*.md, and the memory index for this project at
~/.claude/projects/$(echo "$PWD" | tr '/' '-')/memory/MEMORY.md(skip if absent) - List all session files, sorted by size (larger sessions have more content worth mining)
- For each session, extract user messages and assistant text responses (skip tool results โ they're too large). Focus on:
- User corrections and redirections
- Patterns that were discovered after expensive exploration
- Knowledge that was needed repeatedly across sessions
- Cross-reference findings against what's already documented to avoid duplicates
- Group findings by destination:
- AGENTS.md โ brief conventions/rules (1-2 lines each)
- .claude/agents/*.md โ agent-specific knowledge
- Memory โ user preferences, project context, feedback
- Nowhere โ already documented or too specific to recur
- Present a summary of all proposed changes for approval. Do NOT write anything until approved.
Guidelines
- Prioritize findings that recur across multiple sessions โ those have the highest ROI
- Keep AGENTS.md entries concise. If something needs more than 2 lines, it probably doesn't belong there.
npx skills add https://github.com/openshift/oc --skill learn-historyRun this in your project โ your agent picks the skill up automatically.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.
Licensed under Apache-2.0โ you can use, modify, and redistribute it under that license's terms.
View the full license file on GitHub โ