工具用量与启动成本:在插件页新增标签,显示智能体调用了哪些工具、哪些经常出错,以及每个工具定义(内置、插件或 MCP 服务器)在每次请求中占用多少 token,附启动上下文图和该关掉哪些工具的通俗建议;只读的 toolbox_report 智能体工具提供同样的数据。在本机读取 dsh 会话日志,无钩子。
安装
# npm 包(预构建)
dsh plugin --profile web add deep-toolbox
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:JoblessJoe/deep-toolbox
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness (dsh) plugin that shows which tools your agents actually use, which ones fail, and what each one costs you in every request. Every tool you install (built-in, plugin or MCP server) sends its full definition with every model request. A 37-tool MCP server can add thousands of tokens to each prompt, even if no agent ever calls it. deep-toolbox finds that dead weight so you can drop it.
npx @deepseek-ai/dsh plugin --profile web add deep-toolbox
Then restart your dsh web server and reload the tab. A Tool usage & startup cost tab appears on the Plugins page. Full details under Install.
What you see
- A new chat starts with: the tokens every new chat carries before you type, and how much of that is tool definitions.
- Paid for, never used: tools whose definitions go out with every request, but no agent called them in the chosen range.
- Failed calls: the error rate, with the latest error messages per tool.
- What stands out: plain-language tips, like "math adds 4.6K tok to every new chat but was not used in the last 30 days".
- Startup context: a chart of the built-in tools, each MCP server and plugin, each
AGENTS.md, the system prompt and the skill list. - Tool sources: one row per source, tagged used a lot, rarely used or never used. Open one for calls (main agent and subagents), errors, average time, result size, tokens per chat and last use of each tool.
- Ranges: last 7, 30 or 90 days. Show removed adds tools you used before but no longer have installed.
For agents
Every agent gets a read-only toolbox_report tool with the same numbers as short text. An agent can notice "this MCP server costs 4.6K tok per chat and was never used" and offer to turn it off with dsh's built-in plugin_manager, which asks you first.
How it works
No hooks, no database, no tracking code in the agent loop. dsh already records every tool call, result and request in its session logs (~/.dsh/sessions/**/session.v*.jsonl.zstd). deep-toolbox reads those logs when you open the tab and adds them up. Parsed files are cached until they change. Nothing leaves your machine.
- Host: one JSON route,
/api/deep-toolbox/stats, plus thetoolbox_reportagent tool. It also notes which plugin registers which tool, so plugin tools don't count as built-in. - Client: one self-contained bundle on dsh's own design tokens, so it looks native in both themes.
Token numbers are estimates (characters ÷ 4). "Sent" is the raw volume before prompt caching.
Install
Into your dsh web profile (web below is the profile name; use whichever profile backs your web GUI). From a source checkout, use pnpm dsh instead of npx @deepseek-ai/dsh:
npx @deepseek-ai/dsh plugin --profile web add deep-toolbox
Restart the dsh web server afterwards, then reload the browser tab.
Other sources:
# straight from GitHub
npx @deepseek-ai/dsh plugin --profile web add github:JoblessJoe/deep-toolbox
# from a local checkout
npx @deepseek-ai/dsh plugin --profile web add file:/path/to/deep-toolbox
The agent tool also works in headless and TUI profiles. The tab needs the web GUI.
Requirements: dsh 0.2.2 or newer (engines.dsh: >=0.2.2-rc.1 <0.4.0), Node 22.15+ (built-in zstd).
CLI
The same report in a terminal, or for an agent through bash:
npx deep-toolbox # last 30 days
npx deep-toolbox 7 # last 7 days
npx deep-toolbox --errors web_fetch # latest errors of one tool
npx deep-toolbox --json
npx deep-toolbox --agent # the toolbox_report text
Set DSH_HOME (or DSH_SESSIONS) if your sessions are not under ~/.dsh.
Develop
npm install
npm run build # lib/index.js (host) + lib/client.js (web) + lib/cli.js
npm test
License
MIT
链接
同类插件
bowenliang123/dsh-context★ 5566
DSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
Han-1413141/dsh-cost-meter★ 765
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
wssfk12138/dsh-damage-pulse★ 291
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
zh667/TokenLedger★ 206
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
Ychris12138/dsh-usage-stats★ 192
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
PolinniZhong/dsh-personal-center★ 114
DeepSeek Harness 个人中心:跨会话用量统计(按供应商/模型分别统计,自动读取已配置模型)、按模型成本估算、全局自定义指令、数据驱动的桌面宠物(位图/矢量皮肤)与会话状态概览,纯本地离线运行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。