dsh-workspace-switch-cost
IdentifiedQuantify what switching projects costs. Measures each workspace's cold-start overhead (AGENTS.md + skill catalog + tool schemas + runtime context), its steady state, and how many turns it takes to rea
dsh-workspace-switch-cost — 工作区切换成本(DSH 插件)
换个项目不是免费的:重新读 AGENTS.md、重新注入 60+ 个技能的描述、重新摸清工具集。 这个插件量化「进一个工作区要烧多少上下文」,并建议哪些该常驻、哪些该归档。
安装
dsh plugin --profile desktop add @bushizhanghan/dsh-workspace-switch-cost
重启 DSH 后生效。只读。
Agent 工具
| 工具 | 作用 |
|---|---|
wsc_audit | 量一个工作区的进入成本:冷启动四项开销、稳态值、几轮到达稳态 |
wsc_compare | 横向对比多个工作区,并归因:哪个因素真的解释了成本差异 |
wsc_recommend | 按「进入成本 × 访问频率」给出常驻 / 归档 / 观望的建议 |
冷启动的四个开销项
| 项 | 来源 |
|---|---|
agents-md | 全局与项目 AGENTS.md 的注入 |
skill-catalog | 每轮注入的技能目录(60+ 个技能就是 60+ 条描述) |
tools | 工具 schema 的 JSON 定义 |
runtime-context | 运行时快照 |
稳态值(steady state)是会话进入正常工作后的每轮注入量,进入开销 = 冷启动 − 稳态。
归因的门槛
wsc_compare 的归因需要 ≥3 个工作区才能算相关性。少于 3 个时它明确说「数据不够」而不是编一个结论——两个点之间永远能画出一条完美直线,那不是洞察。
同样,某个因素在所有工作区之间没有差异时,它被标注为「这是 profile 的属性,不是这个项目的属性」,不会当成发现卖给你。
设计取舍
- 用中位数不用均值:一个 26000 事件的会话不该定义整个工作区的进入成本。
- slug 从会话路径反推:
<sessions>/<workspace-slug>/<session-id>/session.v4.jsonl.zstd,所以显式给一个session时也能报出它属于哪个工作区,而不是slug: null。 - 确定性:全部为字符/token 计数与中位数,不调 LLM。
开发
node --test test/ # 38 个单测 + 21 项集成测试
License
MIT
Comments
Loading…
Similar plugins
Shows token and CNY cost per turn and per session in the harness's own statistics form, a whole-account bill over 1/7/30-day windows with cost-per-unit-of-work trends, and an advisor that re-measures
★ 0
dsh plugin --profile web add dsh-cost-auditby Jannchie
Cost tracking priced from an online catalogue (models.dev + OpenRouter, 8000+ models, each call priced at its own instant): a per-turn cost line, a Cost tab attributing spend to tool output / model ou
★ 8
MIT
JavaScript
Oct 23, 2026
dsh plugin --profile web add dsh-billby jing-hy
Project/task dual-mode workspaces for DSH: a task skips the workspace picker and gets a fresh scratch directory (D:\dsh_working\<name>-<timestamp>) per conversation, Codex-style; no-workspace sessions
★ 0
↓ 126/wk
MIT
JavaScript
Oct 11, 2026
dsh plugin --profile web add dsh-task-runnerby divineeagleblackhand
Shows what each assistant turn cost under every reply, priced from the token usage of that turn at the official peak and off-peak CNY rates, together with the account and bonus balances; when a turn c
★ 1
MIT
JavaScript
Oct 15, 2026
dsh plugin --profile web add dsh-cost-receiptUnit conversion as a `convert` tool: 10 categories (length, area, volume, time, angle, speed, temperature, pressure, energy/heat, power) and 82 units with English and Chinese aliases, plus a locale-aw
★ 0
dsh plugin --profile web add dsh-unitverseby zbzbhs
Turn another computer into a remote Agent teammate: the worker runs its own DSH and a full Agent loop locally, so dispatched tasks keep running when the link drops and its model credentials never leav
★ 4
↓ 2.5k/wk
MIT
JavaScript
Oct 21, 2026
dsh plugin --profile web add dsh-remote-agent