Deletes a session from the sidebar session menu: its log and replay cache go to the Recycle Bin on Windows (a local trash folder elsewhere); a live session is queued for removal on the next start.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:ashulam/dsh-session-delete
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
dsh-session-delete
English | 简体中文
Adds 「删除会话 / Delete session」 to the sidebar's Session context menu in DeepSeek Harness and performs a real, recoverable deletion.


What it does
Hover a session row and click its ⋯ button → Delete session.
| Session state | Behaviour |
|---|---|
| Cold (not loaded in this app run) | Deleted immediately; its log and replay cache go to the Windows Recycle Bin (fallback: <DSH_HOME>/.session-trash/). The sidebar list refreshes itself through the client Session controller — no page reload needed. |
| Live (the session open right now, or one opened earlier in this run) | DSH exposes no "close a session" API, so the files cannot be removed safely. The plugin offers to queue it: POST /dsh-session-delete/queue writes <DSH_HOME>/.session-delete-queue.json, and the next start drains that queue before anything is opened. |
After a restart that removed queued sessions, a small notice in the corner lists what was deleted (titles, up to five, with a count for the rest) and reports any entry that could not be removed and stays queued.
Files removed
For one session id:
| Path | What |
|---|---|
<DSH_HOME>/sessions/<project>/session-<id>/ |
the append-only event log |
<DSH_HOME>/storages/session_projcache/sessions/<id>.json |
the replay/projection cache |
Nothing else is touched. Attachments are shared, content-addressed blobs and are
deliberately left alone. The Workspace registry keeps its sessionIds entry —
the registry has no "unregister a session" API, and the sidebar already skips ids
whose stored session is gone.
Maintenance: dangling session ids
Deleting a session removes its log and replay cache, but the Workspace registry
keeps its sessionIds entry: the registry has no "unregister a session" API, and
a running app rewrites workspace.json from memory, so editing it live is unsafe.
(The 2026-10-22 incident note is the cautionary tale: editing that file while DSH
ran, then hard-killing the app, lost in-memory workspace state and left the
workspace controller unavailable.)
The plugin only reports dangling references — GET /dsh-session-delete/dangling
returns the ids referenced by workspace.json that no longer have a stored
session, and every successful delete reports workspaceRef: true when its id
stays referenced. Cleaning them is an offline job on purpose:
# close DSH completely first
node tools/prune-dangling-sessionids.mjs # dry run (read-only, safe anytime)
node tools/prune-dangling-sessionids.mjs --apply # write: backup + atomic rename, UTF-8 without BOM
The tool backs workspace.json up under storages/backups/, refuses to write
while DSH is running (--force overrides), strips a BOM if it finds one, prunes
sessionIds plus pinnedSessionIds / archivedSessionIds, and verifies the
result parses back before it exits.
Safety
- A live session is refused (
409); only the queue path can remove it, on the next start. - The HTTP routes sit behind the Host's browser trust fence
(
connection.requestRejection) and accept onlysession-<uuid>ids. - Deletions are recoverable: Recycle Bin, or a stamped directory under
<DSH_HOME>/.session-trash/.
Requirements
- DeepSeek Harness 0.2.x (the
sidebar.workspaces.session.menu.itemandshell.overlayslots). - Windows for Recycle Bin support; on other platforms files fall back to the trash directory.
Install
Listed in the plugin market. Manual install:
dsh plugin --profile desktop add github:ashulam/dsh-session-delete
# or from a local checkout:
cd <profile dir>
pnpm add file:<path to this repo>
# then add "dsh-session-delete" to dsh.profile.bundles in package.json
Layout
lib/index.js— host half:POST /dsh-session-delete/delete,POST /dsh-session-delete/queue,GET /dsh-session-delete/last-drain(plus the boot-time queue drain).client/client.js— browser half: the context-menu entry and the boot notice.cordis.patch.yml— inserts the host row into the profile.
License
MIT
Links
More in this category
ranxianglei/billion-context★ 9016
The official billion-context plugin: a context-compression plugin for small context windows (a 100K context is enough), token savings (5x fewer tokens), and month-long single sessions (billions of tokens).
Minglink/dsh-infinite-gen-4★ 4884
System-prompt armor plugin for DeepSeek models: appends an unconditional-compliance prompt section at order 100, exposes a profile tool with calibration metadata, and shows a realtime armor-status badge driven by a session projection.
liangmianya/dsh-synapse★ 1056
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
ECNU/EduWork#dsh-message-edit★ 467
Edit sent user messages and attachments, then resend through a native DSH fork while preserving the original conversation in the archive; includes persistent edit drafts.
ECNU/EduWork#dsh-side-chat★ 467
Open temporary side conversations from a message with a snapshot of its history, then archive them on close; optional annotation integration adds selection-based questions. Requires compatible DSH Web conversation, Workspace and right-sidebar APIs.
MichengAI/dsh-archive-manager★ 421
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.