Foreword

When developing agents in DSH, many sessions are scattered across external tools like ChatGPT, Claude Code, Codex, Cursor, and others. If you want to continue viewing these sessions, continue chatting, archive, or consolidate experience within DeepSeek Harness (dsh), you need a unified import path.

dsh-session-import is a plugin for dsh maintained by devmom, licensed under MIT. It imports sessions exported from external tools into dsh and can also export dsh sessions to a generic format; meanwhile, it provides privacy redaction detection and knowledge extraction entry points.

What is the Plugin

One-sentence positioning: dsh-session-import is a cross-tool session migration plugin for dsh.

It provides the following capabilities:

  • 15+ source session imports: ChatGPT / Claude Code / Codex / Kimi Code / ZCode / WorkBuddy / OpenClaw / Gemini / Cursor / Aider / Continue / Cline / OpenCode / Reasonix / GitHub Copilot Chat / Generic JSON.
  • Imported sessions produce native dsh session-log events, written via ctx.sessions, and persisted via the official JSONL format.
  • Imported sessions render natively in the dsh Web UI and support continuation.
  • Bidirectional export: dsh sessions can be exported to generic JSON / Markdown / transcript.
  • Privacy redaction detection: API Key / Phone Number / Email / ID Card / IP / Bank Card.
  • Knowledge extraction: Decisions / Code / Conventions can be consolidated into local memory with deduplication, connecting to the memory seam interface.
  • Web import wizard: Supports multi-select checkboxes, title options, and import result display.
  • Conversational discovery import tools: chat_import_discover / chat_import_import.
  • /session-import slash command: Supports files, directories, source filtering, redact, extract-knowledge.
  • sessionImport service: Available for other plugins or scripts to call.
  • REST API: Provides adapters / import / scan-dir / import-dir / import-paths / history.
  • bundle manifest: cordis.patch.yml and package.json#dsh.bundle.
  • Standalone development wizard: Optional use of npm run wizard.

Installation & Enablement

Runtime requirement: Node.js >=18.

First, execute the official installation command to add the plugin to the web profile:

dsh plugin --profile web add -w session-import

Here -w is required: pnpm 9.x’s workspace-root check requires this flag, and dsh plugin forwards pnpm arguments as-is.

After installation, the plugin loads as a dsh bundle plugin, providing commands, services, REST routes, and the Web import wizard. The plugin’s manifest includes cordis.patch.yml and package.json#dsh.bundle.

If installing locally via link, Windows users are recommended to use the link:<absolute-path> specifier. pnpm 9.x has known issues with file:D:/... absolute path resolution; registry installation is unaffected.

If maintainers need to publish to npm, they need to prepare an npm account.

Typical Usage

Below are several common entry points.

Slash Command

You can directly type in the Web UI:

/session-import <export_file_path> [--redact] [--extract-knowledge]

You can also import by path, directory, and source filtering:

/session-import C:\path\to\chatgpt\conversations.json          # Single file
/session-import C:\Users\PC\.codex\sessions                    # Directory (recursively scans all sessions)
/session-import C:\Users\PC\.codex\sessions --source codex     # Only import codex
/session-import <path> --redact --extract-knowledge            # Redact + Knowledge extraction

The command above will execute the import; if --redact is added, privacy redaction detection is performed; if --extract-knowledge is added, knowledge extraction is performed.

Web Import Wizard

The Web import wizard supports multi-select checkboxes, title options, and import result display. You can select session items in the interface, adjust title options, and view the imported results.

Conversational Discovery Import

The plugin provides conversational tools:

chat_import_discover
chat_import_import

Conversational discovery import is enabled by default. To disable model tools, you can set in the bundle config:

enableModelTools: false

REST API

The plugin exposes the following interfaces:

GET /api/session-import/adapters
POST /api/session-import/import
POST /api/session-import/scan-dir
POST /api/session-import/import-dir
POST /api/session-import/import-paths
GET /api/session-import/history

Among them, POST /api/session-import/scan-dir supports:

{ sourceFilter?, maxFiles? }

GET /api/session-import/adapters can be used to view registered sources. GET /api/session-import/history can be used to view import history.

sessionImport Service

Other plugins or scripts can call the service via ctx.get('sessionImport'):

const svc = ctx.get('sessionImport')
// { ingest, sources, detectSource, parseCount, scanDirectory, ingestDirectory }

const preview = await svc.scanDirectory('C:/Users/PC/.codex/sessions', { sourceFilter: ['codex'] })
const batch = await svc.ingestDirectory('C:/Users/PC/.codex/sessions', { sourceFilter: ['codex'], redact: true })

First perform scanDirectory to view scan results, then perform ingestDirectory to execute the import.

Standalone Development Wizard

If you do not have a complete dsh environment, you can also run the standalone development wizard:

npm run wizard

Data Location

The session body is written to the official dsh session-log. Archive files, import history, and local memory are written to:

$DSH_HOME/session-import/

To override the data directory, you can modify the bundle config:

dataDir

Scenarios & Notes

Suitable for scenarios where multiple agent tool sessions need to be migrated into dsh, especially for individuals or teams who want to continue chatting, export, redact, or extract knowledge later.

Notes before use:

  • The plugin runs with the current dsh process permissions, reading specified files or directories and writing to dsh sessions and related data directories; you should check the source code, dependencies, and MIT license before installation.
  • Privacy redaction detection covers API Key / Phone Number / Email / ID Card / IP / Bank Card; before exporting or sharing, it is still recommended to manually confirm sensitive information.
  • Knowledge extraction will be consolidated into local memory; before use, ensure the permissions of $DSH_HOME/session-import/ or the custom dataDir.

Resources

The directory page is an independent plugin directory, not equivalent to the official app store.

  • Directory Page: https://www.skillhub.cn/plugins/devmom/dsh-session-import
  • GitHub: https://github.com/devmom/dsh-session-import