dsh-purge: Implement real disk deletion for DSH sessions and workspaces

Introduction

There is a point in DSH’s session management that is easily overlooked: the built-in “Delete” doesn’t actually delete files. After deleting a workspace, the session is just removed from the grouping and drops into “Unassigned”; the session itself has no deletion entry at all because the core design only allows archiving sessions. Once a large amount of log directories accumulate on the disk and regular operations can’t clear them, a deletion method that actually touches the disk is needed. The dsh-purge introduced below is a plugin to fill this gap, classified as a client plugin, maintained by GitHub user Manbaout-08 (the npm package author is credited as CTTWang). It makes the deletion of sessions and workspaces real disk deletion, while providing a session menu entry and slash command.

What is it

One-sentence positioning: dsh-purge provides permanent deletion capabilities for sessions and workspaces for DeepSeek Harness (DSH), deleting actual files on the disk rather than un-registering them.

It solves two core problems:

  1. Sessions have no deletion entry and can only be archived; log directories remain on the disk.
  2. Workspace deletion only un-registers, leaving behind “Unassigned” residue, while disk files remain.

dsh-purge covers both web and desktop profiles. The current latest version is 1.0.1 with an MIT license.

Core Features

Entry Points

In the session row’s “⋯” menu, the plugin item is placed below “Copy Session ID” and is separated by a line. It should be noted here: DSH’s sidebar only exposes session-level slots, and the workspace row’s “⋯” menu cannot be extended, so the “Delete Workspace” entry is also attached to the session menu. The menu behavior is as follows:

Menu Item Behavior
Completely Delete Session Delete the session’s disk log directory + detach from workspace + archive and hide
Completely Delete Current Workspace Delete all sessions’ log directories under that workspace + delete workspace registration via Registry, sidebar disappears instantly

Slash Commands

Besides the menu, the plugin provides four commands suitable for scripting or keyboard operations:

/purge session <sessionId>        delete single session
/purge workspace <workspaceId>    delete workspace and all its sessions
/purge workspace-of <sessionId>   delete the workspace the session belongs to
/purge here                       delete current session

Deletion Behavior

  1. Workspace: Uses WorkspaceRegistry.delete() in the host memory, updates memory and workspace.json together, no need to refresh the page, and does not leave “Unassigned” residue.
  2. Session: The core has no API to delete sessions, and the memory directory of the sessions service cannot be removed. The actual method is “delete log files → detach → archive”: the files are actually gone, the row disappears from the main view, and there might only be an unopenable ghost entry left in “Archived Sessions”, which disappears completely after restarting DSH.
  3. Boundaries: The plugin only touches session logs and registration records; it never touches the workspace’s corresponding disk directory (i.e., your project files).

Deletion is Irreversible

Deletion is irreversible and has no trash bin. Please clearly see the object of the command before execution, especially /purge workspace which will delete all session logs under that workspace as well.

Installation and Usage

Installation

The official installation command is as follows:

npm i @manbaout-08/dsh-purge

Compatible ranges and runtime requirements are written in package.json:

DSH   >=0.2.0-rc.2 <0.3.0
profile  web / desktop
node   >=20.18

Enabling and Disabling

The plugin is registered via a patch, with a corresponding enabled: true switch in cordis.patch.yml. To disable, choose one of the following three options:

  1. Change enabled: true to false in cordis.patch.yml;
  2. Disable dsh-purge in the plugin manager;
  3. Delete node_modules/dsh-purge and the corresponding paragraph in the patch.

Installation Location

The plugin consists of a host part and a client part. The source code and runtime paths are as follows:

Source     <workspace>\purge-plugin\
Installed  %USERPROFILE%\.dsh\profiles\desktop\node_modules\dsh-purge\
Config     %USERPROFILE%\.dsh\profiles\desktop\cordis.patch.yml

After modifying the source code, you need to copy it to the installed directory and restart DSH for it to take effect. The client module does not support hot reloading. The responsibilities of related files are as follows:

index.js           Host: delete engine + /purge command
client.js          Browser: menu items + custom-drawn dialog
cordis.patch.yml   Plugin registration line
locale/{zh,en}.json Name and description displayed in plugin manager
icon.svg           Icon
test.mjs           Delete engine unit test (node test.mjs)

Typical Usage

Taking the desktop scenario as an example, the operation path is as follows.

  1. See a session you no longer need, click the “⋯” menu in the session row, and select “Completely Delete Session”. After confirming in the dialog, the disk log directory is deleted, the session is detached from the workspace and archived/hid.

  2. If you want to clean up the entire workspace, select “Completely Delete Current Workspace” in the same menu. The plugin will delete all sessions’ log directories under that workspace and delete the registration via WorkspaceRegistry.delete(), causing the sidebar to disappear instantly.

  3. If you prefer commands, use the slash commands to perform the same operations:

/purge here
/purge session <sessionId>
/purge workspace-of <sessionId>
  1. Unit tests can be executed in the source code directory:
node test.mjs

Suitable Scenarios and Notes

Suitable for the following types of people:

  1. Developers who need to truly clear obsolete session logs and free up disk space on the web or desktop;
  2. Developers who want to batch clean sessions or workspaces using slash commands;
  3. Users who know that DSH’s built-in deletion only un-registers and are willing to use a plugin to supplement real deletion capabilities.

Special attention needs to be paid when using:

  1. The plugin runs with the permissions of the current dsh process and deletes real files. Before installing, you should check the source code and license yourself, and confirm before enabling.
  2. Deletion is irreversible and has no trash bin; the plugin only deletes session logs and registration records, and the workspace disk directory will not be touched.
  3. After a session is deleted, its ID may briefly remain in the archive collection, but it will be cleared after restarting DSH. This is a known limitation, not data lingering on the disk.
  4. The workspace deletion entry is attached to the session menu due to the sidebar slot limitation; when using it, pay attention to ensure you have selected the session and not the workspace row.

Summary

dsh-purge has a very focused scope: it fills the gap of DSH’s deletion behavior—which can only archive or un-register—by making it actually touch the disk, while retaining both menu and slash command entry points. It does not touch project files and does not provide a trash bin, making it suitable for developers who are clear about the consequences before using it.

Related Links:

  • Community Directory: https://www.skillhub.cn/plugins/Manbaout-08/dsh-purge
  • GitHub: https://github.com/Manbaout-08/dsh-purge

Note: The community directory is an independent site with no official affiliation to DeepSeek / Hypothesis, and is not an official app store.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye