Preface¶
DeepSeek Harness (DSH) can archive sessions, but it does not truly delete them: archived logs remain in ~/.dsh/sessions, and the corresponding session folders under the project directory are not cleaned up either. This leads to storage bloat and a cluttered mix of historical sessions, making maintenance difficult.
Plugin Overview¶
dsh-session-delete (wadwaw7/dsh-session-delete) is a memory-type plugin that performs precise matching based on the thread_id in .session.json, synchronously cleaning up session storage, workspace records, and session folders under the project directory.
Core Features¶
- Three-sided cleanup: deletes session storage (
<sessionPersistence.root>/<workspace>/<sessionId>/), releases workspace records (workspace.detachSession(id)and removes fromarchivedSessionIds), and deletes project session folders. - Precise matching: only matches folders where
provider=dshandthread_id === sessionIdin.session.json; does not rely on titles or dates, avoiding accidental deletion of other sessions in the same workspace. - Safety boundaries: refuses to delete targets that are running / in maintenance / have queued input / have associated tasks; before deletion, checks load, write locks, unique storage, and directory boundaries (rejects symlinks / junctions).
- Configuration: supports
sessionFolders, defaulting to["会话"].
Installation & Enablement¶
Installation via the Marketplace is recommended:
- Open DSH Settings → Plugin Marketplace.
- Search for
dsh-session-delete. - Click Install and restart DSH.
Manual installation:
- Create a directory junction in PowerShell:
cmd /c mklink /J "%USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-session-delete" "<this repo>"
- Add the following two entries to the corresponding profile’s
package.json(both are required):
{
"dependencies": { "dsh-session-delete": "link:<this repo>" },
"dsh": { "profile": { "bundles": ["…", "dsh-session-delete"] } }
}
Typical Usage¶
- Sidebar session row context menu → Delete session (deletes after confirmation, recommended).
- Command line:
/list-sessionslists all sessions and their archive status;/delete-session <sessionId>deletes a specified session;/purge-archivedcleans up all archived sessions.
Use Cases & Notes¶
- Ideal for developers who need thorough session cleanup and want to maintain clean project directories.
- The plugin runs with the current DSH process’s permissions; it checks load and write locks before deletion and will not automatically cancel running work.
- It is recommended to review the source code and license (MIT) before installation.
Conclusion¶
dsh-session-delete provides complete session cleanup capabilities, with precise matching via thread_id and multiple safety checks to reduce the risk of accidental deletion. Its implementation is entirely local with no cloud dependencies. See the directory page and repository for more details.
References¶
- https://www.skillhub.cn/plugins/wadwaw7/dsh-session-delete
- https://github.com/wadwaw7/dsh-session-delete