claudemem

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

claudemem — Your Persistent Memory

claudemem — 你的持久化记忆

Memory that carries across conversations. Automatically captures important knowledge during work and saves structured session summaries when you're done. Searches past context before new tasks.
可跨会话留存的记忆。在工作过程中自动捕捉重要知识,并在会话结束后保存结构化的会话摘要。开始新任务前会搜索过往上下文。

Slash Commands

斜杠命令

  • /wrap-up — End-of-session save: extracts ALL important knowledge + saves session summary in one step. Deduplicates automatically.
  • /save-session — Save only the session summary (without extracting notes)
  • /recall [topic] — Search persistent memory for a topic, or show recent activity
  • /wrap-up — 会话结束时一键保存:提取所有重要知识 + 保存会话摘要,自动去重。
  • /save-session — 仅保存会话摘要(不提取知识点)
  • /recall [主题] — 在持久化记忆中搜索指定主题,或查看近期活动

Natural Trigger Phrases

自然触发指令

These natural phrases also activate memory operations:
To save knowledge:
  • "remember this" / "save this" / "note this down" / "keep this in mind"
To search memory:
  • "what do you remember about..." / "do you recall..." / "what do we know about..."
To wrap up (save everything):
  • "wrap up" / "let's wrap up" / "save everything" — triggers /wrap-up (notes + session)
  • "save this session" / "summarize what we did" — triggers /save-session (session only)
To recall past work:
  • "what did we do last time" / "show me recent sessions" / "what happened with [topic]"
以下自然表述也可触发记忆操作:
保存知识:
  • "记住这个" / "保存这个" / "记下来" / "别忘了这个"
搜索记忆:
  • "你还记得关于……的内容吗" / "你有没有印象……" / "我们对……了解多少"
收尾保存(全部内容):
  • "收尾" / "我们收尾吧" / "保存所有内容" — 触发 /wrap-up(知识点 + 会话)
  • "保存本次会话" / "总结我们做了什么" — 触发 /save-session(仅会话)
回顾过往工作:
  • "上次我们做了什么" / "展示近期会话" / "[主题]相关的进展如何"

Setup

安装配置

Before first use, verify the CLI is installed. If
claudemem
is not found on PATH, install it:
bash
curl -fsSL https://raw.githubusercontent.com/zelinewang/claudemem/main/skills/claudemem/scripts/install.sh | bash
Or run the bundled installer:
bash
bash "SKILL_DIR/scripts/install.sh"
After installation, verify with
claudemem --version
.
首次使用前,请确认已安装 CLI。如果 PATH 中找不到
claudemem
,请执行以下命令安装:
bash
curl -fsSL https://raw.githubusercontent.com/zelinewang/claudemem/main/skills/claudemem/scripts/install.sh | bash
或运行捆绑的安装脚本:
bash
bash "SKILL_DIR/scripts/install.sh"
安装完成后,可通过
claudemem --version
验证是否成功。

Commands

命令列表

bash
undefined
bash
undefined

Notes (knowledge fragments)

知识点(知识片段)

claudemem note add <category> --title "..." --content "..." --tags "tag1,tag2" claudemem note search "query" [--in category] [--tag tags] claudemem note list [category] claudemem note get <id> claudemem note update <id> --content "..." [--title "..."] [--tags "..."] claudemem note append <id> "additional content" claudemem note delete <id> claudemem note categories claudemem note tags
claudemem note add <category> --title "..." --content "..." --tags "tag1,tag2" claudemem note search "query" [--in category] [--tag tags] claudemem note list [category] claudemem note get <id> claudemem note update <id> --content "..." [--title "..."] [--tags "..."] claudemem note append <id> "additional content" claudemem note delete <id> claudemem note categories claudemem note tags

Sessions (conversation summaries)

会话(会话摘要)

claudemem session save --title "..." --branch "..." --project "..." --session-id "..." --content "..." claudemem session list [--last N] [--date today] [--date-range 7d] [--branch X] claudemem session search "query" [--branch X] claudemem session get <id>
claudemem session save --title "..." --branch "..." --project "..." --session-id "..." --content "..." claudemem session list [--last N] [--date today] [--date-range 7d] [--branch X] claudemem session search "query" [--branch X] claudemem session get <id>

Unified search (across notes AND sessions)

