前言¶
DSH 的插件机制强调「一切皆插件」。对于已经使用 Claude Code 的开发者来说,一个具体问题是:本地会话位于 ~/.claude/projects,如果想在 DeepSeek Harness(DSH)中继续处理这些上下文,需要一个可操作的导入入口。
dsh-plugin-claude-import 针对这个问题。它提供 claude_session_list 和 claude_session_import 两个 agent 工具,也在 Web GUI 中提供 “Claude 导入” dock,把选定会话导入为 seed 上下文块或 full markdown continuation document。
这是什么¶
这是一个 DSH 插件,仓库地址为 https://github.com/changhang155/dsh-plugin-claude-import,许可证为 MIT。它提供会话列表、会话导入、新建 DSH 会话以及 Web GUI 入口,用于把 Claude Code 会话导入 DSH 继续处理。
核心功能¶
下面介绍已核实的能力。
会话列表¶
claude_session_list 可以列出 ~/.claude/projects 下的 Claude Code 会话。已核实的事实中列出的字段包括:
1、id
2、project
3、title
4、mtime
5、size
6、message stats
会话导入¶
claude_session_import 可以导入一个会话。导入结果可以是:
1、seed 上下文块,适合作为新 DSH 会话的初始上下文;
2、full markdown continuation document,适合作为更完整的 markdown 文档使用。
创建新的 DSH 会话¶
当 claude_session_import 使用 createSession=true 时,会在 Claude 会话所属的项目目录下创建一个 DSH 会话,并把导入的上下文作为该会话的第一条消息。
Web GUI 一键导入¶
Web GUI 的 conversation header 中提供 “Claude 导入” 操作。使用时可以输入 session id,然后按 “导入”。插件会创建一个 DSH 会话、打开它,并 seed 一条导入指令。
安装与启用¶
推荐安装命令¶
在 web profile 下使用 bundle 流程安装:
dsh plugin --profile web add dsh-plugin-claude-import
该插件支持 DSH bundle 安装,包中的 dsh.bundle patch layer 和 cordis.patch.yml 会参与插件注册。
安装后可以用下面的命令查看配置中是否出现 claude 相关项:
dsh --profile web --dump-config | grep claude
手动安装到现有 profile¶
先做 X,再做 Y:先安装包,再登记 cordis.patch.yml 行。
cd ~/.dsh/profiles/web
pnpm add dsh-plugin-claude-import
然后在 ~/.dsh/profiles/web/cordis.patch.yml 中登记插件行:
- insert:
- id: claude-import
name: 'dsh-plugin-claude-import'
从 GitHub 安装¶
也可以使用 GitHub 仓库地址安装:
dsh plugin --profile web add github:changhang155/dsh-plugin-claude-import#<sha>
这里的 <sha> 需要替换为实际使用的提交 SHA。
Peer dependencies 与脚本权限¶
该插件声明了以下 peer dependencies:
@deepseek-ai/cordis ^4.0.1
@deepseek-ai/dsh-tools ^0.1.0-rc.6
@deepseek-ai/dsh-host-apiproxy ^0.1.0-rc.6
@deepseek-ai/schemastery ^3.18.1
在 bare profile 中安装时,可能需要先 pnpm add 这些 peer dependencies,或建立到 DSH 安装目录下 node_modules/@deepseek-ai 的符号链接。
如果 pnpm 拒绝运行脚本,可以在该 profile 的 pnpm-workspace.yaml 中允许构建:
allowBuilds:
dsh-plugin-claude-import: true
然后重新执行安装命令。
典型用法¶
从 agent 发起¶
先让 agent 列出 Claude Code 会话:
请列出 Claude Code 的历史会话。
选定 id 后,再让它导入为 seed,并在 Claude 会话的项目目录下新建 DSH 会话:
把会话 <id> 导入为 seed,并在其项目目录下新建一个 DSH 会话。
从 Web GUI 发起¶
在 Web GUI 的 conversation header 中点击 “Claude 导入”,可选地输入 session id,然后按 “导入”。
经过上面的步骤,插件会创建并打开一个 DSH 会话,同时把导入指令作为 seed 上下文写入。
适用场景与注意¶
适合已经有本地 Claude Code 会话、并希望在 DSH 中继续处理这些上下文的人。使用前需要满足以下条件:
1、dsh >= 0.1.0-rc.6
2、Node.js >= 18
3、本机存在 Claude Code 安装,且会话位于 ~/.claude/projects
需要注意的是,导入是启发式解析:
1、会话标题来自 Claude 的 ai-title / summary rows;
2、touched-files 列表只覆盖 Write/Edit(和 Read)tool calls;
3、local-command-mode 会话会被检测并标注,而不是被当成普通会话。
另外,DeepSeek Harness 当前处于 developer preview,兼容性和接口可能变化。该插件针对 0.1.0-rc.6 npm line。由于插件会在当前 DSH 进程权限下读取本地会话文件,安装前应先检查源码、依赖和许可证。
结尾¶
dsh-plugin-claude-import 的价值比较具体:它把 Claude Code 的本地会话变成 DSH 可继续使用的上下文,并给 agent 和 Web GUI 都提供了入口。GitHub 仓库:https://github.com/changhang155/dsh-plugin-claude-import。已核实资料未提供目录页 URL,因此本文不列出目录页链接。