Foreword

When developing agents within DeepSeek Harness (dsh), a common scenario is: historical conversations and custom agents are scattered across tools like pi, opencode, codex, and claude-code. After switching to dsh, manual copy-pasting or reconfiguring skills is often required. Session contexts, tool call trajectories, and project-level agent definitions usually cannot be transferred in one go.

Here we introduce dsh-import-agents (maintained by Chang-Tong). It imports the aforementioned four types of sessions, chat histories, and agents into dsh. Imported sessions appear in the session list, allowing you to continue the conversation with complete history; custom agents and mode prompts are converted into dsh skills. The plugin provides a one-click Sync button in the composer toolbar, supports slash commands, and prompts whether to migrate unimported history when starting a new session.

What is This

dsh-import-agents is a workflow plugin for dsh, published on npm (package name dsh-import-agents, current version 0.2.8), under the MIT license. It targets developers who have accumulated sessions and agents in pi, opencode, codex, or claude-code, aiming to restore resumable sessions in dsh and make agents discoverable as skills.

The data sources and formats are as follows:

Source Storage Format
pi JSONL
opencode SQLite
codex JSONL
claude-code JSONL

Imported sessions use stable IDs (e.g., pi-<uuid>, oc-<id>, codex-<id>, claude-<id>), and re-importing will skip existing items, ensuring overall idempotency.

Core Features

Four Sources, One Command

/import-all sequentially processes sessions from pi, opencode, codex, and claude-code, and converts pi/opencode agents and mode prompts into skills. You can also execute individually by source:

Command Purpose
/import-pi [options] Import pi sessions
/import-opencode [options] Import opencode sessions
/import-codex [options] Import codex sessions
/import-claude-code [options] Import claude-code sessions
/import-agents Convert pi/opencode agents to dsh skills
/import-all [options] All of the above
/attach-workspaces Attach imported sessions to workspaces matching the original cwd

Common options: --limit N, --project <substr>, --since <iso|ms>, --no-tools, --tools-as-text, --tool-truncate N.

Complete History for Resumable Conversations

Imported sessions open in dsh as native sessions: text, reasoning content, and tool calls are preserved, allowing the model to access the full context. The Trajectory tab renders cards for each tool call.

Agents Become Skills

Pi agents, mode prompts, and opencode agents are written to $DSH_AGENTS_HOME/skills, with source recorded in the frontmatter (metadata.source / metadata.kind).

One-click Sync and Startup Migration Prompt

The Sync button in the composer toolbar executes /import-all and displays results inline in the UI. When creating a new top-level session, if unimported history is detected, the plugin asks whether to migrate; the choice is remembered per project to avoid repeated prompts. This can be disabled via configuration config: { offerOnStart: false }.

Workspace Attribution

Imported sessions are attached to workspaces corresponding to the original cwd (created if non-existent). Titles include source markers (e.g., [pi], [opencode], [codex]). For existing imports, /attach-workspaces can be used to retroactively attach workspaces.

Zero Runtime Dependencies

The implementation relies only on Node built-in modules (node:zlib zstd, node:sqlite) and dsh platform modules, requiring Node >= 22.19.

Installation and Enabling

The plugin declares dsh.bundle and can be installed and activated with a single official command:

dsh plugin --profile web add dsh-import-agents

dsh plugin add installs the npm package and appends the plugin to the profile’s bundle list, requiring no manual configuration changes. After installation, restart dsh web and refresh the page. The Sync button should appear in the composer toolbar, and executing /import-all should respond.

You can also specify a version or source, for example:

dsh plugin --profile web add dsh-import-agents@0.2.4
dsh plugin --profile web add github:Chang-Tong/dsh-import-agents

Uninstallation example:

dsh plugin --profile web remove dsh-import-agents

Optional verification:

npm view dsh-import-agents version
pnpm list dsh-import-agents

Typical Usage

Web Interface

  1. Restart dsh web and refresh the page.
  2. Click Sync in the composer toolbar, or execute /import-all in the input box.
  3. Imported sessions appear in the session list (grouped by workspace); agents appear in the skill list.

You can run it multiple times; existing items will be skipped.

Standalone CLI (Independent of dsh Process)

The repository provides import.mjs for previewing or writing via the command line:

node import.mjs all                # Preview, no disk write
node import.mjs all --apply        # Write sessions and skills
node import.mjs sessions codex --apply --limit 20

Use Cases and Considerations

Who is this for: Developers migrating from pi, opencode, codex, or claude-code to dsh who wish to preserve conversation history, tool trajectories, and agent definitions, and continue the same project in dsh.

Permissions and Security: The plugin reads local session files and databases with the current dsh process permissions, and writes to dsh session and skill directories. Before installation, review the source code and MIT license to ensure source paths and data scope meet expectations. Source paths and defaults can be overridden via plugin configuration; see the Configuration section in the repository.

Ecosystem Note: dsh adopts a “everything is a plugin” extension approach; the plugin directory SkillHub is a community site with no official affiliation to DeepSeek / High-Flyer.

Conclusion

dsh-import-agents migrates sessions and agents from pi, opencode, codex, and claude-code into dsh, supporting slash commands, the composer Sync button, and session startup migration prompts. After import, conversations can be resumed and skills discovered. For more information, see the SkillHub directory page and the GitHub repository.