Introduction¶
DeepSeek Harness (DSH) can archive sessions, rename, and restore them, but by default does not wipe data on disk. As archives accumulate over time, transcripts, projection caches, and sub-agent session files in %USERPROFILE%\.dsh (or the directory pointed to by DSH_HOME) keep being retained; if in the sidebar you only delete files without updating the registry and in-memory state, you may end up with unopenable “ghost rows”. Below we introduce the community plugin dsh-true-delete (repository YIYuNCU/DSHTrueDelete), published by maintainer YIYuNCU, which, after confirmation, completes the full flow of “list manifest → delete files → clear registry and live session → refresh list”.
What Is This¶
dsh-true-delete is a Cordis plugin package for DSH (npm name dsh-true-delete, version 0.2.1 in the current materials, MIT license). It adds Delete local files… (displayed according to locale in Chinese environments) to the … menu of archived sessions, first showing the actual paths and sizes that will be deleted, then deleting after a secondary confirmation, and synchronously cleaning up the workspace registry and live session so that the corresponding row in the sidebar disappears.
Community directory page: skillhub.cn/plugins/YIYuNCU/DSHTrueDelete. This directory is an independent community site with no official affiliation with DeepSeek / Huanfang; the DSH ecosystem emphasizes “everything is a plugin”, and this plugin is one such example.
Core Features¶
Menu and Confirmation Flow¶
For archived sessions, the … menu has an additional item Delete local files… below Rename, Fork, and Unarchive. Clicking it opens a read-only list: the paths to be removed on the local machine, the size of each path, and the number of included sub-agent sessions; no files are modified until Delete permanently is pressed. It can be cancelled at any time.
Delete Scope¶
| Object | Path (<DSH_HOME> defaults to %USERPROFILE%\.dsh) |
Description |
|---|---|---|
| Session transcript | <DSH_HOME>/sessions/<encoded-cwd>/<sessionId>/ |
Contains each generation’s session[.vN].jsonl.zstd and *.tmp crash residue |
| Projection cache | <DSH_HOME>/storages/session_projcache/sessions/<sessionId>.json |
Derived data such as title, statistics, todos, plan; the .bak.* of corrupted records is deleted as well |
| Sub-agent sessions | For the above two path types, repeated for each childId in the parent session’s subagentCatalog |
Sub-agents have no independent sidebar entries; they are cleaned up only along with the parent session |
After deleting the files, the plugin also: removes the id from the workspace registry (archive set, pin set, workspace membership), releases the live session object, discards the projection cache record, and waits about 0.25 seconds before re-checking the same path, to avoid shutdown flush or write-behind quietly recreating the directory after deletion.
Security Boundaries (key points from the original materials)¶
- Only archived sessions; unarchived sessions or sessions that still have running work will be rejected.
- Does not touch content shared across sessions (such as content-addressed attachments, request-image caches); does not handle the old-layout
session_projcache.json. - After path resolution, it must fall within
$DSH_HOME, and the session id must match exactly. - Host routing restricts cross-site requests, requires origin matching; write operations only accept loopback, and follow DSH’s browser authentication fence.
- Repeated operations on already-deleted sessions will prompt that there are no local files, but residual registry references will still be cleaned up.
Installation and Activation¶
Installation requires two steps to be completed simultaneously: the package enters the profile’s node_modules, and the name is written into dsh.profile.bundles. Settings → Plugins can complete both in one go; the command line only completes the first step, so enable-bundle.mjs must also be run. After installation, restart DSH once (the plugin’s Host is loaded at startup).
By package name (when the registry is available):
"%ProgramFiles%\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add dsh-true-delete
node "%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-true-delete\scripts\enable-bundle.mjs" desktop
From the Git repository (no registry needed, suitable for when it is not yet officially released):
"%ProgramFiles%\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add github:YIYuNCU/DSHTrueDelete
node "%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-true-delete\scripts\enable-bundle.mjs" desktop
Local directory link (checkout or offline package; adjust the path as actual):
"%ProgramFiles%\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add link:G:\Code\DSH\DSH-True-Delete
node G:\Code\DSH\DSH-True-Delete\scripts\enable-bundle.mjs desktop
enable-bundle.mjs reads $DSH_HOME (default %USERPROFILE%\.dsh), cleans up any residual pre-rename entries, and only writes to the bundle list.
package.json declares peerDependencies as @deepseek-ai/dsh ^0.2.0-rc.2 (optional). If a prompt about incompatibility with the current DSH runtime appears, you need to use commands such as dsh plugin --profile desktop allow-version as described in the README to explicitly accept the risk, or upgrade/align the runtime.
If installing by package name reports declares no dsh.bundle: the materials explain that the registry may temporarily resolve to a placeholder stub; you can instead use github:YIYuNCU/DSHTrueDelete or a local link, and follow the README to handle npm stage-related issues.
Typical Usage¶
- Archive the session, or select a session that is already in archived state (unarchived rows will not show a delete entry).
- Open the
…menu of that row and choose Delete local files…. - Read the paths, sizes, and sub-agent count in the dialog.
- After confirming everything is correct, click Delete permanently; a toast will report the number of deleted files and the amount of data.
- After the page re-fetches the list, the row disappears from the sidebar.
If the row still remains after deletion, and the version running is before 0.2.0: older versions only deleted files without releasing the live session; restart DSH or delete once more (the materials are based on 0.2.0+ behavior).
Applicable Scenarios and Notes¶
Suitable for: needing to regularly clean up the local disk occupied by archived sessions; wanting the sidebar and registry to remain consistent after deletion rather than leaving unopenable residual rows; when a parent session has sub-agents attached, needing to delete their transcripts and caches together.
Notes:
- The plugin runs with the current dsh process privileges, deleting data within the local
$DSH_HOMEthat has been verified to belong to that session id; before installing, please review the source code and MIT license yourself. - Deletion cannot be recovered through this plugin; shared attachments will not be accidentally affected by dedupe storage due to single-session deletion, but the session-specific transcript and projection cache will disappear permanently.
- If the menu item is missing: confirm
dsh-true-deleteis indsh.profile.bundles(you can rerunenable-bundle.mjs), and restart DSH; the entry only appears on archived rows.
For uninstallation and other troubleshooting, see the Uninstall / Troubleshooting sections in the repository README.
Conclusion¶
dsh-true-delete fills the gap in DSH’s archive model of “truly removing local session data”: the manifest is transparent, only archived sessions can be operated on, and files along with registry/live state are wrapped up together. For further information and issue feedback:
- Community directory: https://www.skillhub.cn/plugins/YIYuNCU/DSHTrueDelete
- GitHub: https://github.com/YIYuNCU/DSHTrueDelete