When using DeepSeek Harness (DSH) or other AI agents, switching tools usually means losing conversation history and contextual memory. The dsh-migrate plugin aims to solve this problem by allowing sessions and memories from other agents to be exported as native DSH session logs, so they can be continued and retrieved in DSH.

This plugin is maintained as an open source project under the MIT license. It provides a set of mechanisms for converting data from several mainstream agents into a format that DSH can read and search.

Installation and Enablement

Install the plugin into DSH’s Web configuration file via the plugin manager.

dsh plugin --profile web add @ersss/dsh-migrate

After installation, restart DSH to load the plugin.

dsh web

The installation process registers the /migrate slash command and redirects the session storage directory to $DSH_HOME/sessions-imported, a dedicated root directory for imported logs.

Core Features

  1. Multi-source reading: Supports reading chat histories and memories from multiple AI agents. Supported sources include Claude Code, Codex CLI, Gemini CLI, Cursor, Kimi CLI, ChatGPT, Cline, OpenCode, Aider, Hermes Agent, and OpenClaw.
  2. Native-format writing: Imported data is written as native DSH session logs (JSONL format). These logs are grouped by original project directory in the sidebar, and the full event stream (prompts, reasoning, tool calls, and results) is displayed in the Trajectory view.
  3. Slash Command: The DSH Web UI provides the /migrate command for directly listing sessions and running migrations.
  4. Standalone CLI: Provides a standalone command-line tool npx @ersss/dsh-migrate, supporting local data scanning and preview (dry run) without running DSH.
  5. Memory and documentation integration: Supports writing imported memories to the AGENTS.md file in the project root directory, while preserving message source provenance (via the via channel tag).

Typical Usage

Web UI Usage

Enter the following commands in the DSH Web interface:

/migrate list              # 查看各智能体在本地磁盘上的会话记录
/migrate run               # 导入所有检测到的会话
/migrate run --source claude-code --limit 10  # 仅导入特定来源的前 10 条记录

Command-line Usage

Run the following commands in the terminal:

npx @ersss/dsh-migrate list
npx @ersss/dsh-migrate run                       # 导入到默认的 $DSH_HOME/sessions-imported
npx @ersss/dsh-migrate run --out /path/to/root   # 指定输出路径
npx @ersss/dsh-migrate run --write-instructions .  # 同时将记忆折叠到当前目录的 AGENTS.md

Imported sessions end with a session/end-seed event and are marked as seed history. This means that when continuing a conversation in DSH, the system replays it as inherited context and then starts a new active log, enabling seamless session continuation.

Limitations and Notes

  • Read-only operations: The plugin performs read-only operations on source agent directories and does not modify any original data.
  • Media support: Images and attachments cannot be imported, but text content around attachments is preserved.
  • History compression: Compacted history in source transcript files is flattened into plain messages.
  • Source differences: Due to differences in source agent data formats, some features may have gaps (for example, Cursor tool results, ChatGPT tool message structuring, Kimi sub-agent internal details, etc.).

Summary

dsh-migrate provides a standardized solution for migrating and reusing context from other agents in DeepSeek Harness. It is a practical tool for developers who switch among multiple agent tools and want to retain complete context records.

For more information, refer to the GitHub repository.