dsh-session-manager
Manifest validDSH plugin: batch browse, archive, delete and restore history sessions
dsh-session-manager
Batch browse, archive, delete and restore your DSH history sessions from a sidebar panel.
DSH stores every history session on disk under
DSH_HOME/sessions/<cwd-encoded>/<session-id>/ as a session.v4.jsonl.zstd
append-only event log, but the built-in session service exposes no delete or
archive API. This plugin fills that gap with a filesystem-level, reversible
workflow.
Features
- Session titles — each row shows the human-readable title DSH gave the
session (read from the
session/titleevent inside the log), with the real working directory, origin, last-updated time and log size. - Search — filter by title, working directory or id.
- Subagent filter — subagent sessions are hidden by default; toggle them back on when you need them.
- Enumerate every history session across all working directories.
- Multi-select sessions in the sidebar panel and batch-operate.
- Archive — move sessions out of the active list into a global
DSH_HOME/archive/sessions/directory. Data is preserved verbatim and can be restored any time. - Delete — permanently remove sessions (
rm -rf). Marked irreversible in the UI and confirmed before running. - Restore — bring archived sessions back to their original working directory.
How titles and paths are read
A session log is a run of concatenated zstd frames, one per append, so
zlib.zstdDecompressSync alone stops after the first frame. The plugin locates
every frame by its 28 B5 2F FD magic bytes and inflates each slice. It then
reads:
- frame 0 — the
sessionheader, which carries the real, unencodedcwd(the directory name alone is lossy: both/and a literal-encode to-); - the head frames — the first
session/titleevent (measured: always within the first six frames); - the tail frames — any later
session/titleevents, i.e. renames (measured: always within the last sixty frames).
The highest seq wins. Results are cached per session and invalidated by the
log's mtime and size, so listing 170 sessions costs a few milliseconds after the
first scan.
Install
Install the plugin through the DSH plugin manager (Discover → Index sources),
or place the package in the profile's node_modules.
Usage
- Open the 会话管理 / Sessions entry in the sidebar.
- Tick the sessions you want (or use 全选 / Select all).
- Choose 归档 / Archive, 删除 / Delete (or 恢复 / Restore in the Archived tab).
Agent tools
The host half also registers four tools for the agent to use directly:
session_manager_list— list all sessions and the archive.session_manager_archive— archive a batch byids.session_manager_restore— restore a batch byids.session_manager_delete— permanently delete a batch byids.
Layout
DSH_HOME/sessions/<cwd>/<id>/session.v4.jsonl.zstd # active sessions
DSH_HOME/archive/sessions/<cwd>/<id>/... # archived (preserved)
DSH_HOME/archive/sessions-index.json # archive index
License
MIT
Comments
Loading…
Similar plugins
by kira905
DSH web plugin that browses, previews, restores and deletes archived sessions that were moved out of the sessions directory.
★ 2
AGPL-3.0
JavaScript
Nov 9, 2026
dsh plugin --profile web add @kira905/dsh-butler-archiveby Yiklek
dsh plugin: view and restore archived sessions from a dedicated page in the web Settings.
★ 0
MIT
JavaScript
Aug 20, 2026
dsh plugin --profile web add dsh-archived-listby z1lyA
DSH plugin: manage archived DeepSeek Harness sessions — batch unarchive and safe permanent deletion with attachment reference scanning.
★ 0
MIT
JavaScript
Nov 3, 2026
dsh plugin --profile web add dsh-session-adminby leolee9086
DSH plugin: block-level parallel index over session history
★ 0
MIT
JavaScript
Sep 28, 2026
dsh plugin --profile web add dsh-better-session-queryby DreamStan
A DSH plugin for browsing archived sessions and safely deleting them.浏览归档会话,并安全地关闭、取消归档或删除会话。
★ 0
MIT
TypeScript
Aug 18, 2026
dsh plugin --profile web add @dsh-external/dsh-archive-sessionby shuiqian520
DSH plugin: permanently delete a session from the sidebar menu, and retry a user message or an assistant reply.
★ 3
↓ 736/wk
MIT
JavaScript
Oct 17, 2026
dsh plugin --profile web add dsh-session-delete