sunzeJAVA/dsh-session-importer ↗★ 0

dsh-session-importer

dsh plugin: import session records from other coding agents (Claude Code, Codex CLI, generic JSONL, Markdown) into the dsh session store 核心用途是实现多平台 AI 对话历史的统一归档。适合同时使用多种 AI 助手工具,并希望将分散的聊天记录、调试历史合并导入到 DSH 中统一管理的用户。

Package
dsh-session-importer
Compatibility
Unverified
Version
0.1.7
License
MIT
Last updated
Aug 17, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

Usage

In the web UI command palette (or any command surface):

/import-sessions [
] [--source auto|claude|codex|jsonl|markdown] [--cwd ] [--limit ] [--dry-run] [--retitle]
  • No — auto-discovers the known agent data directories listed above.

  • a file — imports that one transcript.

  • a directory — scans recursively for *.jsonl (*.md only with --source markdown).

  • --source — force a parser; default auto detects per file.

  • --cwd — override the recorded working directory of imported sessions.

  • --limit — cap messages per imported session (default unlimited).

  • --dry-run — scan, parse, and report without writing anything.

  • --retitle — backfill titles + sidebar projections for sessions imported by an older plugin version, without re-importing. Runs inside the host process (no restart needed). Run it once after upgrading the plugin:

    /import-sessions --retitle
    

Examples:

/import-sessions
/import-sessions ~/.claude/projects
/import-sessions /path/to/export.jsonl --source claude
/import-sessions /path/to/transcript.md --source markdown --cwd /path/to/project
/import-sessions --dry-run

Behavior notes

  • Idempotent: each source file maps to a deterministic session id (import- -, versioned — a parser fix bumps the hash input, so re-importing after an upgrade creates fresh sessions instead of being rejected as duplicates). Re-importing the same file unchanged is skipped as a duplicate, so running the command repeatedly is safe.
  • Durability: imports write directly through the dsh session-persistence backend (the same append-only, fsync-durable machinery the live agent path uses), so no live agent session is required and writes survive restarts.
  • Fidelity: tool calls are kept as tool-call content blocks plus tool/call + tool/result events (paired by id), mirroring native dsh sessions; Claude Code thinking blocks and Codex reasoning blocks are imported as reasoning content blocks so tool-heavy turns still show the model's reasoning; very long blocks are truncated (200 KB text / 100 KB tool results) to keep imports bounded.