From 9ac8d655400639321fae132ffc19a36012335248 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Thu, 19 Feb 2026 16:09:55 -0600 Subject: [PATCH] store: /save-memories command + memory-saver agent for session memory capture --- ...y-saver-agent-for-session-memory-b159c0.md | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 graph/workflows/save-memories-command-memory-saver-agent-for-session-memory-b159c0.md diff --git a/graph/workflows/save-memories-command-memory-saver-agent-for-session-memory-b159c0.md b/graph/workflows/save-memories-command-memory-saver-agent-for-session-memory-b159c0.md new file mode 100644 index 00000000000..a457ae14ac6 --- /dev/null +++ b/graph/workflows/save-memories-command-memory-saver-agent-for-session-memory-b159c0.md @@ -0,0 +1,44 @@ +--- +id: b159c0de-2e5e-4baa-a29b-0ab98f35cdbc +type: workflow +title: "/save-memories command + memory-saver agent for session memory capture" +tags: [cognitive-memory, claude-code, commands, agents, workflow] +importance: 0.7 +confidence: 0.8 +created: "2026-02-19T22:09:55.179468+00:00" +updated: "2026-02-19T22:09:55.179468+00:00" +--- + +Created a two-part system for saving session learnings to cognitive memory. + +## Components + +**Command** (`~/.claude/commands/save-memories.md`): +- Runs inline with full conversation context +- Finds cutoff point (last memory_store call) to avoid duplicates +- Analyzes conversation after cutoff point +- Builds structured summary with all session items +- Spawns memory-saver agent in background via Skill tool + +**Agent** (`~/.claude/agents/memory-saver.md`): +- Runs on haiku model +- Receives structured summary as prompt +- Stores each item via MCP tools (with CLI fallback) +- Handles mechanical storage work + +## Workflow + +1. User calls `/save-memories` at session end +2. Command analyzes full conversation context +3. Command creates structured summary of learnings +4. Command spawns agent in background with Task tool and `run_in_background=true` +5. User gets control back immediately +6. Agent processes items asynchronously + +## Advantages + +- Replaces manual end-of-session memory saving +- Command handles context-dependent analysis +- Agent handles time-consuming storage operations +- Clean separation of concerns (context vs. mechanics) +- User not blocked waiting for storage to complete