dsh-shredder: Permanently Delete Archived Sessions in the Native Session Menu

Introduction

DeepSeek Harness (dsh) retains log directories and archive records after archiving sessions to facilitate future unarchiving. Over time, the archive area accumulates sessions that are confirmed to be no longer needed, taking up disk space and cluttering the list, while the host itself does not provide a “permanently delete from archive” action. The community has plugins with archive panels and bulk operations; if you simply want to add a “cut” in the session row’s own “…” menu without extra panels or sidebars, dsh-shredder is the client bundle plugin targeting this gap.

What is this

dsh-shredder is maintained by the community organization LEEKINBUN-dsh-tools, with the current npm package version being 0.2.1 (MIT). It is not an official DeepSeek product. It injects into the client via a Cordis bundle: adding a red Shred session row immediately below Unarchive in the native session row “…” menu. This option appears only when the session is archived; normal, unarchived sessions will not see a delete option here.

The archive list is still managed via dsh’s built-in workspace view and the View options → hide / show / only archived filters. This plugin does not create a separate archive page, sidebar entry, or bulk delete functionality.

Core Functionality

The following behaviors are documented in the README and can be verified against the GitHub repository.

  1. Open the “…” menu on an archived session row.
  2. Click Shred session; after the first click, the text changes to Confirm permanent delete.
  3. Click a second time to execute the deletion; closing the menu resets the confirmation state.

Deletion Effects

  • On success, the session disappears from the workspace list, the ungrouped list, and the archive collection.
  • If the log directory does not exist but the ID remains in the archive collection (a stale archive record), the same menu item changes to Clear record only, with a corresponding prompt.

Deliberately Omitted Capabilities

  • No archive panel, no extra pages, no sidebar items; no bulk deletion, search, preview, or restore-then-open.
  • No trash can, no undo. “Shred” refers to unlinking the session directory from the file system, not overwriting disk blocks; recovery depends on file recovery tools and success is not guaranteed.

Implementation Summary (for troubleshooting)

The host-side lib/index.js provides a loopback HTTP service; the client-side lib/client.js injects the menu row at sidebar.workspaces.session.menu.item (order: 450). The deletion API:

Method Path Body Result
POST /dsh-shredder/delete { sessionId } { ok, action: 'deleted' \| 'record-only', … }

The deletion sequence includes: stopping tasks via the official workspace/session-stop, flushing, evicting the instance from the session store, WorkspaceEntity.detachSession, deleting <session root>/<project>/<id>/, and then unarchiveSession to clear archive records. It also performs background re-checks at +2s / +6s / +15s to prevent late flushes from writing the directory back.

Environment and Requirements

  • Verified by the author on dsh 0.2.0-rc.2; older hosts may be supported via a fallback path (capabilities limited if the public unarchiveSession is missing), but the current release is the standard.
  • Requires a profile that loads bundles (the desktop / web provided with dsh).
  • Node >= 20 (see engines in package.json).

Installation and Enablement

The installation method follows the README: declare a file: dependency in the profile’s package.json, add the bundle name to dsh.profile.bundles, and then use dsh’s built-in pnpm to install. Bundles are resolved at process startup; refreshing the page is not enough. You must restart dsh.

  1. Place the plugin source code in a stable directory, e.g., C:\plugins\dsh-shredder (keep the path consistent with the JSON and pnpm parameters below).

  2. Edit the profile manifest: ~/.dsh/profiles/<profile>/package.json, adding the dependency and bundle:

{
  "dependencies": { "dsh-shredder": "file:C:/plugins/dsh-shredder" },
  "dsh": { "profile": { "bundles": [ /* …existing bundles…, */ "dsh-shredder" ] } }
}
  1. Use the pnpm located in the dsh installation directory to install, then restart dsh. The desktop profile is generally desktop; in this environment, dsh --profile desktop --dump-config is rejected (managed exclusively by Electron). You can verify the appearance of the delete row by restarting and opening the “…” menu of an archived session:
& "<dsh install>\resources\runtime\pnpm\bin\pnpm.cjs" --dir "$HOME\.dsh\profiles\<profile>" add "file:C:/plugins/dsh-shredder"
  1. Typical verification: Archive a session → Open its “…” menu → Shred session → Click twice consecutively.

Updating after modifying local source code

The file: dependency is installed as a copy, not a symbolic link. Simply deleting node_modules and running pnpm install may not re-copy it (pnpm might report “Already up to date,” causing the plugin to silently fail to mount). You should re-declare the dependency and confirm the output includes Packages: +1. If necessary, compare the sha256 of lib/*.js on both sides before restarting:

Remove-Item "$HOME\.dsh\profiles\<profile>\node_modules\dsh-shredder" -Recurse -Force
& "<pnpm.cjs>" --dir "$HOME\.dsh\profiles\<profile>" add "file:C:/plugins/dsh-shredder"

Uninstallation

Remove the corresponding entries from dependencies and dsh.profile.bundles, then run the install command again and restart. If you only want to stop mounting without removing the dependency, you can remove only the bundles entry. Do not use disabled: true with an ID that does not exist in the tree, otherwise patch: entry "shredder" not found will appear in stderr at every startup.

Typical Usage

  1. Archive a session in dsh (archived sessions can still be seen via view filters within the corresponding workspace).
  2. Open the “…” menu on that session row and confirm that the red delete row appears (it does not appear for unarchived sessions).
  3. The first click enters the confirmation state, and the second click executes; if you need to retain the content, be sure to export the session or logs yourself beforehand.

Use Cases and Notes

Who it is for: Desktop or Web profile users who are already using dsh’s native archiving flow, occasionally need to permanently clean up individual archived sessions, and want the operation to remain within the session row menu.

Permissions and Security: The plugin runs with the permissions of the current dsh process and deletes local (or currently visible to the host) session directories. Please read the source code and the MIT license before installation to confirm you trust the maintainers and the deletion logic.

Irreversibility and Boundaries (README Known boundaries):

  • Please export any potentially needed content before deletion.
  • If the session instance is busy, or the current process does not have the session resident, a “file deleted but archive row temporarily remains” situation may occur; the client attempts to clear the record after calling refresh() via the official sessions service. If this fails, the row still shows as archived, but the record for the delayed instance may be cleared by the background process within approximately 15 seconds.
  • Other browser tabs may not receive notifications immediately in some “absent” scenarios; you may need to pull the list again manually.
  • Deletion of old-format session logs may be slower (related to sessionPersistence.stat() performing a stat on the entire session root directory, which is I/O not introduced solely by this plugin).
  • After shredding, the session log directory is removed; projection caches under storages/session_projcache/sessions/ and content-addressed uploads in attachments/ are still managed by dsh itself and are not cleaned up by this plugin.
  • Pinning and session archiving are mutually exclusive in dsh; sessions operated on via this menu will not be in a pinned state.

Conclusion

In the “everything is a plugin” community ecosystem of DeepSeek Harness, dsh-shredder only supplements one thing: adding a red “Shred session” option for archived sessions in the native session menu, with two-step confirmation and no extra archive UI. Directory and Source Code:

  • SkillHub Directory Page: https://www.skillhub.cn/plugins/LEEKINBUN-dsh-tools/dsh-shredder
  • GitHub: https://github.com/LEEKINBUN-dsh-tools/dsh-shredder

The community directory is an independent site and has no official affiliation with DeepSeek / High-Flyer. Please refer to the repository README and your local dsh version before use.

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

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

Xiaoye