dsh-agent-session-import: Import local conversations from Cursor, Codex, etc. into DSH

Introduction

When continuing conversations or archiving history in DeepSeek Harness (DSH), the common practice is manual copy-paste or starting a brand-new session from scratch. If you’ve accumulated a large volume of local conversations across tools like Cursor, Codex CLI, Claude Code, ZCode, and Kimi Code, these records are scattered across each tool’s directories and databases, making it difficult to migrate them all into DSH’s v4 session model in one go.

dsh-agent-session-import is a DSH bundle plugin (category: Memory) published by community maintainer howtomakeaname. On the host side it only reads each agent’s local data; on the browser side it provides an Import Sessions panel that imports third-party coding agents’ local conversations as DSH sessions. The plugin has zero runtime dependencies and can be installed and used without building; it was developed and verified on DSH 0.2.x (desktop version 0.2.1-rc.2). The current npm package version is 0.2.4, MIT license.

What Is This

In one sentence: it can read local session storage from Cursor / Codex / Claude Code / ZCode / Kimi and similar tools, write them into DSH v4 sessions after selection, and make them visible in the sidebar and session list.

In terms of implementation, the host handles scanning, conversion, and writing (lib/host/), while the client is a bundled single file lib/client.js (source in src/client/). The entire processing takes place within the local DSH Host process; the plugin sends no network requests. It only reads third-party data—it does not modify or copy the original files.

Supported Sources and Local Paths

The table below comes from the project README; the host scans these paths read-only (Cursor paths on Windows / Linux have been cross-platform adapted, see the README’s “Platform Support” for details).

Source Local data read (read-only)
Codex (shared by CLI / desktop) ~/.codex/sessions/**.jsonl + ~/.codex/thread_history_1.sqlite
Claude Code ~/.claude/projects/**.jsonl
Cursor IDE (Agent / Composer) macOS: ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb; other systems use %APPDATA% / ~/.config corresponding paths
ZCode ~/.zcode/cli/db/db.sqlite
Kimi (Kimi Code CLI / desktop) ~/.kimi-code/sessions (Windows: %USERPROFILE%\.kimi-code\sessions, can be overridden via KIMI_CODE_HOME)

Other agents (such as Aider, Continue) can be supported by adding a provider under lib/host/providers/ and registering the extension; the contract is documented in docs/adding-provider.md in the repository.

Core Features

Import Panel

Sidebar Import Sessions: source navigation on the left, session list on the right grouped by project folder (expandable/collapsible), displaying title, update time, message count, and Imported / Archived badges. Supports search, Unimported / All switching, group-level select-all, Select unimported, and per-item selection. During import a dialog shows overall progress, the current item, and per-item results; failed items can be retried.

Two Import Modes

Neither mode loses content; the difference lies in display and request structure:

  1. Faithful: thinking, tool calls, and results are preserved as structured cards, suitable for reading. When continuing the conversation, it may be subject to model API validation restrictions on historical tool_use / thinking.
  2. Resume-safe: the same content is preserved as text (【Thinking】 / [Tool Call] / [Tool Result]), with tool/thinking wire structures removed, making it safe for any model to continue the conversation.

One source conversation maps to one DSH session, attempting to return to the original project directory (falling back to the user home when the directory doesn’t exist). Session titles and message counts are written into the DSH projection cache; the imported mapping is saved in $DSH_HOME/session-import/imported.json. Re-imported items display badges, and the list auto-refreshes after import completes.

Session Format and Continuation Notes

The first surface event of each imported session is an empty system/message (the protected surface head), satisfying the DSH v4 format. When continuing, DSH re-renders the system prompt based on the current cwd, toolset, preset, and model; the plugin does not hard-code the system prompt into the log. A source-description text is injected at the beginning of the first user message, explaining which agent the history comes from and that historical tool names differ from current DSH tools—it is only for reference.

Installation and Activation

The plugin runs with the current DSH process’s permissions. Before installing, it is recommended to review the source code and MIT license at the GitHub repository. The community plugin catalog is available at the SkillHub catalog page (an independent site, with no official affiliation to DeepSeek / High-Flyer).

Install from npm (available after publication)

  1. Open DSH sidebar Plugins.
  2. Add plugin, enter the package name (or with version):
dsh-agent-session-import
dsh-agent-session-import@0.2.4
  1. Select Install; after completion click Enable now (or enable it in the Plugins list).
  2. Once Import Sessions appears in the sidebar it is ready to use; on desktop the hot-bundle usually takes effect within seconds. If it doesn’t appear, restart DSH.

Install from GitHub

  1. Plugins → Add plugin.
  2. Enter the repository address (pinning a commit is recommended):
git+https://github.com/howtomakeaname/dsh-agent-session-import.git

You can also use the absolute path of a local clone directory (e.g., ~/code/dsh-agent-session-import).
3. Install → Enable; after modifying code, restart DSH for changes to take effect.

Uninstall: Plugins → the plugin → Uninstall. Uninstalling does not delete already-imported sessions. Deleting $DSH_HOME/session-import/imported.json only resets the “imported” records—it does not delete the sessions themselves.

Typical Usage

  1. Click Import Sessions in the sidebar.
  2. Select a source on the left → expand the project group → select the conversations to import (or Select unimported) → choose Faithful or Resume-safe → Import.
  3. View per-item results in the progress dialog; completed sessions appear in the left session list (grouped under the corresponding workspace).

If the goal is stable conversation continuation rather than merely reading history, the README recommends using Resume-safe first.

Use Cases and Notes

Who it’s for: developers who have accumulated local sessions across multiple coding agents and want to view or continue them uniformly in DSH; when you need to preserve tool calls and thinking processes, you can choose between Faithful and Resume-safe depending on the scenario.

Known limitations (excerpted from the README):

  • Codex: the complete reasoning chain is not stored in plaintext; locally only the visible summary is retained.
  • Kimi: only supports Kimi Agent / Kimi Code sessions; ordinary Kimi chat records are server-side, with no body stored locally.
  • ZCode: schema is bound to ZCode 0.16.x; rewind sessions are imported as linear history.
  • Tool results exceeding 20,000 characters and thinking exceeding 12,000 characters are truncated and annotated; very large histories are paginated for reading, and corrupted lines are skipped and counted in statistics.
  • macOS has been verified on real hardware for end-to-end import of all five sources; Windows / Linux paths and SQLite access have been handled in CI, but the README notes they have not yet been verified with real local data on Windows machines. Kimi desktop’s built-in runtime path is currently resolved as macOS.

SQLite access prefers node:sqlite; when that module is missing it falls back to sqlite3 / sqlite3.exe on PATH, and can be overridden with the SQLITE3 environment variable.

Conclusion

dsh-agent-session-import aggregates conversations scattered across multiple agents’ local storage into DSH sessions in a read-only manner, providing a grouped list, imported markers, and two import modes with different continuation-friendliness. Installation and usage are governed by DSH sidebar Plugins and Import Sessions.

  • Catalog page: https://www.skillhub.cn/plugins/howtomakeaname/dsh-agent-session-import
  • GitHub: https://github.com/howtomakeaname/dsh-agent-session-import
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye