Skip to main content

dsh-chat-import

85Stars13Forks1Issues1Watchers

Import conversation history from 15 external AI coding agents (Claude Code, Codex, ChatGPT, Cursor, opencode, etc.) as fully resumable

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
agentai-agentsautomationchatgptclaude-codecodexcursordeepseek

Install

cmdweb profile
$ dsh plugin --profile web add dsh-chat-import

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Nwflower/dsh-chat-import for me: review the repository at https://github.com/Nwflower/dsh-chat-import first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Description

Import conversation history from 15 external AI coding agents including Claude Code, Codex, ChatGPT, Cursor, opencode, ZCode, Grok Build, Hermes (and any local JSONL) with full fidelity into resumable DSH sessions, while supporting reverse export to Claude Code/Codex/Kimi and cross-machine portable backups.

Core Capabilities

  • Import local history from 15 sources: Claude Code / Codex / ChatGPT CLI / ChatGPT web export / Cursor / Gemini CLI / Reasonix / opencode / ZCode / Grok Build / OpenClaw / Pi Coding Agent / Hermes / Kimi CLI & Code / Qoder CLI, plus DSH session logs and arbitrary local JSONL
  • Preserve tool calls and results, thinking blocks, titles, models, and timestamps; ChatGPT exports support branch restoration; opencode/zcode/pi respect source-side compressed summaries with optional full import
  • Idempotent and incremental: skip if source file unchanged, append only new rounds when growing, actively report when shrinking; force:true saves a complete copy with new id
  • Reverse matrix: DSH sessions can export to Claude Code JSONL, Codex rollout, Kimi wire, and portable exchange packages with SHA-256 dual fingerprints
  • Reverse sync: sync_to_claude incrementally writes DSH new rounds back to Claude Code JSONL, with overwrite protection guards, never silently overwrites
  • Browser sidebar: "Import Sessions" button + workspace-grouped browsing panel + single/multi-select import, shared read-only discovery cache
  • Companion tools: import agent/skill configurations, generate MCP mirror snippets, configuration migration suggestions, verify_session structure validation, doctor health check, sync_to_claude / export_bundle / restore_bundle

