dsh-session-cleanup
Verifieddsh-session-cleanup Β· v0.2.0 Β· MIT
DeepSeek Harness plugin for /nix and /nix quit on dsh-tui: delete the current session, start a new one, and switch the live view.
Install
dsh plugin add dsh-session-cleanup Confirm the layer applied with dsh --profile default --dump-config β see the install guide.
Source
Tags
Creators
Readme
What this is
A DSH plugin for dsh-tui only. It does not list sessions and it does not replace /resume.
pi-tui and the web profile are not supported.
On DSH it:
/nixβ deletes the current session, starts a new one, and switches the live view to it/nix quitβ deletes the current session and exits DSH
Deletion is the whole session directory (and sidecar), not a single session.jsonl.zstd. After dsh-tui has switched away, the previous session is stopped/flushed/detached, the directory goes to Trash on macOS (rm -rf elsewhere), then projection cache and workspace accounting are cleared.
dsh-tui's /new and /resume delete keep the previous log. /nix is the destructive counterpart.
Installation
dsh plugin --profile dsh-tui add dsh-session-cleanup
From this repo:
npm run build
dsh plugin --profile dsh-tui add file:$PWD
Restart the profile. Confirm it loaded:
dsh --profile dsh-tui --dump-config | grep session-cleanup
dsh --profile dsh-tui
Commands
| Command | Arguments | Description |
|---|---|---|
/nix |
β | Delete the current session, start a new one, switch the live view |
/nix quit |
β | Delete the current session and exit DSH |
/nix help |
β | Usage |
Both destructive commands ask for confirmation when userQuestions is mounted (dsh-tui does).
/nix needs dsh-tui's scene switch (channel.newSession()). On any other profile it refuses rather than leaving you on a deleted conversation. Use /nix quit to delete and exit.
Safety
- Confirm before delete
- Switch first β
/nixstarts and adopts the new session before the old directory is removed - macOS Trash for session directories; other platforms permanently remove them
- Cleanup order β disk/log removal is confirmed before workspace accounting is stripped
- Both id spellings β
<uuid>andsession-<uuid>
Development
npm run build # emit lib/dsh-entry.js for DSH
npm run test # test suite
npm run check # build + test
Native DSH entry: dsh-entry.ts β lib/dsh-entry.js.
Attribution
The /nix idea comes from pi-session-cleanup (MIT Β© MasuRii). The DSH port uses DeepSeek Harness persistence, workspace accounting, and dsh-tui's live session switch.