Scan, view, and safely clean local AI terminal session histories (Claude Code, Codex CLI, WorkBuddy, DSH) from a settings card — quarantine-first with SHA-256 manifests, one-click restore, audit log, and phrase-confirmed hard delete.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-session-sweeper
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/HrxSpace/dsh-session-sweeper/releases/download/v1.0.10/dsh-session-sweeper-1.0.10.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:HrxSpace/dsh-session-sweeper
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
Scan, view, and safely clean local AI terminal session histories — Claude Code, Codex CLI, WorkBuddy, and DSH itself — from a dedicated card in the DSH Web UI (Settings → 会话清道夫 / Session Sweeper).
Screenshots
| Session list | Message preview |
|---|---|
| Recycle bin | Settings |
What it does
- Scan every supported source under your home directory and list sessions with title, project, message count, size, and last-active time.
- View session contents (user/assistant messages, tool calls) in a paged preview — including DSH logs stored as concatenated zstd frames.
- Clean selected sessions. The default action is quarantine: the whole artifact (file, or session directory for DSH) is moved into a recycle directory with a manifest recording the original path and a SHA-256 per file. One click restores a batch byte-for-byte.
- Hard delete is available but requires typing the confirmation phrase
DELETE; it leaves an audit tombstone only.
Data safety model
| Guard | Behavior |
|---|---|
| Quarantine-first | Default clean moves artifacts to ~/.hist-sweeper/recycle/<batchId>/ — always restorable |
| Active guard | Sessions modified within guardHours (default 24) are skipped unless you explicitly include them |
| Current session | The session served by the running DSH process is never cleanable |
| Lock detection | Files that cannot be opened are skipped without aborting the batch |
| Audit log | Every operation is appended to ~/.hist-sweeper/recycle/log.jsonl and shown in the Recycle tab |
| Scope | Touches nothing besides session artifacts — never configs, credentials, memory, or todos |
Install
From a packed tarball (no build scripts, lib/ is prebuilt and committed):
dsh plugin --profile web add ./dsh-session-sweeper-1.0.0.tgz
From git (lib/ is committed, so no prepare build permission is needed):
dsh plugin --profile web add github:HrxSpace/dsh-session-sweeper
Restart dsh web afterwards and open Settings → Session Sweeper.
Configuration
Both options can be overridden on the plugin row in your profile's
cordis.patch.yml:
| Option | Default | Meaning |
|---|---|---|
guardHours |
24 |
Active-guard window in hours |
recycleDir |
~/.hist-sweeper/recycle |
Quarantine destination |
Test hooks (not for daily use): DSH_SWEEPER_HOME / DSH_SWEEPER_RECYCLE
redirect the scanned home and recycle root — used by the test suite to run
against synthetic trees.
Uninstall
dsh plugin --profile web remove dsh-session-sweeper
The recycle directory and audit log survive uninstalling (they are your
recovery path); delete ~/.hist-sweeper manually once you no longer need
them.
Permissions & network
- Reads:
~/.claude/projects/**,~/.codex/sessions/**(incl.archived_sessions),~/.workbuddy/projects/**,~/.dsh/sessions/** - Writes: only the recycle directory
- Serves a same-origin-only JSON API (
/sweeper/api/*) on the DSH web server; cross-origin requests are rejected - No network access, no lifecycle scripts, zero runtime dependencies beyond node builtins (react is provided by the DSH client runtime)
Development
# build (any tsdown ≥0.22 works; lib/ output is committed)
npx tsdown
# tests (node:test + tsx, zero package installs)
node --import tsx/esm --test tests/sweeper.test.ts
# dev instance with the local build overlaid
pnpm dsh --profile web --patch ./cordis.dev.yml --port 3180 --no-open
License
MIT
Links
More in this category
Minglink/dsh-infinite-gen-4★ 3602
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★ 3149
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★ 598
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
Nwflower/dsh-chat-import★ 259
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.
MichengAI/dsh-archive-manager★ 256
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
SiriLee/dsh-rewind★ 208
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.