session-learning

Analyzes Claude Code session metrics to recommend memory, skill, and command updates.

1|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill session-learning-harmaalbers
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: session-learning
Source: https://github.com/HarmAalbers/claude-requirements-framework/tree/main/plugins/requirements-framework/skills/session-learning
Command: npx skills add https://github.com/HarmAalbers/claude-requirements-framework --skill session-learning-harmaalbers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Claude Code sessions generate valuable usage data that normally disappears when the session ends, so recurring friction points, workflow patterns, and knowledge gaps are never captured or used to improve future sessions. ## Core Features & Use Cases - Session Metrics Collection: Automatically records tool usage, requirement flow, errors, and skill/agent invocations into .git/requirements/sessions/<session_id>.json during each session. - Pattern Analysis & Recommendations: The /session-reflect command runs a session-analyzer agent that detects workflow patterns, friction points, and automation opportunities, then suggests confidence-scored updates to Serena memories, skills, and commands. - Versioned, Rollback-Capable Updates: Every applied change is recorded in .git/requirements/learning_history.json and can be undone with req learning rollback <id>. - Use Case: After a long debugging session, run /session-reflect to discover a repeated ADR lookup pattern, then approve a recommendation that creates a frequently-referenced.md memory so the next session starts with that context already available. ## Quick Start Enable session learning by setting hooks.session_learning.enabled: true in .claude/requirements.yaml, then ask Claude to run /session-reflect at the end of your session to analyze it and apply improvements.

Frequently Asked Questions about session-learning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable session learning in Claude Code?▼

Enable session learning by adding `hooks.session_learning.enabled: true` to `.claude/requirements.yaml` or `.claude/requirements.local.yaml`. Set `prompt_on_stop: true` to get a review prompt when the session ends.

How do I analyze a Claude Code session for improvements?▼

Run `/session-reflect` for a full analysis with recommendations, `/session-reflect quick` for summary statistics, or `/session-reflect analyze-only` to preview findings without applying changes. The session-analyzer agent detects workflow patterns, friction points, and knowledge gaps.

Can I undo a session learning update?▼

Yes, run `req learning rollback <id>` to undo a specific update recorded in `.git/requirements/learning_history.json`. For updates without previous content, such as file creations, restore the file with `git checkout -- .serena/memories/<filename>`.

Why is session learning not prompting when my session ends?▼

The prompt requires `enabled: true` and `prompt_on_stop: true` in the session_learning hook configuration. The session must also exceed the `min_tool_uses` threshold, which defaults to 5 tool uses.

Where are Claude Code session metrics stored?▼

Session metrics are stored in `.git/requirements/sessions/<session_id>.json` and collected automatically while the framework is enabled. Learning history is tracked separately in `.git/requirements/learning_history.json`.