DSH-SessionDelete
Run the following command in DeepSeek Harness:
dsh plugin install yauntyour/DSH-SessionDelete
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install yauntyour/DSH-SessionDelete in your terminal to install the plugin, available at https://github.com/yauntyour/DSH-SessionDelete , then restart dsh web and refresh the browser to see the new Delete Session entry.
About this plugin
DSH ships with an archive action but never gave you a true delete path. Stale sessions pile up in the sidebar, their log files silently eat disk space, and manually navigating to the persistence directory with the risk of deleting the wrong folder or forgetting to clean workspace bookkeeping and projection-cache entries is exactly the kind of job that ends in a half-removed, ghost session after the next restart. This plugin plugs a red, trash-icon Delete Session entry directly below the existing Archive item in every sessions row overflow menu. The confirmation dialog is themed to match the host, and when multiple sessions share the same title it lists every candidate—title, id, and relative time—so you always pick the right one. The moment you confirm, the list removes the row instantly through DSH host pushes (host/session-removed, host/workspace-changed, host/archived-sessions-changed), no page refresh required. If you were viewing that session, the UI snaps back to the new-session view automatically.
Under the hood the server-side deletion transaction is deliberately defensive and fully idempotent. It first checks whether the session's agent is still running and refuses to proceed if so, avoiding the classic race where an in-flight turn re-creates files you just deleted. It then flushes and detaches the live store, locates the session directory via the session header cwd with a fallback that scans all workspace sub-directories and validates the encoded segment name before any rm -rf, removes the session id from every workspace record and the global archived-session set through the official write paths, and finally drops the corresponding projection-cache row. Every step is safe to repeat. The delete endpoint reuses the same loopback-Host and same-origin trust fence as the official API gateway, so no unauthenticated remote caller can trigger a deletion.
The client side is a single pure-DOM module with zero framework dependencies. A MutationObserver watches the document body for the Archive menu item, clones it, re-labels it as Delete Session, and inserts it in the same hashed class container so the styling stays in sync with the theme. Session titles are read from the trigger buttons aria-label, and the session id is resolved through the client session list. The whole thing injects cleanly into the host without patching any framework code.
Who is this for? Any DSH user whose session list has grown past a manageable size and who wants a safe, one-click permanent cleanup inside the UI instead of dropping into a terminal and hunting through filesystem directories. If you have been meaning to prune old experiments, dead prototypes, or duplicate runs and the current workflow felt risky or incomplete, this plugin closes that gap with the safeguards you would expect from a data-destructive operation.
Use Cases
- Session list keeps growing and you need to permanently prune stale sessions
- Multiple sessions share the same title and you must pick the exact one to delete
- An agent is mid-turn and you need a guard to prevent directory re-creation after a mistaken delete
Best For
- DSH users whose session list has grown unwieldy and needs periodic pruning
- Developers or DevOps who want to avoid hand-picking directories in the persistence tree
- Teams that require confirmation dialogs and safety guards before any destructive data action
Related Plugins
A service-oriented sidebar framework for DSH, offering a full workbench with file explorer, embedded browser, real terminal, Git panel, and extensible plugin services.
A beautiful, practical Claude Code-style TUI plugin with pixel whale top bar, flowing glow title, real-time status line, streaming thought expansion, time rewind, context progress bar and TPS gauge — zero core changes.
The plugin market for DeepSeek Harness: browse/search/one-click install community plugins and themes, with updates, backup/restore, hot disable, diagnostics, and AI fix.
A persistent whale widget on the DSH web UI that shows DeepSeek balance, today's usage, and per-turn cost, with drag-and-snap and sound effects.