统一搜索(跨知识点和会话)

claudemem search "query" [--type note|session] [--limit N]
claudemem search "query" [--type note|session] [--limit N]

Statistics

统计信息

claudemem stats
claudemem stats

Configuration

配置管理

claudemem config set/get/list/delete <key> [value]
claudemem config set/get/list/delete <key> [value]

Data portability

数据迁移

claudemem export [output-file] # Backup as tar.gz claudemem import <archive-file> # Restore from backup (auto-reindexes)
claudemem export [output-file] # 备份为 tar.gz 格式 claudemem import <archive-file> # 从备份恢复(自动重建索引)

Data integrity

数据完整性

claudemem verify # Check DB-file consistency claudemem repair # Fix orphaned entries

Add `--format json` to any command for structured output.
claudemem verify # 检查数据库文件一致性 claudemem repair # 修复孤立条目

在任意命令后添加 `--format json` 可获取结构化输出。

Autonomous Behavior

自动行为

Recommended: Auto Wrap-Up Before Session Ends

推荐配置:会话结束前自动收尾

If the user has enabled auto wrap-up in their CLAUDE.md, automatically execute /wrap-up before the conversation ends:
  1. Extract unsaved knowledge fragments → save as notes (with dedup)
  2. Generate session summary → save as session
  3. Show brief report of what was saved
如果用户已在 CLAUDE.md 中启用自动收尾功能,会在会话结束前自动执行 /wrap-up 操作:
  1. 提取未保存的知识片段 → 保存为知识点(自动去重)
  2. 生成会话摘要 → 保存为会话记录
  3. 展示已保存内容的简要报告

Auto-Save Notes (Silent + Brief Indicator)

自动保存知识点(静默 + 简短提示)

Automatically capture knowledge without asking during normal conversation. After saving, add a brief indicator at the end of your response so the user knows what was captured:
[📝 Saved: "TikTok Rate Limits" → api-specs]
What to auto-save (proactive, no user prompt needed):
  • API specs, field mappings, rate limits, endpoint details
  • Technical decisions with rationale (why X over Y)
  • Integration quirks, gotchas, workarounds
  • Resolved bugs and their root causes
  • Configuration requirements and defaults
  • User preferences and project conventions
  • Important URLs, endpoints, environment configs
How to auto-save gracefully:
  1. Identify the knowledge fragment during your normal response
  2. Choose an appropriate category (create new if none fits)
  3. Before saving, quickly search to avoid duplicates:
    claudemem note search "keyword" --format json
  4. If related note exists:
    claudemem note append <id> "new info"
    instead of creating duplicate
  5. Save:
    claudemem note add <category> --title "..." --content "..." --tags "..."
  6. Show the indicator:
    [📝 Saved: "<title>" → <category>]
Do NOT auto-save:
  • Temporary debugging output or transient state
  • File paths or code snippets without context
  • General programming knowledge available in docs
  • Information the user is likely to change immediately
在正常会话过程中自动捕捉知识无需询问用户。保存完成后,在回复末尾添加简短提示,让用户知晓已捕捉内容:
[📝 已保存:"TikTok 速率限制" → api-specs]
自动保存的内容(主动捕捉,无需用户指令):
  • API 规格、字段映射、速率限制、端点细节
  • 带有决策依据的技术选型
  • 集成注意事项、常见问题、解决方案
  • 已修复的 bug 及其根本原因
  • 配置要求与默认值
  • 用户偏好与项目约定
  • 重要的 URL、端点、环境配置
优雅自动保存的步骤:
  1. 在正常回复过程中识别知识片段
  2. 选择合适的分类(若没有匹配分类则新建)
  3. 保存前快速搜索避免重复:
    claudemem note search "keyword" --format json
  4. 若存在相关知识点:使用
    claudemem note append <id> "new info"
    而非创建重复条目
  5. 保存:
    claudemem note add <category> --title "..." --content "..." --tags "..."
  6. 显示提示:
    [📝 已保存:"<标题>" → <分类>]
请勿自动保存:
  • 临时调试输出或瞬时状态
  • 无上下文的文件路径或代码片段
  • 文档中可查的通用编程知识
  • 用户可能立即修改的信息

Auto-Search Before Tasks (Silent)

任务前自动搜索(静默)

