sunzeJAVA/dsh-session-importer ↗★ 0
dsh-session-importer
DSH 插件:支持从 Claude Code、Codex CLI、通用 JSONL、Markdown 等其他 AI 编码代理导入会话记录到 DSH 中。
AI 分析
核心用途是实现多平台 AI 对话历史的统一归档。适合同时使用多种 AI 助手工具,并希望将分散的聊天记录、调试历史合并导入到 DSH 中统一管理的用户。
安裝
此插件尚未提供可驗證的 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.