Nwflower/dsh-chat-import
Import 14+ external agent chat histories (Claude Code, Codex, ChatGPT, Cursor, Gemini, Reasonix, opencode, ZCode, Grok Build, OpenClaw, Pi, Hermes, Kimi CLI, DSH) into DeepSeek Harness as resumable sessions — full-fidelity, reverse export/sync, bundle backup. | 从 Claude Code、Codex、Reasonix 等 Agent 工具导入历史消息到 DeepSeek Harness 并继续对话。
已收录
57
Session
Bundle 已验证
预览
功能介绍
把 13 家 coding agent(Claude Code、Codex、ChatGPT、Cursor、Gemini、opencode 等)的完整对话历史导入为可续聊的 DeepSeek Harness 会话,并支持反向导出回 Claude Code。
适合
- 需要把受支持 coding agent 的完整对话历史迁移为可续聊 DSH 会话的用户。
- 需要在 Claude Code 与 DSH 之间交接工作,并保留工具调用、推理和对话上下文的开发者。
- 希望按来源工作区集中整理 Agent 历史且不修改原始文件的团队。
不适合
- 没有历史记录需要迁移或导出的新对话,此时插件对工作流帮助有限。
- Node.js 低于 22.13,或不在文档所述 DSH 0.1.x 目标范围内的环境。
- 会话沙箱未授权访问相应路径时,位于工作区之外的导入或导出任务。
README
📥 DSH Chat Import
Import 15+ external agent conversation histories into DeepSeek Harness as full-fidelity, resumable sessions — and export / sync back to Claude Code, Codex, Kimi, or a portable interchange bundle.
💡 Intro · 🚀 Install · ✨ Features · 🗂 Supported sources · 🛠 Usage · 🔑 Key behaviors · 📚 Docs · ⭐ Star History · 🤝 Contributing
16+ agent sources, one plugin — full-fidelity import into DeepSeek Harness, seamless resume, matrix interop / backup / handoff on the way out.

