Preface¶
The DeepSeek Harness (DSH) sidebar accumulates a large number of Sessions: debugged conversations, forked branches, and workspace bindings that are no longer in use. Renaming and archiving can organize the list, but the official Session-related interfaces do not expose a “delete” option: sessionController, sessionPersistence, and the client-side sessions module each handle creation, querying, persistence, and projection refresh, yet none provide the ability to completely remove a Session from the disk and the UI. workspaceRegistry.delete only removes Workspace registrations, deliberately retaining the directory and all Session logs.
If you wish to clear a Session from the sidebar just like deleting a regular list item—while simultaneously removing its append-only logs and projection cache—you need to assemble operations in the correct order on the official seams. The community plugin dsh-session-delete (maintainer: Smile-Wood, Category: Client) does exactly one thing: it adds a Delete Session option to the ... menu of each Session in the sidebar. Upon execution, it removes the row without requiring a full page refresh and deletes the corresponding persistent files under $DSH_HOME.
What is this¶
dsh-session-delete is a DSH profile bundle plugin. The Host side registers a loopback route POST /plugins/session-delete/delete; the browser side adds a delete action to each Session menu and calls this route. Upon selecting deletion, it permanently removes the stored logs and projection cache of the Session and removes the corresponding row from the sidebar.
The current version of the plugin is 1.0.0 (see the repository’s package.json), licensed under MIT, and requires Node >= 22. The README explicitly states: This project was written by AI. Although it has been reviewed and tested on a real DSH installation before release, it should still be treated as AI-generated software—read the source code before running it, and expect potential roughness in uncovered paths.
Why a separate plugin is needed¶
Contrasting with the DSH version it was based on, the README summarizes “what the candidate APIs can actually do”:
| Candidate | Actual Capabilities |
|---|---|
sessionController (Host ctx.remote.session) |
resolveAgent / inspect / list / search / create / selectModel / rename / fork / prompt / cancel / page / projections — No delete |
sessionPersistence |
create / open / flush / stat / list — Append-only logs, No delete |
workspaceRegistry.delete(id) |
Deletes Workspace registration but retains the directory and all Session logs |
sessions (Client) |
retain / using / refreshProjections / search / fork / scope / binding — No delete |
Therefore, “Delete Session” in the sidebar can only be achieved by combining official interfaces in a specific order; this plugin does not extend any other functionality.
What happens during deletion¶
The deletion process consists of five steps on the Host:
- Stop Session —
workspaceRegistry.archiveSession(id, { stopActivity: true }), following the official activity stop path, and fanning outworkspace/session-stop(listened to bydsh-agent,dsh-jobs,dsh-schedule,dsh-subagent, etc.). - Detach Active Session —
ctx.sessions.store.get(id).detach(), triggeringsession/disposedvia the entry’sdetach. - Remove Sidebar Row —
session/disposed→api-session/removed(dsh-api-session-controller) → Clientctx.remote.$on("api-session/removed", …). For cold starts, or Sessions restored only from disk and never opened by the current process, there is no store entry, sodetachcannot be triggered; the plugin directly emits anapi-session/removedwith the same name (no listener on the Host side, so no side effects). - Clean Up Membership — For each Workspace, execute
detachSession, plusunarchiveSessionandunpinSessionto avoid residual ghost items from archiving or pinning. - Delete Disk Data — Remove artifacts under
$DSH_HOME/sessions/<encoded-cwd>/<id>/and$DSH_HOME/storages/session_projcache/sessions/<id>.json.
The SQLite session index is derived from the persistent state and will converge on the next reconcile; the plugin does not directly modify the index.
Involved Disk Paths¶
The default $DSH_HOME is ~/.dsh:
$DSH_HOME/
sessions/<encoded-cwd>/<session-id>/session.v4.jsonl[.zstd] <- Deleted
storages/session_projcache/sessions/<session-id>.json <- Deleted
storages/workspace.json <- In-place update of membership
Installation and Activation¶
The plugin is installed as a profile bundle using the built-in dsh plugin command (which internally forwards to pnpm within $DSH_HOME/profiles/<profile>/). dsh is a shim for the packaged CLI and will only appear in the PATH after DSH Desktop has been started at least once. Please use the profile corresponding to how you actually started DSH (Desktop defaults to web; omitting --profile also assumes web).
Install from a public GitHub repository:
dsh plugin --profile web add github:Smile-Wood/dsh-session-delete
Install from a local directory (the example uses a Windows path; replace it with your checkout location):
dsh plugin --profile web add C:\path\to\dsh-session-delete
For private repositories or non-github: shorthand, the README suggests using explicit HTTPS and authenticating via the git credential helper:
dsh plugin --profile web add git+https://github.com/Smile-Wood/dsh-session-delete.git
After installation is complete, reload the DSH page in your browser to load the browser bundle; no restart of the DSH process is required. Open the ... menu of a Session in the sidebar, and you should see the delete action.
Update: Running add again for the same repository acts as an update path (pnpm re-resolves the ref, changed files enter the new content-addressed store, and the Host loads the new module URL):
dsh plugin --profile web add github:Smile-Wood/dsh-session-delete
Uninstall:
dsh plugin --profile web remove dsh-session-delete
This will prune dependencies, remove the name from dsh.profile.bundles, and uninstall both the Host and client halves. For local link: installations, the symlink at $DSH_HOME/profiles/<profile>/node_modules/dsh-session-delete may remain after remove (no functional impact; it can be manually deleted if needed).
Dependencies must be declared in package.json with dsh.bundle.patch to enter the profile layer; cordis.patch.yml inserts an entry with the id session-delete and the name dsh-session-delete. The registration name in client.js must match the name in package.json exactly, otherwise the menu row may not appear silently.
Typical Usage¶
- Add the plugin to the
webprofile (or your active profile) using the commands in the previous section. - Refresh the DSH page in the browser.
- Select the Session to clean up in the sidebar, open the
...menu for that row, and select Delete Session. - After confirmation: The sidebar row disappears (no full page reload needed), and the corresponding session directory and projection cache are deleted from
$DSH_HOME.
There are no additional configuration files or environment variables; the behavior is entirely driven by the menu action and the Host route.
Use Cases and Notes¶
Who it is for: Developers who keep many Sessions open in DSH for long periods and need to truly free up disk space and remove sidebar noise. It is categorized as a Client plugin, integrating with the Web/Desktop sidebar UI.
Permissions and Trust: The plugin deletes files within $DSH_HOME under the permissions of the current DSH Host process. Deletion cannot be undone via the official API; please confirm the Session is no longer needed before executing. Read the GitHub source code and the MIT license before installation.
Ecosystem Note: DSH adopts an “everything is a plugin” extension approach; the SkillHub directory page is a community listing site and has no official affiliation with DeepSeek or Quantum Universe (HuanFang). The installation commands and behavior descriptions in this article are based on the repository’s README.
Others: Only public repositories can be used directly via github:Smile-Wood/dsh-session-delete; if outbound SSH port 22 is blocked, the SSH fallback by pnpm may fail. The removal behavior differs slightly between local path installations and git installations (see the installation section).
Links¶
- Directory Page: https://www.skillhub.cn/plugins/Smile-Wood/dsh-session-delete
- Source Code and Full Description: https://github.com/Smile-Wood/dsh-session-delete
If your pain point is “DSH lacks a Delete Session API, but Sessions keep accumulating in the sidebar and on disk,” this plugin fills in the deletion action and persistence cleanup on the official seams; install it with a single dsh plugin --profile web add command, refresh the page, and use it in the ... menu.