Batch session cleanup for DeepSeek Harness — pick a workspace, see which sessions are archived, and permanently delete logs, projection caches and workspace records.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:LucasCaleb-ggg/dsh-session-cleanup
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
A maintenance panel for DSH that does what "archive" never could: actually delete sessions — the event log, the projection cache and the workspace record.
DSH only archives. The row disappears from the sidebar, but session.v4.jsonl.zstd stays on disk forever and the archived id stays in storages/workspace.json; the shipped log backend has no delete seam. This plugin adds the missing surface.

Features
- Workspace → sessions list. Every session shows its title, id, size, last activity, and whether it is archived, running or log missing.
- Batch delete. Tick any number of sessions, confirm once, done. Running sessions are refused (they still have a turn, subagents, jobs or schedules).
- Direct delete from the session menu. The sidebar's
…menu gains a Delete permanently… row that opens a confirmation dialog — no detour through the panel. - Workspaces. Delete a workspace registration, optionally with its directory on disk (guarded against drive roots, the user profile, the DSH home, and directories that contain another workspace).
- Unregistered sessions. Logs that no workspace lists anymore are shown in their own group, so they can be cleaned too.
- Consistent while it runs. Deletion goes through
workspaceRegistry.detachSession/unarchiveSession(so the Host's in-memory table stays in sync withworkspace.json) and then emitsapi-session/removed, so the sidebar drops the row immediately instead of re-filing it under "Ungrouped" until the next restart.

Install
From GitHub:
dsh plugin add https://github.com/OWNER/dsh-session-cleanup
Or from a checkout of this repository:
dsh plugin add /absolute/path/to/this/directory
The plugin is a plain-JS bundle (no build step). It registers a session-cleanup row in your DSH profile.
Use
- Sidebar → Session cleanup icon (between Plugin market and Schedules) → full page.
- Or any session's
…menu → Delete permanently…
Deleting removes three things for each session:
$DSH_HOME/sessions/<workspace-key>/session-<id>/(the event log)$DSH_HOME/storages/session_projcache/sessions/session-<id>.json- the id in
$DSH_HOME/storages/workspace.json(sessionIdsandarchivedSessionIds)
Nothing is touched until you tick I understand this cannot be undone.
Safety
- Running sessions are refused, with the reason shown in the UI.
- Session ids are validated before any path is built.
- Directory deletion refuses drive roots, directories containing your user profile or the DSH home, and directories that contain another registered workspace.
- Attachments (
.dsh/attachments) are never touched — shared blobs can belong to other sessions.
Known limits: a deleted session is not cascaded to its subagent children; deleting a session that is currently open in a tab leaves that tab pointing at a log that no longer exists.
Requirements
- DeepSeek Harness 0.2.x with the Web GUI
- Host services
webServer,connection,workspaceRegistry,agents
Development
Plain ES modules, no bundler:
index.js— Host half:/session-cleanup/api/{state,delete,delete-workspace}, all filesystem work.client.js— Client half: themainpanel, thesidebar.panellisticon, the session-menu row and theshell.overlaydialog.cordis.patch.yml— inserts thesession-cleanuprow.locale/*.json— display metadata (Plugin Manager / market).
License
MIT — see LICENSE.
Links
More in this category
Minglink/dsh-infinite-gen-4★ 3781
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.
ranxianglei/billion-context★ 3598
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).
liangmianya/dsh-synapse★ 641
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
MichengAI/dsh-archive-manager★ 277
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 275
Import full-fidelity chat histories from 13 coding agents (Claude Code, Codex, ChatGPT, Cursor, Gemini, opencode, and more) as resumable DeepSeek Harness sessions, with reverse export back to Claude Code.
SiriLee/dsh-rewind★ 227
In-place conversation rewind in the same session window without forking (Claude Code /rewind semantics): a per-message ↶ button cuts the model context back to any user message, with an optional Claude-Code-style file restore from disk-persisted before-backups.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.