Zhenyu98/dsh-context-doctor
DSH上下文注入审计插件:统计AGENTS.md指令链/技能目录/工具schema的token成本,检测重复与冲突;Web UI圆环面板 + context_audit工具。Context Doctor for DeepSeek Harness:审计指令链/技能目录/工具schema的token成本。
Project Overview项目介绍
Context Doctor is a native auditing plugin built exclusively for DeepSeek Harness (DSH) that tracks and quantifies token consumption from all injected context in every model request. It breaks down usage across four categories: instruction chains from AGENTS.md/CLAUDE.md, skill directory summaries, built-in tool schemas, and MCP tool interfaces. It detects duplicate content across files, identifies skills that are silently shadowed by same-named skills from other sources, and generates prioritized pruning suggestions to reduce context bloat. To install it, users can run the official DSH plugin command to add it to their existing DSH profile, then restart the DSH web client to activate the plugin.
The plugin is designed for DSH users who want to debug unexpected context bloat and identify wasteful or conflicting injected content that can increase token cost and confuse the model. After installation, users can access a visual UI panel next to the built-in context meter in existing conversations, which shows the proportional token usage of each category of injected content following DSH’s language and theme settings. Users can also ask the model to call the context_audit tool directly to get a full text audit report with sorted pruning suggestions that the model can act on immediately.
The plugin requires DSH version 0.1.2-rc.1 or newer, and works on both web UI and headless/CLI DSH environments, skipping web-specific route registration automatically when run without a web server. It operates entirely in read-only mode, only accessing file metadata and content for auditing, and never writes, modifies, or deletes any user files. It is released under the permissive BSD-3-Clause open source license, with known limitations including only detecting exact duplicate paragraphs, not semantic matches, and not counting JSON Schema parameter details for MCP tools, and token counts are heuristic estimates for relative comparison only.
这是一款专为 DeepSeek Harness(DSH)开发的原生上下文注入审计插件,核心功能是量化模型每个请求中各类注入内容的 Token 消耗,涵盖指令链、技能目录、工具 schema、MCP 工具接口四类内容,可检测重复内容、冲突被遮蔽技能,并给出针对性裁剪建议,全程只读运行,不会修改用户文件。
它提供两种使用形态:一种是网页端UI面板,展示在已有会话的内置上下文计量条旁,可视化显示各类内容的 Token 占比,面板文案、主题自动跟随 DSH 的语言和主题设置;另一种是 context_audit 工具,可由模型自主调用,获取完整审计报告和按严重度排序的裁剪优化建议。
该插件要求 DSH 版本不低于 0.1.2-rc.1,可通过官方插件命令直接安装,同时支持无界面 headless/CLI 模式运行,采用 BSD-3-Clause 协议开源。当前已知限制包括仅检测完全相同的重复段落,暂不支持语义相似度检测,也未统计 MCP 工具 JSON Schema 参数细节。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-context-doctor(Zhenyu98/dsh-context-doctor)
仓库:https://github.com/Zhenyu98/dsh-context-doctor
本站详情页:https://www.yhbd.top/plugins/zhenyu98-dsh-context-doctor/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 BSD-3-Clause · ⭐ 33 · 最近提交 2026-09-06 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- 33 stars - an early-stage project星标 33,属于早期项目
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add "github:Zhenyu98/dsh-context-doctor#main"
把 Zhenyu98/dsh-context-doctor 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
Context Doctor
DSH 上下文注入审计插件:看清模型每个请求到底背着多少上下文,找出重复、冲突与浪费 token 的注入物。
全程只读 · token 成本逐项量化 · 可执行裁剪建议
为什么 · 快速安装 · Agent 安装 · 功能 · 使用 · FAQ · License
面板文案跟随 DSH 的语言设置(简体中文 / English),并沿用宿主的浅色 / 深色 / 跟随系统主题。
截图待更新至 v0.7 版式。
Why
DSH 会话里,模型每个请求都自动携带一批注入物:层层叠加的 AGENTS.md 指令链、一百多个技能的目录摘要、几十个工具 schema、MCP 工具面。它们悄悄消耗输入 token,且经常出现跨文件重复段落、同名技能互相遮蔽、工具面膨胀——但平时没人量化,问题到上下文告警时才暴露。
| 之前 | 之后 |
|---|---|
| 只能靠上下文计量条猜个大概,说不清是谁在消耗 | 指令链 / 技能 catalog / 工具 schema / MCP 四项逐项给出 token 估算 |
| 重复指令、重复技能描述散落在各层文件里,无人察觉 | 自动检测跨文件完全相同的重复段落、描述完全相同的冗余技能 |
| 同名技能多来源并存时被静默遮蔽,模型用的是哪个要靠猜 | 报告冲突胜出者与被遮蔽者(rank shadow) |
| 看到告警只能手工翻文件找线索 | 模型可直接调用 context_audit 拿到分节报告与按严重度排序的裁剪建议 |
Quick Start
宿主版本要求:DSH
>= 0.1.2-rc.1(已对 0.1.2-rc.1 验证)。0.1.2 重排了客户端模块表(dsh-client-runtime换成dsh-client-store),旧版宿主请固定v0.6.1—— 版本错配会让整个 web shell 起不来,不只是本插件(见 #9)。@deepseek-ai/cordis与@deepseek-ai/dsh-tools是 peer 依赖,由宿主 profile 提供;插件不自带这两份运行时(自带会铸造第二个工具调度器,见 #2)。
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
WestFox-AwA/dsh-prompt-optimizer
Unclecheng-li/DeepSec
Noob-stupid/dsh-plugin-gating-hub
feibi-mochi/deepseek-harness-control-center
kenz1117/dsh-ui-usage-billing
chenw2759-wq/dsh-plugin-healthcheck
MrWeiCodes/dsh-loop-guard
heartmove/dsh-side-chat