save-thread

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Save 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 --version
Option 2: pip
bash
pip install nmem-cli
nmem --version
Ensure Nowledge Mem server is running at
http://localhost:14242
nmem 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:14242

Usage

使用方法

Use
nmem t save
to automatically import the current coding session:
bash
undefined
使用
nmem t save
命令自动导入当前编码会话:
bash
undefined

Save 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
undefined
nmem t save --from claude-code -p /path/to/project
undefined

Available Options

可用选项

FlagDescriptionExample
--from
Source app
--from claude-code
-s, --summary
Brief summary
-s "Fixed auth bug"
-m, --mode
current
or
all
-m all
-p, --project
Project path
-p /path/to/project
--truncate
Truncate large results
--truncate
标志描述示例
--from
来源应用
--from claude-code
-s, --summary
简短摘要
-s "Fixed auth bug"
-m, --mode
current
(当前)或
all
(全部)
-m all
-p, --project
项目路径
-p /path/to/project
--truncate
截断大结果
--truncate

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 记忆

ThreadMemory
Full conversation historyDistilled insights
Complete contextAtomic, searchable facts
Session checkpointActionable 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
undefined
bash
undefined

Basic 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"
undefined
nmem t save --from claude-code -p ~/projects/my-app -s "API重构完成"
undefined

Links

链接