dsh-token-saver
DeepSeek Harness plugin that aggressively saves tokens without affecting task quality: lossless head/tail truncation of tool results (default), grep-result folding, pressure-triggered dsh-compaction-basic delegation, and an LLM-summary CompactionEngine subclass for the aggressive mode. Saves 97.6% of input tokens on an 8-scenario synthetic suite, with all reductions routed through dsh event flow so model-visible = logged stays intact.
为 DeepSeek Harness 设计的 token 节省插件:不损失任务效果。默认 conservative 档对工具结果做无损头尾裁剪与 grep 折叠;balanced 档在压力阈值委托 dsh-compaction-basic;aggressive 档以 LLM-summary 引擎子类化替换官方压缩。8 个合成场景累计节省 97.6% 输入 tokens,所有削减走 dsh 事件流,model-visible = logged 不变式仍成立。
How to install
dsh plugin add github:Shaw529/dsh-token-saver About
dsh-token-saver 一个为 DeepSeek Harness (dsh) 设计的 Cordis 插件。**激进节省 token、绝不破坏任务效果**。 dsh-token-saver 通过挂载三个扩展点节约 token:tools/post-execute(无损头尾裁剪 / grep 折叠)、agent/pre-step(委托官方 ctx.compaction)、以及可选的 prompt-cache 段稳定排序。所有改写都走 dsh 的事件流,不会触发"model-visible 与 logged 不一致"不变式。 --- 目录 为什么需要它 四种模式 安装 配置参考 测试效果 如何保证不影响任务效果 开发 架构 License --- 为什么需要它 DeepSeek 这类 agent 在长任务里 80%+ 的 prompt tokens 来自两类内容: 1. **被读出来的大文件** —— 一次性 read 一个 1MB 的迁移 SQL 就要吃掉 250k tokens。 2. **被反复搜索出来的命中结果** —— grep 几十个文件,回填全部 grep 结果,模型根本没读完。 dsh-token-saver 默认 conservative 档只做一件事:**完整保留头/尾,中间的部分用一行 metadata 替换**。这是一种"lossless"折叠 —— 模型…
Recommendation signals
Meta
- License
- MIT
- Language
- TypeScript
- GitHub stars
- 0
- mo. downloads
- –
- Last push
- 2026-09-07
- Created
- 2026-09-02
Links
Basic safety check
- Findings
- curated 收录但无 npm 包/安装命令
- Sources
- curated:awesome-dsh-plugin.com, curated:awesome-dsh-plugin/awesome-dsh-plugin
- Topics
- ai-agents, compaction, deepseek-harness, dsh-plugin, token-saver
Related plugins
dsh-context
bowenliang123/dsh-context
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
TokenLedger
zh667/TokenLedger
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
dsh-damage-pulse
wssfk12138/dsh-damage-pulse
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
dsh-usage-chart
Max-Samson/dsh-usage-chart
Token, cost, and balance dashboard under the composer: live indicator plus zero-dependency SVG charts for per-turn usage, estimated cost, and DeepSeek account balance.