41 lines
1.6 KiB
Markdown
41 lines
1.6 KiB
Markdown
---
|
|
allowed-tools: Task
|
|
description: Save session learnings to cognitive memory
|
|
---
|
|
|
|
**IMPORTANT: Do NOT narrate your steps. Do all analysis silently. Your only visible output should be ONE of:**
|
|
- "Nothing new worth storing since the last save."
|
|
- "Saving N memories in the background." (followed by launching the agent)
|
|
|
|
## Process (do this silently)
|
|
|
|
1. **Find cutoff**: Scan for the most recent `memory_store` MCP call or `claude-memory store` Bash call. Only analyze conversation AFTER that point. If none found, analyze everything.
|
|
|
|
2. **Analyze**: Identify storable items after the cutoff — solutions, decisions, fixes, configs, patterns, insights. Include project names, technical details, rationale, before/after data.
|
|
|
|
3. **Gate**: If nothing after the cutoff is worth a memory (routine chat, minor reads, trivial refinements), say "Nothing new worth storing since the last save." and stop.
|
|
|
|
4. **Build summary**: Create a structured prompt for the agent:
|
|
```
|
|
PROJECT: <name(s)>
|
|
ITEMS:
|
|
1. [type] Title / Tags / Importance / Content
|
|
2. ...
|
|
```
|
|
|
|
5. **Launch agent**: Spawn in background with sonnet model:
|
|
```
|
|
Task(subagent_type="memory-saver", model="sonnet", run_in_background=true,
|
|
description="Store session memories", prompt="<summary>")
|
|
```
|
|
|
|
6. **Confirm**: Say "Saving N memories in the background."
|
|
|
|
## Guidelines
|
|
|
|
- Be thorough — capture everything worth remembering
|
|
- Don't duplicate memories already stored during the session
|
|
- Each item should be self-contained and useful on its own
|
|
- 1-6 items per session is typical; more is fine for large sessions
|
|
- Prefer specific, searchable titles over vague ones
|