Search memory at the start of tasks that might benefit from prior context:
  • Before implementing a feature in a domain previously discussed
  • When working with an API or system previously documented
  • Before making architectural decisions
Search silently. If relevant results found, mention them briefly:
[🔍 Found related memory: "TikTok Rate Limits" — rate limit is 100/min]
在开始可能受益于过往上下文的任务前,自动搜索记忆:
  • 在之前讨论过的领域中实现功能时
  • 处理之前记录过的 API 或系统时
  • 做出架构决策前
静默执行搜索。如果找到相关结果,简要提及:
[🔍 找到相关记忆:"TikTok 速率限制" — 限制为 100次/分钟]

Save Sessions (On Request via /save-session or Natural Phrase)

保存会话(需用户通过 /save-session 或自然指令触发)

Session summaries are saved when the user explicitly asks — via
/save-session
command or natural phrases like "save this session" or "wrap up". Do NOT auto-save sessions without the user's request, as they may want to continue the conversation.
仅当用户明确要求时才保存会话摘要 — 通过
/save-session
命令或「保存本次会话」「收尾」等自然表述。请勿在未征得用户同意的情况下自动保存会话,因为用户可能希望继续当前对话。

Workflow Rules

工作流规则

  1. Before saving: search existing content first — update or append if related note exists
  2. Before working: search for relevant context that may inform the current task
  3. Merge related information under existing categories/titles when possible
  4. Preserve existing content unless contradicted by new information
  5. Focus on evergreen knowledge, not transient conversation artifacts
  1. 保存前:先搜索现有内容 — 若存在相关知识点则更新或追加
  2. 工作前:搜索可能影响当前任务的相关上下文
  3. 尽可能将相关信息合并到现有分类/标题下
  4. 保留现有内容,除非新信息与之矛盾
  5. 聚焦长效知识,而非瞬时的对话产物

Session Summary Template

会话摘要模板

When saving a session, generate content following this structure:
markdown
undefined
保存会话时,请按照以下结构生成内容:
markdown
undefined

Summary

摘要

One or two paragraphs describing what was accomplished.
用1-2段文字描述已完成的工作。

Key Decisions

关键决策

  • Decision 1 with rationale
  • Decision 2 with rationale
  • 决策1及依据
  • 决策2及依据

What Changed

变更内容

  • path/to/file.py
    — Description of change
  • path/to/file.py
    — 变更描述

Problems & Solutions

问题与解决方案

  • Problem: Description of issue Solution: How it was resolved
  • 问题:问题描述 解决方案:解决方式

Questions Raised

提出的问题

  • Open question needing future attention
  • 需要后续关注的未解决问题

Next Steps

下一步计划

  • First follow-up task
undefined
  • 第一项跟进任务
undefined

What NOT to Capture

请勿捕捉的内容

  • Temporary debugging sessions or transient state
  • File paths or code snippets without context
  • General programming knowledge available in docs
  • Meta-commentary about the conversation itself
  • Information that changes frequently without lasting value
  • 临时调试会话或瞬时状态
  • 无上下文的文件路径或代码片段
  • 文档中可查的通用编程知识
  • 关于对话本身的元评论
  • 频繁变化且无长期价值的信息

Data Portability

数据迁移

All data stored at
~/.claudemem/
as plain Markdown files with YAML frontmatter. SQLite FTS5 index is a rebuildable cache — only the Markdown files matter.
Backup:
claudemem export backup.tar.gz
Restore:
claudemem import backup.tar.gz
(auto-rebuilds search index)
所有数据存储在
~/.claudemem/
目录下,为带有 YAML 前置元数据的纯 Markdown 文件。SQLite FTS5 索引是可重建的缓存 — 仅 Markdown 文件为核心数据。
备份
claudemem export backup.tar.gz
恢复
claudemem import backup.tar.gz
(自动重建搜索索引)

Storage

存储说明

~/.claudemem/
— Plain text Markdown files organized by type (notes/ and sessions/). FTS5 SQLite index for sub-10ms full-text search. File permissions: 0600/0700.
~/.claudemem/
— 按类型(notes/ 和 sessions/)组织的纯文本 Markdown 文件。使用 FTS5 SQLite 索引实现亚毫秒级全文搜索。文件权限:0600/0700。