sunzeJAVA/dsh-session-importer0

dsh-session-importer

dsh plugin: import session records from other coding agents (Claude Code, Codex CLI, generic JSONL, Markdown) into the dsh session store

包名
dsh-session-importer
版本
0.1.7
许可证
MIT
最近更新
2026年8月17日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 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.