
acefun29/dsh-file-mount
30Last commit Aug 15, 2026
dsh-file-mount DSH plugin
dsh-file-mount is a DeepSeek Harness plugin that monitors file reads and writes, implementing incremental mount and deduplication. It tracks which lines of a file have been sent to the model, avoids re-sending unchanged content, and provides a dashboard showing file segment freshness and token savings.
How to install the dsh-file-mount DSH plugin
dsh plugin --profile web add github:acefun29/dsh-file-mountCopying does not run this command. Review the repository and version before installing the dsh-file-mount DSH plugin.
dsh-file-mount DSH plugin data source
dsh-file-mount DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-file-mount DSH plugin can do
- Incremental file mount: only sends new or changed lines to the model on subsequent reads.
- Deduplication: avoids re-sending already-read line ranges, replacing them with a marker.
- Freshness-aware attention decay: automatically removes stale segments from context based on U-shaped attention score.
- Token savings estimation: calculates tokens saved and spent, with a net savings display.
- File change detection via stat cache (mtime/size + sha256) and line-level diff.
- Provides a dashboard tab showing file segments with freshness color bands and expiry count badges.
Where the dsh-file-mount DSH plugin fits
- Reducing token usage when the model repeatedly reads the same file.
- Automatically re-sending only the changed lines when a file is edited externally.
- Visualizing which parts of a file are fresh or stale in the model's context.
- Resetting file memory via the file_mount_forget tool when the model needs to re-read entirely.
- Tracking token savings across sessions with optional persistent stats file.
Who the dsh-file-mount DSH plugin is for
- DSH users who frequently work with file-based context and want to minimize token waste.
- Developers building AI-assisted workflows where file content changes incrementally.
dsh-file-mount DSH plugin limitations
- Compaction invalidates mount guarantees: compacted mount content leaves context, and the plugin relies on checkpoint sourceEventSeqs to skip re-anchoring.
- UI read cards degrade to generic cards when the plugin replaces result text, though canonical values are preserved.
- Only works with read/write/edit tools that have a canonical value structure; structural changes cause fallback to pass-through.
- Files larger than maxManagedBytes or matching excludeGlobs are not managed and pass through untouched.
- Freshness is heuristic: segment expiry does not mean content is removed from context (only compaction does), so re-sending incurs token overhead.
- Browser session history is paginated; the dashboard may retain stale file rows until the file is re-mounted.
dsh-file-mount DSH plugin: from the repository README
Quoted from the acefun29/dsh-file-mount README, the upstream source of the dsh-file-mount DSH plugin. Copyright remains with the original authors.
DeepSeek Harness 插件:**文件增量挂载 + 重复读取去重**。记录每个文件哪些行范围已经进入模型上下文,重复读取只补缺失部分;文件在磁盘上变化时按行级对比只补改动的行;并提供「挂载文件」仪表盘实时展示账本。 移植自 [piwpi](https://github.com/earendil-works/pi-mono) 的 context-mount 机制。 ## 效果 - **模型侧**:读过的行范围不重复进上下文(去重 marker);新内容只注入缺失区间(增量挂载);文件改动后只补改动的行(行级 diff,日志追加只补新尾巴);AI 自己写过的文件回头读直接免单;`file_mount_forget` 工具让模型能主动强制重读。 - **界面侧**:「挂载文件」标签页是仪表盘——每个文件行可展开成**文件段**列表,每段带**新鲜度色带**(绿=新鲜/黄=一般/橙=接近过期/红=已过期/灰=未知)和**过期次数徽标**;另有进度条、搜索框、排序、净节省与人民币折算;对话区有上下文注入折叠行,「文件已变更」时行上有角标。 - **节省统计**:中文按 1 字 ≈ 1 token、其他按 4 字符 ≈ 1 token 估算;同时记账「省下的」和「纸条花掉的」,界面显示**净值**;可选把跨会话总账落盘(`statsFile`)。 ## 安装 ```sh # 从 GitHub(需在 profile 的 pnpm-workspace.yaml 里授权该包的 prepare 构建) npx @deepseek-ai/dsh plugin --profile web add github:acefun29/dsh-file-mount # 或本地目录 / tarball npx @deepseek-ai/dsh plugin --profile web add file:../dsh-file-mount npx @deepseek-ai/dsh --profile web ``` 一个包两面:`dsh.bundle.patch` 挂载宿主插件行,`dsh.client` manifest 让 Web 端扫描出浏览器半部,无需额外配置。 ## 配置 ```yaml - id: file-mount name: dsh-file-mount config: enabled: true # 总开关;关闭后所有读取原生透传 capacity: 32 # 文件身份缓存容量(挂载中文件不受淘汰影响) ttlMs: 300000 # 缓存安全阀:同 stat 内容被改的兜底重读间隔 maxPinnedFiles: 256 #
Read the full READMERepository license: MIT
dsh-file-mount DSH plugin questions
Why does the UI read card become a generic card when using dsh-file-mount?
The plugin replaces the result text seen by the model with a deduplication marker or incremental block to avoid resending content. The canonical value (original read result) is preserved, but the card renders based on the result text, so it appears as a generic card. This is by design to save tokens.
How can I exclude certain files from being managed by the plugin?
You can configure the `excludeGlobs` option with patterns like `**/node_modules/**` to exclude those paths. Files matching these globs will pass through without any deduplication or incremental mount. Additionally, files larger than `maxManagedBytes` are also not managed.
How accurate are the token savings numbers shown in the dashboard?
The savings are estimates: Chinese characters are counted as 1 token per character, other characters as 1 token per 4 characters. The dashboard shows the net savings (saved minus spent) and a rough CNY conversion at ¥1 per million tokens. These are approximate and should be used for relative comparison.
How can the model force a full re-read of a file?
The model can call the `file_mount_forget` tool to invalidate the file's accounting. The next read of that file will then send the entire content again, as if it were never mounted.
Does the plugin work across DSH sessions?
Yes, if you configure the `statsFile` option, the plugin will persist token savings data across sessions to that file. The dashboard currently shows per-session data, but the accumulated stats can be read programmatically via `fileMount.stats()`. Cross-session visualization in the UI is not yet implemented.