Claude Code 兼容的持久记忆:每个会话开始时自动注入 MEMORY.md 索引,模型用普通 read/write/edit 文件工具维护记忆,Settings 内置记忆列表页。落盘格式与 Claude Code 完全一致,claude 模式直接共享同一记忆目录。
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-cc-auto-memory
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:jayhchen/dsh-cc-auto-memory
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
dsh-cc-auto-memory
把 Claude Code 的 auto memory 机制原样带到 DeepSeek Harness(DSH)的轻量级记忆插件:纯文件的持久化记忆。
每个会话开始时会自动注入使用说明和 MEMORY.md 索引,模型直接用普通的 read / write / edit 文件工具管理记忆文件,不注册任何专用 memory 工具。落盘格式与 Claude Code 完全一致,两边记忆可直接互通(claude 模式甚至直接共享同一个记忆目录)。
安装
Web 端(命令行):
dsh plugin --profile web add dsh-cc-auto-memory
桌面版:打开应用内 Plugins(插件) 页,搜索 dsh-cc-auto-memory 安装。
机制
机制上是对 Claude Code 原生 auto memory 的忠实移植,原始机制可参考官方文档。每个会话的运作流程:
session start
│
▼
host injects into the system prompt:
• Memory usage instructions (with the memory dir path)
• MEMORY.md index — first 200 lines / 25 KB
│
│ the model manages memory with the
▼ plain read / write / edit tools
memory dir — one per git repo
MEMORY.md ← index: one line per memory
<topic>.md ← one memory per file
│
│ after each write/edit, the host backstops:
▼ `modified` timestamp · index size limits
next session recalls the refreshed index … loop
- 子代理(subagent)会话不注入主会话记忆(与 Claude Code 一致)。
- 项目定位:git 仓库根目录(仓库外用 cwd),路径中
/替换为-作为 slug,同一仓库共享一份记忆。
查看面板
Settings → Auto Memory(只读查看,编辑/新建/删除交给会话中的 Agent 用文件工具完成):
存储模式:两张模式卡片(dsh 独立目录 / claude 复用)+「应用切换」按钮,切换只对新会话生效:
dsh(默认):$DSH_HOME/projects/<slug>/memory/claude:~/.claude/projects/<slug>/memory/(尊重CLAUDE_CONFIG_DIR),与 Claude Code 共享同一份记忆,双向互通
claude 模式下,模型通过 write/edit 写
~/.claude/位于会话工作区之外,会按会话沙箱策略触发审批,属预期行为。项目列表按当前模式过滤:dsh 模式只显示
$DSH_HOME下的项目,claude 模式只显示~/.claude下的项目记忆表格:点击任意行弹出悬浮卡片展示文件原文(纯文本,不渲染 Markdown),Esc 或点击遮罩关闭
配置
cordis.patch.yml 用户层可覆盖:
| 字段 | 默认 | 说明 |
|---|---|---|
mode |
dsh |
存储模式 dsh / claude |
claudeConfigDir |
'' |
claude 模式的 CC 配置根;空 = $CLAUDE_CONFIG_DIR 或 ~/.claude |
maxIndexLines |
200 |
MEMORY.md 读取行数上限 |
maxIndexBytes |
25600 |
MEMORY.md 读取字节上限 |
许可
链接
同类插件
vectorize-io/hindsight#coding-agents★ 57722
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
volcengine/OpenViking#examples/dsh-memory-plugin★ 41317
面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
MemTensor/MemOS#memos-local-plugin★ 12224
DeepSeek Harness 本地记忆插件:分层 L1/L2/L3 记忆,自动沉淀与手动 memos_* 检索工具并存,内置记忆浏览器。
agentscope-ai/ReMe#dsh★ 3735
将 DeepSeek Harness 接入 ReMe 本地优先、自进化的个人知识库:自动把已完成的主 Agent 对话沉淀为用户掌控的 Markdown 记忆,通过 reme_search 结合 BM25、可选向量检索和 wikilink 展开搜索对话与资料,并按日整理长期记忆。
zilliztech/memsearch#MemSearch★ 2815
供 DSH 与其他编程 Agent 共享的 Markdown 记忆,支持自动捕获、步骤前上下文注入、搜索召回,以及通过审阅面板实现 memory-to-skill 自进化。
vshulcz/deja-vu#extensions/dsh★ 1352
读取本机上其他四十二个编程智能体已经写下的会话文件(Claude Code、Codex、Cursor、VS Code Copilot Chat、opencode、OpenClaw、Hermes、Kimi、Cline、Zed 等),包括安装之前的历史:提供 deja_recall、deja_session、deja_blame、deja_fix、deja_how、deja_remember 六个工具与 /deja 命令,并可选地把召回结果加入运行时上下文。本地 BM25 索引,不用大模型,不用向量嵌入,不联网(dsh plugin --profile web add dsh-deja)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。