From topic-switch
Save a session summary to memory and compact the conversation context
How this skill is triggered — by the user, by Claude, or both
Slash command
/topic-switch:save-and-compactThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are running the **save-and-compact** skill for the topic-switch plugin. Follow these steps exactly.
You are running the save-and-compact skill for the topic-switch plugin. Follow these steps exactly.
Review the full conversation history and write a concise summary with these sections:
Omit any section that has nothing meaningful to say. Keep the summary short — a future session should be able to scan it in 10 seconds.
Print the summary so they can review it before anything is saved:
Session summary:
## What we worked on
- <specific items>
## Key decisions
- <decisions and reasoning>
## Current state
- <status>
## Notes
- <gotchas, context>
Save this to memory and compact? (yes/no)
Then stop and wait for the user to respond. Do NOT proceed until the user confirms.
Determine the project memory path:
/ with - and strip the leading -.
For example: /Users/lei/dev/myproject becomes ~/.claude/projects/-Users-lei-dev-myproject/memory/session_YYYY-MM-DD_HHMM.md using the current date and time.Write the memory file with this exact format:
---
name: session-summary-YYYY-MM-DD
description: Session summary — <one-line description of what was done>
type: project
---
## What we worked on
- <items>
## Key decisions
- <items>
## Current state
- <items>
## Notes
- <items>
Then update the MEMORY.md file in the same directory — append a single line:
- [Session YYYY-MM-DD HH:MM](session_YYYY-MM-DD_HHMM.md) — <one-line description>
If MEMORY.md does not exist, create it with the line above.
Clear the topic-switch runtime state so the next topic starts fresh:
echo -n "<absolute-project-path>" | shasum -a 256 | cut -c1-16~/.cache/topic-switch/<project-hash>/:
signal.json to {}message_count to 0 in state.json (preserve other fields like current_topic)If the cache directory or files don't exist, skip this step silently.
Run /compact to compress the conversation context.
Print:
Context saved and compacted. Ready for the next topic.
If the user chose to skip saving, print instead:
Context compacted (summary not saved). Ready for the next topic.
npx claudepluginhub hi-lei/topic-switchCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.