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
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 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(*.mdonly with--source markdown). -
--source— force a parser; defaultautodetects 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-callcontent blocks plustool/call+tool/resultevents (paired by id), mirroring native dsh sessions; Claude Codethinkingblocks and Codexreasoningblocks are imported asreasoningcontent 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.