In DSH 0.1, the sidebar three-dot menu only offers Rename, Fork, and Archive, and the API has no delete route. The JSONL persistence layer is append-only. Archiving merely hides a session; the data remains on disk. This plugin fills that gap and removes in-memory and on-disk data via the top Trash button.

Plugin Introduction

This is a plugin for DeepSeek Harness (dsh) that adds the ability to delete sessions, maintained by chuling-lingling. It addresses the original dsh limitation where sessions cannot be permanently deleted and on-disk data cannot be cleaned up.

The plugin registers a host-side deletion queue and a Trash button in the browser-side session header. Deleting a session triggers the session/disposed event, removes the session from memory and syncs the change to all clients, and also deletes the corresponding on-disk directory ~/.dsh/sessions/<project>/<sessionID>/.

Core Features

  • Delete the current session: removes both the in-memory session object and the on-disk directory.
  • UI entry: registers a Trash button in the session header toolbar, adjacent to the Session log button on the same row.
  • Safety validation: the session ID must pass whitelist validation (session- prefix + restricted character set) to prevent path injection.
  • Robustness handling: delayed recheck of newly created session directories to prevent directory persistence from lagging behind deletion; queue limit of 50 per batch; processing results are written to logs.
  • Persistence behavior: the session is removed from the sidebar in real time and does not reappear after restart.

Installation and Enablement

The plugin depends on @deepseek-ai/schemastery and requires a dsh 0.1.x environment with pnpm.

# 安装
dsh plugin --profile web add github:chuling-lingling/dsh-plugin-session-delete

# 卸载
dsh plugin --profile web remove dsh-plugin-session-delete

After installation, restart dsh web to apply the changes.

Typical Usage

  1. Open any session.
  2. Click the Trash button on the top title row of the session page, to the left of the Session log button.
  3. Click confirm in the confirmation dialog.

After execution, the current session disappears from the sidebar and disk, any running session is forcibly terminated, and the interface automatically switches.

Applicable Scenarios and Notes

  • Applicable scenarios: users who need to clean up local session storage and keep the sidebar tidy.
  • Irreversible: deletion cannot be recovered; the confirmation dialog is the only safeguard.
  • Button display: the header Trash button is shown only for non-empty sessions, meaning sessions that contain conversation content.
  • No bulk list: the plugin does not provide a bulk deletion list; sessions must be opened and deleted one by one.
  • Entry change: in v0.3.0, the settings-page entry was removed; only the chat-page Trash button is retained.

Conclusion

This plugin fills a key gap in DeepSeek Harness session management by providing true data cleanup capability. For more details, refer to the plugin directory or source code.