Rolling, integrity-verified backups of each session at turn boundaries: verifies the log still loads before promoting a snapshot, never overwrites the last good one when a turn ends corrupt, and restores in one command even when dsh will not boot.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:po-et/dsh-session-snapshot
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
Rolling, integrity-verified backups of every DeepSeek Harness session — so corruption costs at most the in-flight turn.
Part of a three-piece session-integrity suite:
| Stage | Plugin | Role |
|---|---|---|
| Prevent | dsh-session-guard | stop two dsh processes from corrupting one session |
| Snapshot | dsh-session-snapshot (this) | keep a verified good copy at every turn boundary |
| Repair | dsh-session-rescue | fix or salvage a log that already broke |
Why it exists
dsh-session-guard prevents the common concurrent-write corruption, but two cases stay outside any plugin's reach: a crash mid-write, and dsh's own cold-load repair path that runs before any agent step. This plugin closes that residual gap from the other side. After each turn ends it verifies the live log still loads and, if so, promotes it to a snapshot. When a turn ends with the log already corrupt, it does not overwrite the last good snapshot and tells you how to recover — losing at most the one turn in flight.
Install
Not on npm yet, so install straight from GitHub. pnpm will ask you to allow this package's build script once (dsh prints the exact line to add); that's the
preparestep compiling TypeScript.
dsh plugin --profile web add github:po-et/dsh-session-snapshot
That's it — the plugin snapshots automatically at turn boundaries. Using an AI agent? Tell it: "Install the dsh-session-snapshot plugin."
Recover a broken session
The CLI works even when dsh itself won't boot:
npx github:po-et/dsh-session-snapshot # list snapshots + live health for every session
npx github:po-et/dsh-session-snapshot list 37374e34 # snapshots for one session (id fragment)
npx github:po-et/dsh-session-snapshot restore 37374e34 # restore the newest verified snapshot
npx github:po-et/dsh-session-snapshot snapshot 37374e34 # take one right now
restore always preserves the current file as <artifact>.pre-restore-<time> first, and refuses any snapshot that does not itself verify as loadable. Use --at <epoch> (shown in list) to restore a specific snapshot instead of the newest.
Configuration
- id: session-snapshot
name: dsh-session-snapshot
config:
keep: 5 # snapshots kept per session before the oldest is pruned
minIntervalMs: 0 # minimum ms between snapshots of one session (0 = every changed turn)
# home: /custom # default: $DSH_HOME (~/.dsh)
Snapshots live under $DSH_HOME/session-snapshots/<session-id>/ and are only taken when the log grew and still verifies, so an unchanged or already-corrupt session never spends I/O or overwrites a good copy.
Cost & honest scope
- Each snapshot is a file copy plus one verification scan of the session log. Turns are seconds-to-minutes apart, so this is cheap in practice; raise
minIntervalMsfor very large sessions if you want to bound it further. - Snapshots are point-in-time copies of the session log only — they do not snapshot your workspace files. For conversation+file rollback, that's a different tool.
- Supports session format version 0 (current dsh developer preview),
.jsonland.jsonl.zstd, JSONL backend. Compression is detected by content, so renamed/backup copies verify correctly. dsh is pre-1.0 with no format-compatibility promise; on an unknown version the tool refuses loudly rather than guessing.
Zero runtime dependencies (zstd via Node's built-in zlib). MIT.
Links
More in this category
Minglink/dsh-infinite-gen-4★ 3277
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
ranxianglei/billion-context★ 2276
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
liangmianya/dsh-synapse★ 557
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
Nwflower/dsh-chat-import★ 246
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
MichengAI/dsh-archive-manager★ 198
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
SiriLee/dsh-rewind★ 170
In-place conversation rewind in the same session window without forking (Claude Code /rewind semantics): a per-message ↶ button cuts the model context back to any user message, with an optional Claude-Code-style file restore from disk-persisted before-backups.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.