end-learn
Overview
Close a learning session by synthesizing Claude's silent observations into a debrief the user reviews. Write the session log, update lesson state, and archive completed lessons.
When to Use
- User finishes a learning session
- User wants to save progress and stop
- Called by
/learnwhen postponing or abandoning a lesson
Prerequisites
There must be an active lesson at ~/.claude/learning/lessons/current.md. If not,
tell the user: "No active lesson found. Nothing to close."
Process
1. Read State
~/.claude/learning/lessons/current.md— current lesson state- Session observations from the current conversation (hints given, struggles, successes)
2. Present Draft Debrief
Synthesize observations into a structured draft. Use this exact format:
Here's what I noticed this session:
**What you worked on**
- [summary of milestone(s) attempted and outcomes]
**Key learnings**
- [things the user demonstrated understanding of]
- [concepts that "clicked" based on observed aha moments]
**Struggled with**
- [areas where hints were needed]
- [repeated mistakes or confusion points]
**Still fuzzy on**
- [unresolved questions]
- [topics where understanding seemed incomplete]
If a section is empty (e.g., no struggles), include it with "Nothing notable — solid session!" rather than omitting it.
Ask: "Edit anything, add something I missed, or looks good?"
Wait for the user to confirm or make edits. Do NOT proceed until the user responds.
3. Determine Lesson Status
If all milestones are completed:
- Congratulate the user
- Status:
completed
If not all milestones are done:
- Ask: "What should we do with this lesson?"
- Continue next time — keep as
current.md, no archive - Postpone — archive with
status: postponed - Abandon — ask for a brief reason, archive with
status: abandoned
- Continue next time — keep as
4. Write Session Log
Write to ~/.claude/learning/logs/YYYY-MM-DD.md:
- If the file already exists (same-day session), use suffix:
YYYY-MM-DD-2.md,YYYY-MM-DD-3.md, etc. - Use the session log format from
~/.claude/skills/learning-data-spec.md - Content comes from the confirmed debrief
5. Update Lesson State
If continuing next time:
- Update
milestones_completedincurrent.mdfrontmatter - Mark completed milestones as
[x]in the milestones list - Append a session log entry to
current.md:### Session N — YYYY-MM-DD - Completed: [milestones] - Struggled with: [summary] - Next: [what to tackle next]
If completed:
- Move
current.mdtolessons/archive/YYYY-MM-DD-<topic-slug>.md - Set frontmatter:
status: completed,closed: YYYY-MM-DD,sessions: N - Add
## Key Learningsand## Still Fuzzy Onsections from accumulated observations - Mark the corresponding backlog item as
[x]done inbacklog.md - Delete
current.md
If postponed:
- Move
current.mdtolessons/archive/YYYY-MM-DD-<topic-slug>.md - Set frontmatter:
status: postponed,closed: YYYY-MM-DD - Preserve all milestone progress and session logs
- Delete
current.md
If abandoned:
- Move
current.mdtolessons/archive/YYYY-MM-DD-<topic-slug>.md - Set frontmatter:
status: abandoned,closed: YYYY-MM-DD,abandoned_reason: <reason> - Preserve all milestone progress and session logs
- Delete
current.md
6. Confirm
Tell the user what was saved:
- "Session log saved to
logs/YYYY-MM-DD.md" - If archived: "Lesson archived as [status] to
lessons/archive/[filename]" - If continuing: "Progress saved. Run
/learnnext time to continue from milestone X."
Important
- Always present the debrief and get user confirmation BEFORE writing any files
- Observations come from the current conversation — if
/end-learnis called in a new conversation (without a preceding/learn), ask the user to describe what they did - Create directories if they don't exist (
logs/,lessons/archive/) - The slug for archive filenames: lowercase, hyphens, max 50 chars (e.g., "react-dashboard-api-metrics")