This skill should be used when the user says 'done for today', 'end session', 'capture learnings', 'wrap up', or asks 'what did we learn?'...
Capture actionable insights, patterns, and outcomes from the current session into structured, persistent memory. Records what was learned, what worked, what could improve, and any new patterns discovered.
Activate when users:
Ask these questions conversationally to gather learning data:
What did you learn today?
What worked well?
What would you do differently?
Any new patterns discovered?
Gather before generating the learning record:
| Field | Format | Notes |
|---|---|---|
| session_date | YYYY-MM-DD | Today's date (auto-generated) |
| session_duration | String | "2 hours", "full day", "1 hour 30 min" |
| project_context | String | What project/issue was worked on |
| learnings | Array | Key insights discovered |
| what_worked | Array | Successful approaches |
| to_improve | Array | What would change next time |
| patterns | Array | New patterns or generalizations |
| Field | Format | Notes |
|---|---|---|
| related_issues | Array | Beads issue IDs (format: #123) |
| tags | Array | Categorization (e.g., "architecture", "performance", "testing") |
| blockers_resolved | Array | Issues that were unblocked |
| follow_up_tasks | Array | Work identified for future sessions |
| code_snippets | Array | Relevant code examples (file path + line numbers) |
Creates a dated learning record at .claude/context/session/learnings/YYYY-MM-DD.md with:
Ask conversationally in order:
Let's capture what we learned today. I'll ask a few questions:
1. What did you learn today? (new insights, surprising patterns, techniques)
2. What worked well? (successful strategies, effective tools, good decisions)
3. What would you do differently? (missteps, inefficiencies, blocked paths)
4. Any new patterns discovered? (recurring themes, reusable solutions)
Allow free-form responses. Parse multiple items from each answer.
Ask for additional context if relevant:
A few optional questions:
- Were there specific Beads issues or tasks related to this work?
(Use format: #123, #456)
- What tags best categorize this work?
(Examples: architecture, performance, testing, tooling, debugging)
- Did you identify any follow-up work for future sessions?
Create the file at:
.claude/context/session/learnings/YYYY-MM-DD.md
Use this YAML frontmatter template:
---
date: YYYY-MM-DD
duration: "SESSION_DURATION"
project: "PROJECT_CONTEXT"
tags:
- tag1
- tag2
related_issues:
- "#123"
- "#456"
blockers_resolved: []
follow_up_tasks: []
---
Structure the markdown body with four main sections:
Convert responses to "I learned that..." statements. Include:
Example:
## Learnings
- I learned that TypeScript's readonly arrays help prevent mutation bugs at compile time
- I learned that sequential rebasing prevents merge conflicts better than parallel merges
- I learned that the beads MQ is the source of truth, not git branches
Convert responses to achievement statements. Include:
Example:
## What Worked Well
- Using the Bash tool with descriptive comments made debugging faster
- Breaking work into TaskCreate items improved focus and tracking
- Asking for clarification early prevented rework
Convert responses to "Next time..." statements. Include:
Example:
## What I'd Do Differently
- Next time, I'd read the entire schema before implementing validation
- Next time, I'd check for existing utilities before writing custom code
- Next time, I'd run tests earlier to catch integration issues sooner
Generalized insights applicable to future work:
Example:
## Patterns Discovered
**Pattern: Source of Truth Fallacy**
- Git branches and git ls-remote can show stale state
- Always query the canonical source (in Refinery: beads MQ)
- Applies to: merge queues, deployment tracking, task status
**Pattern: Sequential Over Parallel**
- Sequential operations with clear checkpoints catch issues early
- Parallel operations hide dependencies and create conflicts
- Applies to: merging, deployments, test runs
If applicable, add these optional sections:
Link relevant code snippets:
## Code References
- Sequential rebase protocol: `/CLAUDE.md` (lines 245-265)
- Beads MQ check: `handle-failures` step (CLAUDE.md, lines 195-210)
Track identified work for future sessions:
## Follow-up Work
- [ ] #123 - Implement caching layer for performance improvement
- [ ] #456 - Add integration tests for new validation logic
- [ ] Create session learnings review process
Document unblocked work:
## Blockers Resolved
- #789 was blocked waiting for schema clarification → resolved by reading TypeScript types
- Performance issue was blocked by misunderstanding sequential rebase → now documented
Before completing:
.claude/context/session/learnings/YYYY-MM-DD.md
The learning records are organized by date for easy session lookup and historical tracking.
Link to related issues using standard Beads format:
#123, #456related_issues array[#123](../../../issues/123)Format: - "#123" (as strings in YAML)
Update .claude/context/session/index.md if it exists to track:
Example index entry:
- **2026-01-26**: Sequential rebase patterns, Beads MQ verification, source of truth discovery
---
date: 2026-01-26
duration: "3 hours"
project: "Refinery merge queue processor implementation"
tags:
- architecture
- git-operations
- beads-integration
related_issues:
- "#42"
- "#45"
blockers_resolved:
- "Confusion about Beads MQ as source of truth"
follow_up_tasks:
- "Document conflict handling strategy in CLAUDE.md"
- "Create patrol wisp execution guide"
---
## Learnings
- I learned that the Beads MQ (`gt mq list`) is the ONLY canonical source of truth for pending merges - git branches and git ls-remote can show stale state
- I learned that sequential rebase prevents merge conflicts better than parallel merges - each branch must rebase on the current main after the previous one is merged
- I learned that the Refinery's role is to make decisions about conflict handling, not to rely on Go code to auto-resolve
- I learned that the "propulsion principle" means autonomous execution without waiting for confirmation - the hook is the assignment
## What Worked Well
- Breaking down the patrol molecule steps with clear banners made the process understandable
- Using descriptive bash commands with comments improved readability
- Asking clarifying questions about sequential rebase upfront prevented later confusion
- Documenting both the "why" (physics) and "what" (process) made the system intuitive
- Creating a decision matrix for conflict handling gave clarity on when to abort vs. attempt resolution
## What I'd Do Differently
- Next time, I'd explicitly document the source of truth earlier in the context
- Next time, I'd provide working examples of the sequential rebase in action before diving into the theory
- Next time, I'd clarify the "hooked patrol" concept earlier - it's central but explained late
- Next time, I'd include a glossary of Refinery-specific terms (patrol, wisp, polecat, etc.) up front
## Patterns Discovered
**Pattern: Source of Truth Fallacy**
- Systems often have multiple views of the same state (git branches, git ls-remote, task queue)
- Only one is canonical; reading the wrong one causes work to queue up invisibly
- In Refinery: always use `gt mq list`, never `git branch -r`
- Applies to: merge queues, deployment tracking, distributed state systems
**Pattern: Sequential Checkpoints Beat Parallel Operations**
- Parallel operations hide dependencies and create conflicts
- Sequential operations with verification gates (tests must pass) catch issues early
- Each operation must start fresh from the updated baseline
- Applies to: deployments, merges, API calls with side effects
**Pattern: Autonomous Execution Requires Clear Hooks**
- Systems that ask for confirmation create queues and delays
- Systems that define work on hooks and execute autonomously scale
- The hook is the contract - it was placed deliberately
- Applies to: daemon-driven systems, event-driven architectures, queue processors
Capture feedback to improve this skill:
When asking the session end questions, watch for:
Trigger capture at natural session ends: