remember
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/si:remember — Save Knowledge Explicitly
/si:remember — 显式保存知识
Writes an explicit entry to auto-memory when something is important enough that you don't want to rely on Claude noticing it automatically.
当某些内容非常重要,你不想依赖Claude自动识别时,可使用此命令向自动记忆中写入显式条目。
Usage
使用方法
/si:remember <what to remember>
/si:remember "This project's CI requires Node 20 LTS — v22 breaks the build"
/si:remember "The /api/auth endpoint uses a custom JWT library, not passport"
/si:remember "Reza prefers explicit error handling over try-catch-all patterns"/si:remember <需要记忆的内容>
/si:remember "此项目的CI要求使用Node 20 LTS — v22版本会导致构建失败"
/si:remember "/api/auth端点使用自定义JWT库,而非passport"
/si:remember "Reza更倾向于显式错误处理,而非全量try-catch模式"When to Use
适用场景
| Situation | Example |
|---|---|
| Hard-won debugging insight | "CORS errors on /api/upload are caused by the CDN, not the backend" |
| Project convention not in CLAUDE.md | "We use barrel exports in src/components/" |
| Tool-specific gotcha | "Jest needs |
| Architecture decision | "We chose Drizzle over Prisma for type-safe SQL" |
| Preference you want Claude to learn | "Don't add comments explaining obvious code" |
| 场景 | 示例 |
|---|---|
| 来之不易的调试心得 | "/api/upload接口的CORS错误由CDN导致,而非后端" |
| 未记录在CLAUDE.md中的项目约定 | "我们在src/components/目录中使用桶式导出(barrel exports)" |
| 工具特定的注意事项 | "Jest需要添加 |
| 架构决策 | "为了类型安全的SQL操作,我们选择Drizzle而非Prisma" |
| 希望Claude遵循的偏好 | "不要为显而易见的代码添加注释" |
Workflow
工作流程
Step 1: Parse the knowledge
步骤1:解析知识
Extract from the user's input:
- What: The concrete fact or pattern
- Why it matters: Context (if provided)
- Scope: Project-specific or global?
从用户输入中提取:
- 内容:具体事实或模式
- 重要性:上下文(若提供)
- 范围:项目专属还是全局通用?
Step 2: Check for duplicates
步骤2:检查重复项
bash
MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -ni "<keywords>" "$MEMORY_DIR/MEMORY.md" 2>/dev/nullIf a similar entry exists:
- Show it to the user
- Ask: "Update the existing entry or add a new one?"
bash
MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -ni "<keywords>" "$MEMORY_DIR/MEMORY.md" 2>/dev/null若存在类似条目:
- 向用户展示该条目
- 询问:"更新现有条目还是添加新条目?"
Step 3: Write to MEMORY.md
步骤3:写入MEMORY.md
Append to the end of :
MEMORY.mdmarkdown
- {{concise fact or pattern}}Keep entries concise — one line when possible. Auto-memory entries don't need timestamps, IDs, or metadata. They're notes, not database records.
If MEMORY.md is over 180 lines, warn the user:
⚠️ MEMORY.md is at {{n}}/200 lines. Consider running /si:review to free space.在末尾追加内容:
MEMORY.mdmarkdown
- {{简洁的事实或模式}}保持条目简洁——尽可能用一行表述。自动记忆条目无需时间戳、ID或元数据,它们是笔记而非数据库记录。
若MEMORY.md超过180行,向用户发出警告:
⚠️ MEMORY.md 当前行数为{{n}}/200。建议运行/si:review来释放空间。Step 4: Suggest promotion
步骤4:建议升级为规则
If the knowledge sounds like a rule (imperative, always/never, convention):
💡 This sounds like it could be a CLAUDE.md rule rather than a memory entry.
Rules are enforced with higher priority. Want to /si:promote it instead?若该知识听起来像是一条规则(命令式、总是/从不、约定):
💡 这听起来更适合作为CLAUDE.md中的规则,而非记忆条目。
规则的优先级更高。是否要改用/si:promote命令将其升级为规则?Step 5: Confirm
步骤5:确认保存
✅ Saved to auto-memory
"{{entry}}"
MEMORY.md: {{n}}/200 lines
Claude will see this at the start of every session in this project.✅ 已保存到自动记忆
"{{条目内容}}"
MEMORY.md: {{n}}/200行
Claude在该项目的每个会话开始时都会读取此内容。What NOT to use /si:remember for
/si:remember的不适用场景
- Temporary context: Use session memory or just tell Claude in conversation
- Enforced rules: Use to write directly to CLAUDE.md
/si:promote - Cross-project knowledge: Use for global rules
~/.claude/CLAUDE.md - Sensitive data: Never store credentials, tokens, or secrets in memory files
- 临时上下文:使用会话记忆或直接在对话中告知Claude即可
- 强制执行的规则:使用命令直接写入CLAUDE.md
/si:promote - 跨项目知识:全局规则请写入
~/.claude/CLAUDE.md - 敏感数据:切勿在记忆文件中存储凭证、令牌或机密信息
Tips
小贴士
- Be concise — one line beats a paragraph
- Include the concrete command or value, not just the concept
- ✅ "Build with , tests with
pnpm build"pnpm test:e2e - ❌ "The project uses pnpm for building and testing"
- ✅ "Build with
- If you're remembering the same thing twice, promote it to CLAUDE.md
- 保持简洁——一行内容胜过一段文字
- 包含具体命令或值,而非仅概念
- ✅ "使用构建,使用
pnpm build运行测试"pnpm test:e2e - ❌ "该项目使用pnpm进行构建和测试"
- ✅ "使用
- 若你需要重复记忆同一件事,将其升级为CLAUDE.md中的规则