Generate structured session summaries optimized for future AI agent consumption. Use when (1) ending a coding/debugging session, (2) user says "compact", "summarize session", "save context", or "wrap up", (3) context window is getting long and continuity matters, (4) before switching tasks or taking a break. Produces machine-readable handoff documents that let the next session start fluently without re-explaining.
Generate structured summaries optimized for AI agent continuity across sessions.
Human-written summaries and ad-hoc AI summaries lose critical context:
This skill produces agent-optimized handoff documents that prime the next session.
Generate a markdown file with this structure:
# Session: [Brief Title]
Date: [YYYY-MM-DD]
Duration: ~[X] messages
## Context Snapshot
[1-2 sentences: What project/task, what state it's in right now]
## What Was Accomplished
- [Concrete outcome 1]
- [Concrete outcome 2]
## Key Decisions & Rationale
| Decision | Why | Alternatives Rejected |
|----------|-----|----------------------|
| [Choice] | [Reason] | [What didn't work and why] |
## Current State
- **Working**: [files/features that are functional]
- **Broken/Blocked**: [what's not working and why]
- **Modified files**: [list with brief note on changes]
## Dead Ends (Don't Retry)
- ❌ [Approach that failed] — [why it failed]
## Next Steps (Prioritized)
1. [ ] [Most important next action]
2. [ ] [Second priority]
## Environment & Gotchas
- [Any setup notes, versions, quirks discovered]
## Key Code/Commands Reference
[Only if there are non-obvious commands or snippets the next session needs]
session-[topic]-[date].md in project root or /home/claude/sessions/Invoke this skill when:
Good compactions are:
Avoid:
User: "Let's wrap up, compact this session"
Agent:
session-[topic]-[date].mdsession-auth-refactor-2025-01-06.md — ready for next time."