Changelog: CHANGELOG.md · Roadmap: ROADMAP.md · Interchange protocol: docs/INTERCHANGE.md
💡 Intro
dsh-chat-import imports conversation histories from Claude Code, Codex, ChatGPT, Cursor, Gemini, Reasonix, opencode, MiMo Code, ZCode, Grok Build, OpenClaw, Pi Coding Agent, Hermes, Kimi CLI / Kimi Code, Qoder CLI and DSH session logs — tool calls, reasoning and all — as full-fidelity, resumable DeepSeek Harness sessions. Source files are read read-only (never rewritten), the DSH engine is never touched, and every import becomes a fresh session grouped into the workspace of its source cwd.
The reverse direction is covered too: export_claude serializes a DSH session back into a Claude Code JSONL transcript that Claude Code can load with --resume (read-only — your DSH log is never modified), sync_to_claude incrementally appends a session’s new turns back to a Claude Code file — guarded, never silently overwriting — and the same matrix extends to Codex rollouts (export_codex) and Kimi wire files (export_kimi), plus a portable interchange bundle (export_bundle / restore_bundle) with SHA-256 fingerprints and cross-machine restore.
Requires Node.js ≥ 22.13, targets dsh 0.1.x (tested on 0.1.0-rc.6 / 0.1.0-rc.7).
🚀 Install
dsh plugin --profile web add dsh-chat-import # npm package
dsh plugin --profile web add -w link:/path/to/dsh-chat-import # local checkout (symlink)
Then:
-
Import — call any
import_*tool in a DSH session:
import_claude({ path: "~/.claude/projects" })
import_chatgpt({ path: "~/Downloads/chatgpt-export/conversations.json" })
import_local_jsonl({ path: "D:\downloads\session.jsonl" })
- Resume — refresh the session list, open the imported session, and keep chatting from where the source left off.
-
Discover & batch —
scan_discover()previews read-only; the sidebar “Import sessions” panel browses by workspace and supports multi-select import;/import-allbatch-imports everything. - Sync (optional) — the panel’s “Sync” tab offers bidirectional incremental sync (external → DSH, DSH → external), default off.
Uninstall: remove the
import-claudeinsert line from your profile’s bundles and restart dsh; imported sessions stay untouched and the plugin never auto-deletes.
✨ Features
| Capability | Entry points | Description |
|---|---|---|
| Batch import from 16+ sources |
import_* (17 tools) · scan_discover · sidebar panel · /import
|
A file, a directory or a whole database — each conversation becomes its own session |
| Full-fidelity resume | Imported sessions | Tool calls & results, reasoning, titles, models and timestamps carry over; sessions group into the source cwd workspace |
| Matrix export |
export_claude / export_codex / export_kimi
|
Serialize DSH sessions back to Claude / Codex / Kimi formats; every lossy item is reported |
| Portable backup |
export_bundle / restore_bundle
|
Interchange bundle with dual SHA-256 fingerprints, restorable across machines |
| Incremental write-back | sync_to_claude |
Appends new complete turns back to a Claude Code file — guarded, never overwriting |
| Agent asset migration | import_agents |
Converts pi / opencode / Claude / Codex agents, prompts, skills, instructions into persistent DSH skills |
| MCP mirror plan |
import_mcp / /mcp-status
|
Reads Claude / Codex MCP servers and generates a reviewable DSH MCP client YAML snippet |
| Settings translation |
import_settings / /settings-suggest
|
Turns Claude settings / Codex config into DSH migration suggestions (read-only) |
| Handoff summaries |
/resume-claude / /resume-codex
|
Treats external transcripts as untrusted history and injects a handoff summary into the current session |
| Read-only audit / checkup |
verify_session / doctor / CLI dsh-chat-import doctor
|
Structural audit and migration health check |
| Idempotency & protection | All import tools |
expectedHash / restamp / context-budget protection; unchanged sources skip, grown sources append |
| Preset mode + system prompt | Settings tab in the Plugins section | Imported sessions record the default preset; optional “import system prompt” as a context injection (off by default) |
🗂 Supported sources
| Source | Storage location | Import tool |
|---|---|---|
| Claude Code | ~/.claude/projects/<slug>/<sessionId>.jsonl |
import_claude |
| Claude-3p (new client) |
%LOCALAPPDATA%\Claude-3p\claude-code-sessions (metadata → JSONL via cliSessionId) |
import_claude |
| Codex / ChatGPT CLI | ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl |
import_codex |
| ChatGPT (web export) | anywhere you saved the export — conversations.json
|
import_chatgpt |
| Cursor | ~/.cursor/projects/<slug>/agent-transcripts/<id>/<id>.jsonl |
import_cursor |
| Gemini CLI | ~/.gemini/history/<slot>/chats/session-*.json |
import_gemini |
| Reasonix (CLI + desktop) |
~/.reasonix/sessions/desktop-*.jsonl · %APPDATA%\reasonix\projects\<slug>\sessions\*.jsonl
|
import_reasonix |
| opencode | ~/.local/share/opencode/opencode.db |
import_opencode |
| MiMo Code (opencode fork) | ~/.local/share/mimocode/mimocode.db |
import_mimocode |
| ZCode (z.ai CLI) | ~/.zcode/cli/db/db.sqlite |
import_zcode |
| Grok Build | ~/.grok/sessions/<project>/<session_id>/ |
import_grokbuild |
| OpenClaw | ~/.openclaw/agents/<agent>/sessions/*.jsonl |
import_openclaw |
| Pi Coding Agent | ~/.pi/agent/sessions/--<cwd>--/<timestamp>_<uuid>.jsonl |
import_pi |
| Hermes |
~/.hermes/ (Windows %LOCALAPPDATA%\hermes) |
import_hermes |
| Kimi CLI / Kimi Code |
~/.kimi/sessions/<workdir-md5>/<sessionId>/wire.jsonl · ~/.kimi-code/sessions/<workspaceId>/<sessionId>/agents/main/wire.jsonl
|
import_kimi |
| Qoder CLI |
~/.qoder/projects/<encoded-project>/<sessionId>.jsonl (subagents in <sessionId>/subagents/*.jsonl) |
import_qoder |
| DSH session logs | ~/.dsh/sessions/<encoded-workspace>/<sessionId>/session.jsonl(.zstd) |
import_dsh |
| Any local JSONL | any .jsonl file / directory (auto-detected) |
import_local_jsonl |
Each import preserves what the source actually records; anything a format cannot preserve is explicitly flagged in the import report. Per-format details and edge cases live in Usage Reference.
🛠 Usage
All import_* tools share the same path semantics: a single file becomes one session, a directory is scanned recursively for batch import. Common options: preview (zero side effects), force (new full copy), sessionId (override target id), expectedHash (SHA-256 verification), restamp (shift timestamps to now), workspaceMode / workspaceDir (grouping control).
import_claude({ path: "C:\Users\<you>\.claude\projects\<slug>\<sessionId>.jsonl" })
import_opencode({ path: "C:\Users\<you>\.local\share\opencode\opencode.db" })
import_local_jsonl({ path: "D:\downloads\session.jsonl", format: "claude" })
import_chatgpt / import_opencode / import_zcode / import_hermes always return batch results — one file / database contains every session, and each conversation becomes its own session in a single call.
Full per-tool / per-command usage lives in docs/USAGE.md.
🔑 Key behaviors
- Read-only import — source transcripts and databases are never rewritten; imported DSH history is append-only.
- Idempotent + incremental — unchanged sources skip without re-reading; grown sources append only new turns; shrinking is detected and reported.
-
Auto workspace grouping — sessions land in the workspace of their source
cwd(authoritative mapping → slug decode → home-directory sandbox guard; falls back to the source file’s directory when the path does not exist locally). -
Preset mode — imported sessions mount the default preset scope via
agents.createand write the default preset id back toSessionHeader.agentPreset, so the UI shows the preset-mode chip exactly like a normal session. -
System prompt (optional, off by default) — the “Import system prompt” setting (a tab in the settings Plugins section) preserves the source transcript’s
system/developerprompt as a “context injection” collapsed row, prefixed with a note that the environment changed and tools / permissions / instructions now follow DSH. Claude Code transcripts do not persist a system prompt, so the toggle is a no-op for that source. - Fail loudly — malformed lines, suspected secrets, format limitations and export degradations are all reported; every persisted session gets a structural self-check.
- Sandbox — reading sources or writing exports outside the workspace requires the session sandbox to allow that path.
📚 Docs
| Document | Description |
|---|---|
| Usage Reference | Full parameters, examples and edge cases for every tool / command |
| Interchange protocol | Interchange v1 protocol and bundle format |
| Changelog | Version history |
| Roadmap | Shipped / planned |
| Contributing | Development setup, commit rules, security & privacy |
⭐ Star History
🤝 Contributing
Contributions welcome — fork the repo, create a feature/<name> branch, and open a PR. Full guide: CONTRIBUTING.md.
-
Tests:
npm test· Cross-platform guard:npm run check:linux - Repo conventions: AGENTS.md — conventional commits, bilingual READMEs must stay in sync, plugin consumes public dsh host services only, multi-session file-claim protocol.
📄 License
MIT — see LICENSE.
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:Nwflower/dsh-chat-import。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。