You are executing the `/summarize` command to create a structured summary of the current Claude Code session for seamless continuation in a fresh context window.
Creates a structured summary of your current session to a file, allowing you to continue work in a fresh context window without losing progress. Use this when approaching context limits to preserve key decisions, work in progress, and next steps.
/plugin marketplace add nitromike502/meckert-claude-code-marketplace/plugin install session-summarizer@local-marketplaceYou are executing the /summarize command to create a structured summary of the current Claude Code session for seamless continuation in a fresh context window.
Before proceeding, ensure you are in the project root directory (the directory containing .claude/). If not, change to the project root first using Bash.
Parse the provided arguments: $ARGUMENTS
If the first argument is commit:
git subagent to commit any uncommitted changes with an appropriate messageIf the first argument is not commit:
Generate a UUID v4 and output it clearly to the conversation on its own line:
SESSION_MARKER: <generated-uuid>
This marker will be captured in the transcript file for the subagent to locate.
Implementation: Use Bash to generate the UUID:
uuidgen # On macOS/Linux
Or if uuidgen is not available:
cat /proc/sys/kernel/random/uuid # On Linux
Or use Node.js:
node -e "console.log(require('crypto').randomUUID())"
Choose the method most likely to work cross-platform, and output the UUID clearly.
Use the Task tool to invoke the session-summarizer:compact-summarizer subagent with the following prompt structure:
Summarize the current session using session marker: <UUID>
[If additional instructions were provided, include them here]
Important: Pass the UUID clearly so the agent can locate the correct transcript file. The agent is namespaced as session-summarizer:compact-summarizer.
The agent will:
.claude/session-summary.mdOnce the agent completes, confirm to the user:
Session summary created successfully at .claude/session-summary.md
You can now:
- Start a new Claude Code session to reset context window
- Run /restart in the new session to continue where you left off
- Review the summary at .claude/session-summary.md
[If archived: - Access archived summary at .claude/summaries/<timestamp>-summary.md]
If the agent reports that it cannot find the transcript file with the UUID:
/restart command in a new session will read this summary to continue seamlessly