npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bushizhanghan/dsh-workspace-switch-cost

v0.1.3

Published

Quantify what switching projects costs: the cold-start context every workspace charges on entry (AGENTS.md + skill catalog + tool schemas + runtime snapshot), how many turns until the session reaches steady state, and which workspaces to keep warm vs arch

Downloads

1,173

Readme

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)是会话进入正常工作后的每轮注入量,进入开销 = 冷启动 − 稳态。只在「确实注入了东西的非入口轮」里取最小值:注入为 0 的轮是没有可测内容,不是零成本基线,把它算进来会让稳态永远停在 0。单轮会话测不出稳态,报 ull 而不是 0。

归因的门槛

wsc_compare 的归因需要 ≥3 个工作区才能算相关性。少于 3 个时它明确说「数据不够」而不是编一个结论——两个点之间永远能画出一条完美直线,那不是洞察。

同样,某个因素在所有工作区之间没有差异时,它被标注为「这是 profile 的属性,不是这个项目的属性」,不会当成发现卖给你。

设计取舍

  • 用中位数不用均值:一个 26000 事件的会话不该定义整个工作区的进入成本。
  • slug 从会话路径反推:<sessions>/<workspace-slug>/<session-id>/session.v4.jsonl.zstd,所以显式给一个 session 时也能报出它属于哪个工作区,而不是 slug: null。
  • 确定性:全部为字符/token 计数与中位数,不调 LLM。

开发

node --test          # 40 个单测 + 1 个集成脚本(内含 22 项断言,失败时退出码非 0)

License

MIT