Introduction¶
DeepSeek Harness comes with a built-in “Archive” feature, but archiving merely moves a session out of the sidebar — the files remain on disk, are still searchable, and continue to consume storage space. For sessions that require complete removal, this plugin fills that gap: it adds a “Delete Session” option to the “…” menu on each session row, and upon confirmation, truly deletes the session’s log directory, subagent sessions, projection cache, and workspace references.
Overview¶
rayzenchen/dsh-delete-session is a Host + Client plugin that adds a “true session deletion” capability to DeepSeek Harness (DSH). It does not register any agent tools — it only provides a deletion entry point and a confirmation dialog. The plugin requires no build step and consists of an index.js (~1,000 lines, Host) and a plain-JS client.js (Client).
Core Features¶
- Deletes the session directory: including all
.jsonl.zstdlogs and lock files - Deletes subagent sessions: descendants with
origin: 'subagent' - Deletes projection cache records
- Deletes references, archive entries, and pinned records from the workspace registry
- Refuses to delete sessions with active work: turns, background tasks, subagents, or scheduled reminders; offers a “Stop tasks and delete” option
- Safety by design: all rejections are returned before any disk changes are made, so a partial deletion never occurs; supports rollback; uses DSH’s own request trust model; only one deletion request per session at a time
- Diagnostics: appends operation logs to
$TMPDIR/dsh-delete-session-diagnostics.jsonl, capped at 256 KB
What is not deleted:
- Forked sessions
- Attachments (addressed by content SHA-256, shared across sessions)
- The workspace directory itself, other sessions, or other workspaces
- Your repository files (the plugin only operates on session data under ~/.dsh)
Deletion is permanent. There is no trash bin.
Installation & Setup¶
- Clone the repository to any local location:
git clone https://github.com/Rayzenchen/dsh-delete-session.git dsh-delete-session-plugin
- Have DSH install this directory. Use
plugin_manager’sinstall_bundlewith the directory’slink:specification as thetarget:
link:/absolute/path/dsh-delete-session-plugin
link: references the directory in place without copying files. Code changes are reflected directly in the installed plugin.
-
Restart DSH. The Host half is loaded once at startup; the Client half takes effect with a page refresh.
-
Open Settings → Plugins and confirm that
@local/dsh-delete-sessionis enabled. The icon is a red trash can.
Typical Usage¶
-
Any session row in the sidebar → “…” → the last item, “Delete Session” (red, trash can icon, listed after “Archive Session”).
-
A confirmation dialog appears with the session name as the title. The body reads: “This will permanently delete session “X” along with all its conversation history, subagent sessions, and cache”, and includes a warning: “This action cannot be undone.”
-
Click Delete → the Host executes the request. Default focus is on Cancel;
Esc, clicking the overlay, or the ✕ in the top-right corner all close the dialog. -
If the session has active work, the Host will refuse and explain why. The dialog then shows a Stop tasks and delete button — it first stops turns, background tasks, subagents, and scheduled reminders, waits for the session to become idle (up to 15 seconds), then proceeds with the deletion.
-
On failure, the reason is displayed directly in the dialog. There are no silent failures.
Use Cases & Notes¶
- Ideal for DSH users who need to thoroughly clean up sessions and reduce disk usage
- The plugin runs with DSH’s process privileges; review the source code and license (MIT) before installing
- Only verified on macOS; behavior and rollback logic on other platforms have test coverage but have not been tested on real hardware
- Host-side code changes require a DSH restart; Client-side changes only require a page refresh
- Deletion is irreversible; in-memory objects of deleted sessions are only fully released after a restart
Conclusion¶
This plugin elevates DSH’s session management from “archiving” to “true deletion,” making it well-suited for scenarios that demand strict cleanup of session records.
- Plugin directory: https://www.skillhub.cn/plugins/Rayzenchen/dsh-delete-session
- GitHub: https://github.com/Rayzenchen/dsh-delete-session