Refine /save-memories: silent output, trivial-work gate, sonnet model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
43241ea612
commit
92545d40de
File diff suppressed because it is too large
Load Diff
@ -2188,8 +2188,8 @@
|
||||
"lastUsedAt": 1770959377885
|
||||
},
|
||||
"sync-config": {
|
||||
"usageCount": 21,
|
||||
"lastUsedAt": 1771538525059
|
||||
"usageCount": 23,
|
||||
"lastUsedAt": 1771539236539
|
||||
},
|
||||
"claude-optimised": {
|
||||
"usageCount": 4,
|
||||
@ -2236,8 +2236,8 @@
|
||||
"lastUsedAt": 1771536951910
|
||||
},
|
||||
"save-memories": {
|
||||
"usageCount": 1,
|
||||
"lastUsedAt": 1771538857095
|
||||
"usageCount": 2,
|
||||
"lastUsedAt": 1771539259563
|
||||
}
|
||||
},
|
||||
"opusProMigrationComplete": true,
|
||||
@ -2246,7 +2246,7 @@
|
||||
"passesLastSeenRemaining": 3,
|
||||
"clientDataCache": {
|
||||
"data": {},
|
||||
"timestamp": 1771539216265
|
||||
"timestamp": 1771539259669
|
||||
},
|
||||
"hasShownOpus46Notice": {
|
||||
"57783733-6e1e-48d5-9cb7-fa588a77b795": true
|
||||
@ -2188,8 +2188,8 @@
|
||||
"lastUsedAt": 1770959377885
|
||||
},
|
||||
"sync-config": {
|
||||
"usageCount": 21,
|
||||
"lastUsedAt": 1771538525059
|
||||
"usageCount": 23,
|
||||
"lastUsedAt": 1771539236539
|
||||
},
|
||||
"claude-optimised": {
|
||||
"usageCount": 4,
|
||||
@ -2236,8 +2236,8 @@
|
||||
"lastUsedAt": 1771536951910
|
||||
},
|
||||
"save-memories": {
|
||||
"usageCount": 1,
|
||||
"lastUsedAt": 1771538857095
|
||||
"usageCount": 3,
|
||||
"lastUsedAt": 1771539341903
|
||||
}
|
||||
},
|
||||
"opusProMigrationComplete": true,
|
||||
@ -2246,7 +2246,7 @@
|
||||
"passesLastSeenRemaining": 3,
|
||||
"clientDataCache": {
|
||||
"data": {},
|
||||
"timestamp": 1771539001655
|
||||
"timestamp": 1771539342029
|
||||
},
|
||||
"hasShownOpus46Notice": {
|
||||
"57783733-6e1e-48d5-9cb7-fa588a77b795": true
|
||||
@ -44,7 +44,7 @@
|
||||
"agent-flag": 652
|
||||
},
|
||||
"memoryUsageCount": 18,
|
||||
"promptQueueUseCount": 4513,
|
||||
"promptQueueUseCount": 4515,
|
||||
"cachedStatsigGates": {
|
||||
"tengu_disable_bypass_permissions_mode": false,
|
||||
"tengu_use_file_checkpoints": true,
|
||||
@ -2188,8 +2188,8 @@
|
||||
"lastUsedAt": 1770959377885
|
||||
},
|
||||
"sync-config": {
|
||||
"usageCount": 21,
|
||||
"lastUsedAt": 1771538525059
|
||||
"usageCount": 23,
|
||||
"lastUsedAt": 1771539236539
|
||||
},
|
||||
"claude-optimised": {
|
||||
"usageCount": 4,
|
||||
@ -2236,8 +2236,8 @@
|
||||
"lastUsedAt": 1771536951910
|
||||
},
|
||||
"save-memories": {
|
||||
"usageCount": 1,
|
||||
"lastUsedAt": 1771538857095
|
||||
"usageCount": 3,
|
||||
"lastUsedAt": 1771539341903
|
||||
}
|
||||
},
|
||||
"opusProMigrationComplete": true,
|
||||
@ -2246,7 +2246,7 @@
|
||||
"passesLastSeenRemaining": 3,
|
||||
"clientDataCache": {
|
||||
"data": {},
|
||||
"timestamp": 1771538857202
|
||||
"timestamp": 1771539410106
|
||||
},
|
||||
"hasShownOpus46Notice": {
|
||||
"57783733-6e1e-48d5-9cb7-fa588a77b795": true
|
||||
@ -44,7 +44,7 @@
|
||||
"agent-flag": 652
|
||||
},
|
||||
"memoryUsageCount": 18,
|
||||
"promptQueueUseCount": 4513,
|
||||
"promptQueueUseCount": 4515,
|
||||
"cachedStatsigGates": {
|
||||
"tengu_disable_bypass_permissions_mode": false,
|
||||
"tengu_use_file_checkpoints": true,
|
||||
@ -2188,8 +2188,8 @@
|
||||
"lastUsedAt": 1770959377885
|
||||
},
|
||||
"sync-config": {
|
||||
"usageCount": 21,
|
||||
"lastUsedAt": 1771538525059
|
||||
"usageCount": 23,
|
||||
"lastUsedAt": 1771539236539
|
||||
},
|
||||
"claude-optimised": {
|
||||
"usageCount": 4,
|
||||
@ -2236,8 +2236,8 @@
|
||||
"lastUsedAt": 1771536951910
|
||||
},
|
||||
"save-memories": {
|
||||
"usageCount": 1,
|
||||
"lastUsedAt": 1771538857095
|
||||
"usageCount": 3,
|
||||
"lastUsedAt": 1771539341903
|
||||
}
|
||||
},
|
||||
"opusProMigrationComplete": true,
|
||||
@ -2246,7 +2246,7 @@
|
||||
"passesLastSeenRemaining": 3,
|
||||
"clientDataCache": {
|
||||
"data": {},
|
||||
"timestamp": 1771538886396
|
||||
"timestamp": 1771539486281
|
||||
},
|
||||
"hasShownOpus46Notice": {
|
||||
"57783733-6e1e-48d5-9cb7-fa588a77b795": true
|
||||
2272
backups/.claude.json.backup.1771539730071
Normal file
2272
backups/.claude.json.backup.1771539730071
Normal file
File diff suppressed because it is too large
Load Diff
@ -3,65 +3,33 @@ allowed-tools: Task
|
||||
description: Save session learnings to cognitive memory
|
||||
---
|
||||
|
||||
Analyze the current conversation and create a structured session summary, then delegate memory storage to the memory-saver agent.
|
||||
**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)
|
||||
|
||||
## Step 1: Find the cutoff point
|
||||
## Process (do this silently)
|
||||
|
||||
Scan the conversation for the most recent `memory_store` MCP call or `claude-memory store` Bash call. If found, **only analyze the conversation AFTER that point** — everything before it has already been captured. If no prior memory storage is found, analyze the full conversation.
|
||||
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.
|
||||
|
||||
## Step 2: Analyze the session (after cutoff)
|
||||
2. **Analyze**: Identify storable items after the cutoff — solutions, decisions, fixes, configs, patterns, insights. Include project names, technical details, rationale, before/after data.
|
||||
|
||||
Review the conversation (from cutoff onward) and identify:
|
||||
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.
|
||||
|
||||
1. **Project(s)** worked on (e.g., "cognitive-memory", "paper-dynasty", "homelab")
|
||||
2. **Key accomplishments** — what was built, fixed, changed, or decided
|
||||
3. **Technical details** — specific files, functions, configs, or commands involved
|
||||
4. **Decisions made** — any architectural choices, tradeoffs evaluated, or conventions established
|
||||
5. **Problems solved** — bugs found, root causes identified, solutions implemented
|
||||
6. **Performance data** — any before/after measurements
|
||||
4. **Build summary**: Create a structured prompt for the agent:
|
||||
```
|
||||
PROJECT: <name(s)>
|
||||
ITEMS:
|
||||
1. [type] Title / Tags / Importance / Content
|
||||
2. ...
|
||||
```
|
||||
|
||||
## Step 3: Evaluate whether anything is worth storing
|
||||
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>")
|
||||
```
|
||||
|
||||
If the work after the cutoff is trivial (routine chat, simple questions answered, minor file reads with no actionable outcome), tell the user "Nothing new worth storing since the last save" and **stop — do not spawn the agent**.
|
||||
|
||||
Only proceed if there are concrete storable items: solutions, decisions, fixes, configs, patterns, or insights.
|
||||
|
||||
## Step 4: Build the summary
|
||||
|
||||
Write a structured summary using this format:
|
||||
|
||||
```
|
||||
PROJECT: <project name(s)>
|
||||
ALREADY_STORED: <brief list of memories stored during session, or "none">
|
||||
|
||||
ITEMS:
|
||||
1. [type: solution|decision|fix|configuration|code_pattern|workflow|insight]
|
||||
Title: <concise, searchable title>
|
||||
Tags: <comma-separated lowercase tags>
|
||||
Importance: <0.3-1.0>
|
||||
Content: <self-contained description with context, problem, solution, key details>
|
||||
|
||||
2. [type: ...]
|
||||
...
|
||||
```
|
||||
|
||||
## Step 5: Launch the memory-saver agent
|
||||
|
||||
Use the Task tool to spawn the `memory-saver` agent in the background with the summary as the prompt. Use sonnet model.
|
||||
|
||||
```
|
||||
Task(
|
||||
subagent_type="memory-saver",
|
||||
model="sonnet",
|
||||
run_in_background=true,
|
||||
description="Store session memories",
|
||||
prompt="<your structured summary here>"
|
||||
)
|
||||
```
|
||||
|
||||
## Step 6: Confirm
|
||||
|
||||
Tell the user how many memory items you identified and that the agent is saving them in the background.
|
||||
6. **Confirm**: Say "Saving N memories in the background."
|
||||
|
||||
## Guidelines
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user