save-thread
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSave Thread
保存会话线程
Persist complete coding sessions to your personal knowledge base for future reference.
将完整的编码会话持久化到你的个人知识库,以便未来查阅。
When to Use
使用时机
Only activate when user explicitly says:
- "Save this session"
- "Checkpoint this"
- "Record conversation"
- "Remember this session"
Never auto-save or suggest saving. This is always user-initiated.
仅在用户明确说出以下内容时激活:
- "Save this session"
- "Checkpoint this"
- "Record conversation"
- "Remember this session"
切勿自动保存或建议保存。此操作始终由用户主动发起。
Prerequisites
前置条件
nmem CLI - Choose one option:
Option 1: uvx (Recommended)
bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx --from nmem-cli nmem --versionOption 2: pip
bash
pip install nmem-cli
nmem --versionEnsure Nowledge Mem server is running at
http://localhost:14242nmem CLI - 选择以下任一选项:
选项1:uvx(推荐)
bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx --from nmem-cli nmem --version选项2:pip
bash
pip install nmem-cli
nmem --version确保Nowledge Mem服务器运行在
http://localhost:14242Usage
使用方法
Use to automatically import the current coding session:
nmem t savebash
undefined使用命令自动导入当前编码会话:
nmem t savebash
undefinedSave current session for current project
保存当前项目的当前会话
nmem t save --from claude-code
nmem t save --from claude-code
Save with custom summary (recommended)
带自定义摘要的保存(推荐)
nmem t save --from claude-code -s "Brief summary of what was accomplished"
nmem t save --from claude-code -s "简要说明完成的内容"
Save all sessions for current project
保存当前项目的所有会话
nmem t save --from claude-code -m all
nmem t save --from claude-code -m all
Save for specific project path
保存指定项目路径的会话
nmem t save --from claude-code -p /path/to/project
undefinednmem t save --from claude-code -p /path/to/project
undefinedAvailable Options
可用选项
| Flag | Description | Example |
|---|---|---|
| Source app | |
| Brief summary | |
| | |
| Project path | |
| Truncate large results | |
| 标志 | 描述 | 示例 |
|---|---|---|
| 来源应用 | |
| 简短摘要 | |
| | |
| 项目路径 | |
| 截断大结果 | |
Behavior
行为说明
- Auto-detects sessions from
~/.claude/projects/ - Idempotent: Re-running appends only new messages
- Thread ID: Auto-generated as
claude-code-{session_id}
- 自动检测会话:从路径检测会话
~/.claude/projects/ - 幂等性:重新运行仅追加新消息
- 线程ID:自动生成为
claude-code-{session_id}
Thread vs Memory
线程 vs 记忆
| Thread | Memory |
|---|---|
| Full conversation history | Distilled insights |
| Complete context | Atomic, searchable facts |
| Session checkpoint | Actionable knowledge |
Both serve different purposes - you can save a thread AND distill key memories.
| 线程 | 记忆 |
|---|---|
| 完整对话历史 | 提炼的洞察内容 |
| 完整上下文 | 原子化、可搜索的事实 |
| 会话检查点 | 可执行的知识 |
两者用途不同 - 你可以同时保存线程并提炼关键记忆。
Response Format
响应格式
After successful save:
✓ Thread saved
Summary: {summary}
Messages: {count}
Thread ID: claude-code-{session_id}保存成功后:
✓ 线程已保存
摘要: {summary}
消息数: {count}
线程ID: claude-code-{session_id}Examples
示例
bash
undefinedbash
undefinedBasic save
基础保存
nmem t save --from claude-code
nmem t save --from claude-code
Save with descriptive summary
带描述性摘要的保存
nmem t save --from claude-code -s "Implemented JWT authentication with refresh tokens"
nmem t save --from claude-code -s "实现了带刷新令牌的JWT认证"
Save all sessions
保存所有会话
nmem t save --from claude-code -m all
nmem t save --from claude-code -m all
Save specific project
保存指定项目
nmem t save --from claude-code -p ~/projects/my-app -s "API refactoring complete"
undefinednmem t save --from claude-code -p ~/projects/my-app -s "API重构完成"
undefined