---
name: session-summarize
description: Summarize current Claude Code session with todo/plan state, key decisions, and blockers for pasting into fresh session
---

# Session Summarizer Command

When invoked, generate a session summary in markdown format suitable for pasting into a fresh Claude Code session.

## Execution Steps

1. **Gather session state**:
   - Check `.claude/plans/` for active plan files
   - Look for active todos in CLAUDE.md or `.claude/projects/[workspace]/memory/` directory
   - Scan recent memory files (decision, feedback, project, reference files) for non-obvious decisions
   - Run `git status --short` to list changed files
   - Run `git log --oneline -5` to show recent commits this session

2. **Extract from conversation** (this session only):
   - Identify key decisions made ("decided to", "will use", "approach:")
   - Identify blockers or open questions ("blocked on", "pending", "need to", "stuck on")
   - Do NOT include completed work or routine back-and-forth

3. **Build preamble text**:

```
## Session Context

**Date**: [today's date]
**Branch**: [git branch]

### Active Todos
[Copy from .claude/plans or CLAUDE.md if exists; format as list. Skip section if none.]

### Current Plan
[Extract first 20-30 lines from active plan file if exists. Skip if none.]

### Key Decisions This Session
- [Each decision as bullet]

### Blockers / Open Questions
- [Anything blocking progress or pending decision]

### Files Changed
[Git status output, just filenames]

### Recent Commits
[Last 5 commits]

---

### How to Resume

Paste entire block above into new session opening prompt. Continue from **Current Plan** section or latest blocker. Git will load modified files automatically.
```

4. **Output constraints**:
   - Skip sections with no content (except Date/Branch/How to Resume)
   - Only include active todos (not completed ones)
   - Decisions/blockers: 1-2 lines each, no verbosity
   - No full diffs, conversation history, or verbose explanations
   - Total output should fit in ~500 words max

5. **Deliver summary**:
   - Display markdown block in response
   - Add note: "Copy entire block above to clipboard for new session"