Technical Implementation

  • Language: JavaScript ESM (pure ESM, zero build, source is the release artifact)
  • Key Dependencies: @deepseek-ai/cordis (DSH plugin framework), @deepseek-ai/dsh-tools (DSH tool registration API), @deepseek-ai/dsh-client-locale (sidebar i18n), fzstd (DSH session log .zstd decompression)
  • Architecture Pattern: Native Cordis plugin, registers 22 DSH tools via apply(ctx) with delayed browser panel route mounting (ctx.inject(['webServer'])); lib/convert/* and lib/export/* maintain zero DSH dependency pure functions for isolated unit testing; lib/*.mjs (host-facing, consumes ctx) handles orchestration and persistence
  • Entry Files: index.mjs (thin composition layer) + lib/tools.mjs (22 tool registrations) + cordis.patch.yml (profile bundle insert)

Use Cases

  • Already accumulated extensive context in Claude Code / Codex / Cursor and want to seamlessly continue in DSH instead of starting from scratch
  • Want to migrate sessions across AI coding tools (Claude ↔ DSH ↔ Codex ↔ Kimi) for backup or multi-platform comparison
  • Need to carry sessions along during multi-machine migration without corrupting source files or losing workspace grouping
  • Want to consolidate external agent custom prompts, skills, and configurations into DSH's skills directory

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness (dsh-tools)0.1.0-rc.6+peer @deepseek-ai/dsh-tools ^0.1.0-rc.6, tested against dsh 0.1.0-rc.6
@deepseek-ai/cordis^4.0.1peer dependency, DSH plugin framework
@deepseek-ai/dsh-client-locale>=0.1.0-rc.6peer dependency, sidebar panel i18n
react>=18.0.0peer dependency, sidebar bundle rendering
Node.js>=22.13engines.node, first version with built-in node:sqlite
PlatformCross-platformmacOS / Windows / Linux all work; opencode / zcode / hermes three SQLite sources depend on node:sqlite, CI tests on Linux pass

Installation

dsh plugin --profile web add github:Nwflower/dsh-chat-import

Configuration

This plugin requires no pre-declared configuration in profile; behavior is controlled via call parameters and environment variables. The following table describes common parameters for tool calls and environment variables.

ConfigTypeDescriptionDefault
pathstringSource file or directory path (single file or directory batch)Required
forcebooleanWhen true, saves a complete copy with new id even if already importedfalse
budgetintegerContext budget (token count); priority: this param > DSH_IMPORT_CONTEXT_BUDGET > dynamic model window > 550kunset
preview / dryRunbooleanWhen true, parses only without writing to disk, zero side effectsfalse
sessionIdstringOverride target DSH session id (single file mode)import-<source-id>
recursivebooleanWhether directory mode recursively scans subdirectoriestrue
expectedHashstringExpected SHA-256 (lowercase hex) of source file; rejects write if mismatchunset
restampbooleanWhen true, shifts session timestamps to current time (preserving relative intervals)false
workspaceModestringauto/per-project groups by cwd or source directory; dedicated attaches all to same workspaceauto
workspaceDirstringWorkspace directory when workspaceMode=dedicated$DSH_HOME/dsh-chat-import-workspace
DSH_IMPORT_CONTEXT_BUDGETenvContext budget token count (whole library import budget chain)unset
DSH_IMPORT_SESSION_HINTenv=0 disables migration hints on new session starton
DSH_IMPORT_CONTEXT_BRIDGEenv=1 bridges Claude memory/CLAUDE.md/skills to current agentoff

Sidebar panel routes and command surface (/import, /resume-claude, etc.) automatically enable under web/profile combination; headless profiles or profiles without webServer service won't mount panel routes, but the 16 import tools remain fully usable.

FAQ

Q: Do I need to configure anything after installation to use it?

A: Just restart dsh after installing; the plugin consumes host public services by default. If the corresponding agent's local data directory is not installed on the machine, import tools will error directly on missing paths, won't auto-create.

Q: Will it rewrite my original Claude Code / Codex history files?

A: No. Source transcripts and SQLite databases remain read-only throughout; import results only append new events to DSH session directory, import metadata writes to $DSH_HOME/dsh-chat-import/imports.json. sync_to_claude appends writes back to Claude Code files, but with overwrite protection (skips and reports if source shrinks or externally modified), force:true re-anchors.

Q: Will re-importing the same history create duplicate sessions?

A: No. Source files with unchanged mtime/size are idempotently skipped, won't re-read source data; growing source files append only new rounds to the same session; shrinking source files are detected and reported. force:true skips idempotency checks and saves a complete copy with new id.

Q: Can imported sessions continue chatting, is the tool panel normal?

A: Yes. Import尽量走 host 的 agents.create 路径并挂载默认 preset scope 和默认模型,工具面与原生 DSH 会话一致,刷新会话列表即可接着聊;若 agents 服务不可用则自动回退到 sessionPersistence,不会因此中断。

Q: I have hundreds of histories, how to import all at once?

A: Click "Import Sessions" in browser sidebar to open panel, browse by workspace grouping + multi-select import; or run scan_discover() directly in DSH session to see the list, then call import_<source>({ path: "<data root>" }) sequentially. Directory paths recursively scan, each transcript becomes a separate session.

Q: How to undo an imported session?

A: Use retract_import({ sessionId }) (or sourcePath), the plugin only removes registry records and returns guidance for manually deleting artifacts, never calls any deletion. After manually deleting artifacts per guidance, force:true re-import to get a fresh session.

Q: Can I continue chatting imported sessions on another machine?

A: Yes. Use export_bundle({ sessionId }) to export .dshbundle.json (with SHA-256 dual fingerprints + cross-machine placement info), copy to another machine and run restore_bundle({ path }); when original cwd is unreachable on new machine, falls back to bundle file's directory and reports cwdAvailable:false in result, won't silently group to "ungrouped".

Q: What to do when receiving "TOOL_RUNTIME_SCHEDULER missing" error?

A: This is the plugin actively throwing error when host's @deepseek-ai/dsh-tools version is below 0.1.0-rc.6 (prevents polluting session history with old ABI tool registrations). Upgrade the host.

Getting Started Difficulty

Beginner — install plugin and restart DSH, import single file with default parameters; sidebar browsing + multi-select import requires no code. Complex scenarios (budget trimming, cross-machine migration, dedicated workspace) involve 1-2 extra parameters, README is enough to get started.

Known Issues & Limitations

  • node:sqlite first available version is Node 22.13; Windows / Linux / macOS all work, but host environment must satisfy >=22.13
  • import_dsh and export_bundle share the same converters, but DSH's own history doesn't enter scan_discover's 15-source auto-roots by default (requires explicit path or format)
  • Kimi subagent sessions recorded as SubagentEvent in parent wire are skipped; needs separate import of subagent directory or new layout agents/<agentId>/wire.jsonl
  • Cursor agent transcript doesn't include tool_result, only imports tool_use call history
  • sync_to_claude defaults to strict guards (source shrink / external modification / tail mismatch / concurrent writer all skip and report); force:true re-anchors watermark and chain tail, may overwrite external modifications
  • Browser panel routes depend on host's webServer service mounting late; headless profiles or profiles without webServer service don't mount panel but import tools remain usable

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Nwflower/dsh-chat-import)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory