Preface¶
Running agents long-term in DeepSeek Harness (DSH) accumulates a large number of sessions. Clicking “Permanently Delete” in the sidebar removes the log directory from the disk and clears workspace memberships; if not exported or copied beforehand, conversation records are lost forever. Manual backups are easy to miss, and bulk deletion makes it even harder to guarantee “a copy is saved for every single one first.”
dsh-session-backup is a user plugin published by community maintainer overspread. It is mounted in your profile without modifying the installed harness body. It silently writes a backup before confirming permanent deletion, adds multi-select and batch backup/delete capabilities to the session list, and provides backup management with one-click restore. Since version 0.2.0, the permanent delete menu, confirmation dialogs, and cascading deletions are also implemented by the plugin itself, retaining the same deletion and backup behavior after upgrading the upstream harness.
What is this¶
In short: dsh-session-backup automatically backs up sessions before deletion in the Web GUI, supports batch selection and restoration, and takes over the “permanent delete” chain as a plugin.
- Maintainer: overspread
- Category (Directory): Memory
- License: MIT
- Current Package Version (npm): 0.3.0
- Code & Instructions: GitHub - overspread/dsh-session-backup
- Community Directory Page: skillhub.cn/plugins/overspread/dsh-session-backup
This is a personal community plugin, not developed, endorsed, or supported by DeepSeek, nor is it part of the DSH distribution; its read/write scope is limited to your own $DSH_HOME.
Core Features¶
The following explains “where to see it” and “what it does behind the scenes.”
Automatic Backup on Deletion¶
When confirming Permanently Delete…, the plugin silently creates a backup first; there is no separate prompt step on the interface. Single deletion and batch deletion share the same logic: there will be no “deleted without backup” situations in a batch of sessions. If the backup route returns a real error (e.g., disk full), the deletion will be rejected and an error will pop up; only situations like “session has no directory left to back up” or “profile lacks Host face” will allow deletion even without a copy to duplicate.
Multi-select & Batch Backup/Delete¶
- Bottom of Sidebar: Multi-select
- Each Row: Checkbox
- Each Session “…” Menu: Select / Add to Selection
Blank placeholder rows (temporary “New Session” rows) and archived rows do not have checkboxes and cannot be selected.
Backup Management & One-click Restore¶
Click Backup at the bottom of the sidebar to open the backup manager, where one-click restoration is available. Upon successful restoration, the backup is deleted (restore implies retrieval); if the original workspace no longer exists, the session will appear under “Ungrouped” in the sidebar. If a session with the same ID already exists again, restoration returns a 409, and the backup is preserved as is.
Permanent Deletion (Provided by plugin since 0.2.0)¶
Deletion no longer relies on the kernel’s deleteSession wrapper; steps such as menu rows, confirmation dialogs, activity gates (409 escalation), stopping agents/jobs, clearing schedules, deleting log directories and caches, and emitting api-session/removed are all completed within the plugin. Attachments are content-addressed blobs and are not deleted when the session is deleted (compliant with spec A5).
Backup Storage Location¶
Backups are written under the $DSH_HOME corresponding to the profile:
$DSH_HOME/backups/sessions/<sessionId>/<timestamp>-<title>/
├── session.v4.jsonl.zstd # Verbatim copy of session directory
├── …
└── backup.json # Manifest: sessionId, title, createdAt, sourcePath, size
The directory name consists of a local timestamp and the current title (sanitized for the file system, max 48 characters; untitled if no title). session.lock and .DS_Store are not included in the backup; backup.json is also not copied back to the session directory during restoration.
HTTP API (Host /api)¶
The browser accesses via relative paths, with five JSON routes total:
| Method | Path | Function |
|---|---|---|
GET |
/api/session.backup.list |
List backups, newest first |
POST |
/api/session.backup.create |
Create backup for specified sessionId |
POST |
/api/session.backup.delete |
Permanent delete with backup priority |
POST |
/api/session.backup.restore |
Restore by path; success usually consumes the backup |
POST |
/api/session.backup.remove |
Delete backup entry |
Path validation ensures requests cannot escape the backup root directory. Before copying a running session, the host flushes logs to disk first (similar barrier to dsh-session-log-export) and marks copies that cannot be stably replicated in the manifest (consistent: false).
Installation & Activation¶
Installation commands follow the README original text. Choose one of the following sources:
From npm:
dsh plugin --profile <your-profile> add dsh-session-backup
From GitHub (can pin version with tag or commit):
dsh plugin --profile <your-profile> add github:overspread/dsh-session-backup
From local path:
dsh plugin --profile <your-profile> add /path/to/session-backup
dsh --profile <your-profile> --dump-config # Should see the "# == dsh-session-backup" layer
Then restart dsh web. The host caches the client package path resolved by the plugin; adding, removing, or changing the pointer to exports["./client"] will only take effect after a fresh start.
Uninstallation:
dsh plugin --profile <name> remove dsh-session-backup
The plugin is located at ~/.dsh/profiles/<name>; upgrading dsh will not automatically uninstall it.
Typical Usage¶
- Install and restart the Web service as described in the previous section.
- Daily deletion: Select permanent delete in the session row menu; after confirmation, it automatically backs up then deletes; no extra click on “Backup” is needed.
- Batch processing: Click Multi-select in the sidebar, check multiple sessions, and execute batch backup or batch delete (backups are still performed one by one before deletion).
- Recovering records: Sidebar Backup → Select entry → One-click restore; if the original workspace’s
cwdstill matches, the session will be re-attached to that workspace, otherwise it goes to “Ungrouped”.
Applicable Scenarios & Notes¶
Suitable for developers who frequently clean up sessions in DSH Web but wish to keep a local copy by default before deletion. Also suitable for scenarios requiring batch organization of the sidebar or occasionally pulling a specific conversation back from a backup.
Please note before use:
- The plugin reads and writes to the disk with the permissions of the current
dshprocess; please review the source code and MIT license before installation. - The space occupied by backups is related to the size of session logs; you need to monitor
$DSH_HOME/backupsyourself. - Peer dependency
@deepseek-ai/cordis(in package.json as~4.0.5-alpha.2), needs to be compatible with the harness version used. - The community directory skillhub.cn has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem emphasizes “everything is a plugin,” and this package is one such example.
Conclusion¶
dsh-session-backup binds “backup before delete, batch selection, one-click restore” with plugin-implemented permanent deletion together, reducing the risk of accidentally deleting session logs. For further information, see the community directory overspread/dsh-session-backup and the repository GitHub.