# 匹配标题;多个匹配会列出,绝不猜测
/claude-move-reset # 重置插件缓存(书签 + 导入映射);导入的会话保留
```
Web 面板:一个浮动迁移面板,包含项目/会话树、状态徽章(未导入 / 已导入 / 已导入并有新轮次 / 源缺失 / 目录缺失 / git 脏)、关键字过滤、分页渲染、每个会话的「导入并继续」+「打开会话」+「刷新会话列表」、带实时进度条和取消的批量导入,以及一个缓存重置按钮。文本跟随浏览器语言(zh/en)。通过插件自身的 `/api/claude-move/*` JSON 路由在公开 `ctx.webServer` 接缝上提供。
## 导入之后
**你无需重启 DSH。** 导入在完成的那一刻即通过公开的 `sessionPersistence` 服务持久化落地:
- 服务器端列表(`session.list` / `workspace.list` RPC、CLI、任何新的页面加载)会立即在 **`claudecode` 工作区**下显示导入的会话。
- 面板会自行刷新已打开页面的会话列表,并为每个导入的会话提供 **打开会话** 按钮。
- 导入的会话可以立即打开、读取和继续 —— `/resume-claude`,或点击列表中的会话。随时重新运行导入只会把新轮次同步到相同的会话中。
## 配置
全部可选,可在 cordis.yml 中覆盖。
| 键 | 默认值 | 含义 |
|---|---|---|
| `claudeHome` | `$CLAUDE_CONFIG_DIR` 或 `~/.claude` | Claude 数据根 |
| `workspaceMode` | `claudecode` | `claudecode`(一个专用工作区)· `per-project`(每个源 cwd 一个工作区) |
| `claudecodeDir` | `$DSH_HOME/claudecode` | `claudecode` 工作区文件夹(插件唯一会创建的文件夹) |
| `scanGit` | `true` | Git 探测级别:`true`(完整)· `'branch'`(零 git 调用)· `false` |
| `gitTimeoutMs` | `5000` | Git 子进程超时 |
| `scanConcurrency` | `8` | 并行项目扫描上限 |
| `maxTranscriptBytes` | `67108864` | 流式导入阈值(超过则分块) |
| `excludeProjects` | `[]` | 要跳过的 slug 子串 |
| `enableMemory` | `true` | 将记忆作为实时提示词段落注入 |
| `memoryMaxBytes` | `8192` | 记忆段落上限 |
| `memoryScope` | `current-project` | `current-project` · `all`(当前项目优先) |
| `enableSkills` | `true` | 将 Claude 技能注册为 DSH 技能 |
| `maxSkills` | `30` | 技能数量上限 |
| `extraSkillDirs` | `[]` | 额外的技能目录 |
| `enableInstructions` | `true` | 注入全局 + 项目 `CLAUDE.md` |
| `resumeMaxChars` | `2048` | 交接摘要字符上限 |
| `resumeMode` | `inject` | `inject`(交接摘要)· `agents`(ctx.agents.resume) |
| `enableWebPanel` | `true` | 注册 `/api/claude-move/*` 面板路由 |
| `importConcurrency` | `4` | 每批并行读取 + 转换 |
| `requireApproval` | `true` | 向导写入询问 `ctx.approval`(仅 allowed-once) |
| `codexHome` | `$CODEX_HOME` 或 `~/.codex` | Codex 数据根 |
| `opencodeDataHome` | 平台 XDG 数据目录/opencode | OpenCode 数据根 |
| `opencodeConfigHome` | 平台 XDG 配置目录/opencode | OpenCode 配置根 |
| `hermesHome` | `$HERMES_HOME` 或 `~/.hermes` | Hermes 数据根 |
| `skillsDir` | `$DSH_HOME/skills` | 向导技能目标 |
| `agentsMdPath` | `$DSH_HOME/AGENTS.md` | 向导记忆/指令目标 |
| `moveWorkspaceMode` | `per-source` | 向导导入的工作区分组:`per-source` · `single` |
## 工具与界面
| 界面 | 类型 | 说明 |
|---|---|---|
| `claude_scan` | 工具 | 项目/会话/记忆/技能/设置的结构化索引 |
| `import_claude` | 工具 | 导入单个会话、一个目录或 `all`(增量;`force` 生成全新副本) |
| `move_detect` / `move_preview` / `move_run` | 工具 | 四来源向导:扫描、带 diff 的逐项计划、在审批之后执行 |
| `/claude-import-all` | 命令 | 扫描 → 导入全部 → 报告 |
| `/resume-claude` | 命令 | 继续一个 Claude 会话(latest、id 或关键字) |
| `/claude-move-reset` | 命令 | 重置插件缓存(导入的会话保留) |
| `/move` | 命令 | 一次性四来源向导 |
| Web 迁移面板 | 客户端 | 带进度、取消、分页、打开会话的浮动面板 |
## 权限与数据
- **权限**:workshop 清单声明 `filesystem:read` 和 `filesystem:write`。
- **读取** `~/.claude`(transcript、记忆、技能、`CLAUDE.md`、`settings.json`)—— 严格只读 —— 以及它导入到的项目目录。
- **写入** 通过公开 `sessionPersistence` 服务写 DSH 会话日志(仅 create + append,绝不删除/改写/归档)、工作区注册表记录、`$DSH_HOME/claude-move/` 下的缓存,以及 `claudecode` 工作区文件夹。
- **绝不** 修改 Claude 源文件、触碰其他应用的数据或访问网络。**不读取或传输任何凭据**。
## 安全边界
- **源文件只读;DSH 日志只追加**(仅 `create` + `append`)。
- **外部 transcript 是不可信输入** —— 其中的任何内容都不会被执行;system/developer/thinking 内容绝不进入续聊交接。
- **仅公开服务** —— `sessionPersistence` / `workspaceRegistry` / `tools` / `commands` / `systemPrompt` / `skills` / `webServer`;不改引擎或 UI。
- **密钥仅按位置报告**(file:line:kind);`permission`/`permission-mode`/`queue-operation` 记录只计数、不导入。
- **向导写入审批门控** —— 除 `allowed-once` 之外的任何结果都意味着零写入。
## 已知限制
- 标题来自 `custom-title`/`ai-title`/首条提示;Claude `summary` 记录会被报告,但不映射为 DSH 压缩节点(合成一个有效的压缩事务会伪造其 seq 范围和检查点消息)。
- `thinking` 块作为 `reasoning` 内容保留,但绝不进入续聊交接。
- 被中断的工具调用会以合成的错误结果修复(绝不丢弃),报告为 `repaired.synthesized`。
- 权限类记录只计数、不导入;DSH 权限预设建议在报告中生成。
- 在没有流式 `fs.streamText` 接口的宿主上,超过 `maxTranscriptBytes` 的 transcript 会大声失败,而不是部分导入。
- 在 `workspaceMode: 'per-project'` 下,源目录已删除的会话仍会导入,但工作区挂载失败(保持未分组;`workspace.attached: false` 加上一个 `reason`)。默认的 `claudecode` 工作区不依赖源目录。
- 如果 transcript 被就地截断或重置(轮次少于记录的导入),重新导入会跳过它并报告 `sourceShrunk`;用 `force: true` 生成全新的完整副本。
- Web 面板是由插件自身 JSON 路由驱动的零构建浮动面板;它不使用 shell 内部的 UI 插槽系统。
## 模型体验
- 面向模型的面是两个工具的描述/schema 及其输出:`claude_scan` 返回结构化索引,`import_claude` 返回逐文件摘要以及警告的位置。工具结果本身被记录为 `tool/result` 事件,因此一切都可以重建。
- 没有隐藏的面向模型的文本;记忆/`CLAUDE.md` 段落注册在 `ctx.systemPrompt` 上(提示词组装,可从会话日志重建)。
## 故障排查
- 该行未生效:`dsh --profile --dump-config` 应打印 `# == dsh-claude-move`;重新运行 `dsh plugin --profile
add ...`。
- Web 能启动但静默挂起:由 `dsh plugin add` 初始化的新 profile 只包含 `dsh-base` —— 将 `@deepseek-ai/dsh-web-app` 添加到 `dsh.profile.bundles`。安装到已有的 `web` profile 则无需任何操作。
- 面板路由 404:只有当 `enableWebPanel: true` 且组合了 web 服务器时才会提供这些路由;检查启动日志中的 FAILED fiber。
- 导入失败并提示 "transcript 过大":提高 `maxTranscriptBytes` 或单独导入该文件。
- 导入成功但侧边栏没有显示新会话:页面已经打开 —— 点击一次面板的刷新按钮(或重新加载页面)即可。永远不需要重启 DSH。
- 日志:启动失败会打印到 `dsh` 控制台;插件会为工作区/导入映射问题记录以 `[claude-move]` 为前缀的错误。
## 致谢(开源组件)
本项目采用 Apache License 2.0 许可;以下 MIT 许可组件保留其自身许可(全文见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)):
- 转换核心 vendored 自 [Nwflower/dsh-chat-import](https://github.com/Nwflower/dsh-chat-import)(MIT)。
- 发现约定与安全模型来自 [Demogorgon314/dsh-resume-plugin](https://github.com/Demogorgon314/dsh-resume-plugin)(MIT)。
- 记忆/技能注入与 frontmatter 解析模式来自 [YYTbit/dsh-plugin-claude-bridge](https://github.com/YYTbit/dsh-plugin-claude-bridge)(MIT)。
## 开发
```sh
npm install # peer 依赖:@deepseek-ai/dsh-tools@0.1.0-rc.6、@deepseek-ai/cordis、schemastery
npm test # node --test test/*.test.mjs
```
CI 通过 GitHub Actions([test.yml](.github/workflows/test.yml))在 Linux/macOS/Windows 上以 Node 22 运行完整套件。
## 主题
`deepseek-harness`, `dsh-plugin`, `claude-code`, `migration`, `session-import`, `resume`
## 贡献者
- [@PerryLink](https://github.com/PerryLink) —— 创建者与维护者:导入管线、四来源迁移向导、Web 面板、文档、CI/CD 与发布。
- [@OLDnana1](https://github.com/OLDnana1) —— 对被中断工具调用损坏的根因分析,该损坏曾使导入会话在续聊时永久返回 HTTP 400。
- [@GooodWei](https://github.com/GooodWei) —— 发现 `README.md`(以及任何无描述的 `.md`)被误注册为技能,从而破坏 DSH 的技能加载。
## PerryLink DSH 插件家族
本项目是 [PerryLink](https://github.com/PerryLink) 维护的 DeepSeek Harness 插件之一。如果这个对你有帮助,其他的很可能也有用:
| 插件 | 一句话介绍 |
|---|---|
| [dsh-mcp-panel](https://github.com/PerryLink/dsh-mcp-panel) | 只读 MCP 运行时面板:/mcp 命令 + 带状态、工具和错误的设置标签页 |
| [dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck) | 工程纪律守卫:需求盘问、测试门、对手审查 |
| [dsh-background-agents](https://github.com/PerryLink/dsh-background-agents) | 带 Web UI 侧边栏、消息和中断的持久后台子代理 |
| [dsh-lsp-actions](https://github.com/PerryLink/dsh-lsp-actions) | 通过语言服务器提供 LSP 诊断、格式化、补全、代码操作与重命名 |
| [dsh-output-styles](https://github.com/PerryLink/dsh-output-styles) | Claude Code outputStyles 等价的运行时样式切换 |
| [dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind) | Claude Code /rewind 等价物:快照、会话分叉、一次性恢复 |
| [dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules) | Claude Code 风格的声明式 allow/deny/ask 权限规则,带审计 |
| [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) | 在审批链上的第二模型自动审查,默认 fail-closed |
| [dsh-memento](https://github.com/PerryLink/dsh-memento) | 审批门控的跨会话记忆:ctx.memory 接缝 + SQLite + 记忆工具 |
| [dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security) | 安全审计技能包:密钥扫描、依赖与供应链审查 |
| [dsh-session-pin](https://github.com/PerryLink/dsh-session-pin) | 在 Web 侧边栏固定会话,带持久排序 |
| [dsh-composer-history](https://github.com/PerryLink/dsh-composer-history) | Web 编辑器终端风格输入历史:方向键、Ctrl+R 搜索 |
| [dsh-github](https://github.com/PerryLink/dsh-github) | DSH 的 GitHub PR/issues 集成,每次写入都经审批门控 |
| [dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide) | 作为按需代理技能的插件开发知识库 |
| **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | 将 Claude Code 会话、记忆、技能和 CLAUDE.md 迁移到 DSH |
## 许可证
[Apache License 2.0](LICENSE) © 2026 dsh-claude-move contributors