返回 Skill 列表
extension
分类: AI Agent 能力无需 API Key

memory-save

当在hook输出中看到“[MEMORY_KEEPER]”时执行。严格按照编号步骤保存会话内存。

person作者: jakexiaohubgithub

Script Path Resolution

IMPORTANT: The scripts/ folder is in the plugin directory, NOT the current project.

From "Base directory for this skill:" above, derive the scripts path:

  • Remove /skills/memory-save from the end
  • Add /scripts/ to get the scripts directory

Example:

  • Base: ~/.claude/plugins/cache/memory-keeper-marketplace/memory-keeper/13.8.3/skills/memory-save
  • Scripts: ~/.claude/plugins/cache/memory-keeper-marketplace/memory-keeper/13.8.3/scripts/

Use this full path when running node commands below.

Memory Save Skill (v13.1.0)

This skill activates when [MEMORY_KEEPER] appears in conversation.

Memory Structure

.claude/memory/
  project.md        <- Project overview (stable)
  architecture.md   <- Architecture decisions (stable)
  conventions.md    <- Coding conventions (stable)
  memory.md         <- Rolling session log (last 50 lines loaded)
  sessions/         <- L1 session transcripts (auto-generated)
  logs/             <- Debug and error logs

Trigger Message

═══════════════════════════════════════════════════════════════
[MEMORY_KEEPER] AUTO-SAVE TRIGGERED - N tool uses reached
═══════════════════════════════════════════════════════════════

Required Actions

Step 1: Save to memory.md

printf '\n## %s\n%s\n' "$(date +%Y-%m-%d_%H%M)" "[1-2 sentence summary]" >> ".claude/memory/memory.md"

Session End (Stop Hook)

Additional step (use full path from above):

node "{SCRIPTS_PATH}/counter.js" compress

Optional: Update Hierarchical Memory

If major project understanding changed, update stable memory files (use full path):

node "{SCRIPTS_PATH}/counter.js" memory-set project "Updated project description..."
node "{SCRIPTS_PATH}/counter.js" memory-set architecture "Updated architecture..."
node "{SCRIPTS_PATH}/counter.js" memory-set conventions "Updated conventions..."

When to update:

  • project.md: New project scope, goals, or tech stack
  • architecture.md: New architecture decisions or patterns
  • conventions.md: New coding standards or workflows

View current memory:

node "{SCRIPTS_PATH}/counter.js" memory-list
node "{SCRIPTS_PATH}/counter.js" memory-get project

Critical

  • DO NOT SKIP the memory.md append step
  • Counter resets automatically (no manual reset needed)

See Architecture for full details.