Reports how much disk each project’s sessions use, archives old sessions into a dated folder, and deletes only after an explicit confirmation token.
Install
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/474885697-alt/dsh-kit/releases/download/v0.1.0/dsh-kit-session-hygiene-0.1.0.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:474885697-alt/dsh-kit#path:/plugins/dsh-kit-session-hygiene
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
This plugin publishes its README in Chinese only.
会话存储体检与清理:先统计、再归档、最后才谈删除。
版本 0.1.0 | 包名 dsh-kit-session-hygiene | 仅宿主侧(无客户端代码)| MIT
它解决什么问题
会话文件会悄悄长到几十 MB。先看清楚谁在占地方(按项目分组、列最大的几个),再决定归档或删除。
归档是移动到 ~/.dsh/sessions-archive/<日期>/(可随时移回),删除才是真删。
两个破坏性操作都默认演练:dry_run 默认 true,session_delete 还要 confirm="DELETE" 且只允许删 7 天以上的。
安装
plugin_manager install_bundle target="C:/Users/03/Documents/deepseek-harness/default-workspace/plugins/dsh-kit-session-hygiene"
装完即可用,工具会出现在工具列表里;用 plugin_health 可以体检清单。要卸载就用插件页的开关。
工具
| 工具 | 用途 | 参数(* 表示必填,? 表示可选) |
|---|---|---|
session_report |
统计会话数量、体积、按项目分组与最大的几个 | days? integer |
session_archive |
把 N 天前的会话移动到归档目录(默认演练) | older_than_days integerdry_run? boolean |
session_delete |
永久删除 N 天前的会话(需 confirm="DELETE",最少 7 天) | older_than_days integerconfirm stringdry_run? boolean |
用法示例
示例:先看
session_report(days=30)
# → { total: 26, totalMb: 88.6, groups: [...], largest: [...] }
示例:归档(演练 → 执行)
session_archive(older_than_days=90) # 演练
session_archive(older_than_days=90, dry_run=False) # 真移动
HTTP 路由(仅本机 loopback)
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | /api/dsh-kit-session-hygiene/report |
?days=30,会话数量/体积/分组 |
配置
- 无需配置;归档目录
~/.dsh/sessions-archive/。
数据存在哪
- 只操作
~/.dsh/sessions;不读会话内容,只算大小和时间。
安全边界
- 删除要求
confirm="DELETE"且older_than_days ≥ 7。 - 默认
dry_run=true,先看清单再执行。 - 只删
session.v4.jsonl.zstd所在会话目录,不碰其它文件。
已知行为
- 归档不会更新 DSH 的会话索引,应用内可能会短暂看到「会话缺失」;需要时手动移回。
验收
- 实测 26 个会话 / 88.6 MB / 4 组;dry-run 与真实归档在临时目录验证一致。
宿主兼容性
- Web / 桌面宿主:HTTP 路由与工具都可用。
- headless / CLI(没有 webServer 服务):路由自动跳过,工具照常注册。
Links
More in this category
ranxianglei/billion-context★ 5790
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★ 4078
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★ 697
Visual, non-linear conversation workspace for DeepSeek Harness — sessions, follow-ups and branches become a browsable conversation map.
MichengAI/dsh-archive-manager★ 325
Adds an archived-sessions page in Settings to search, restore, and delete archived DeepSeek Harness sessions by workspace.
Nwflower/dsh-chat-import★ 299
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★ 248
Conversation rewind: one click back to any earlier user message, in the same window — no new branch, no leftover copy; the target message is refilled into the composer, with optional workspace-file restore — the full Claude Code /rewind semantics.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.