tokan-dsh-token-analytics
Tokan Dsh Token Analytics
DSH 插件,用于令牌使用情况分析、成本跟踪和优化信号
插件会安装到这里;不确定时保持 web。
npx -y @deepseek-ai/dsh plugin --profile web add github:fthuu/Tokan-dsh-token-analytics#86ec95592518e24242ff032a1a6440a66c4bf690


tokan-dsh-token-analytics
DSH 插件,用于令牌使用情况分析、成本跟踪和优化信号
插件会安装到这里;不确定时保持 web。
npx -y @deepseek-ai/dsh plugin --profile web add github:fthuu/Tokan-dsh-token-analytics#86ec95592518e24242ff032a1a6440a66c4bf690





Tokan Dsh Token Analytics 以 tokan-dsh-token-analytics 发布,当前版本为 0.37.1。Plugin Hub 会校验它的 manifest,并保存精确安装来源,便于复现安装结果。
A DeepSeek Harness (DSH) plugin that adds a Token Analytics dashboard to the Web UI Settings panel: per-tool token attribution, cost breakdown, cache analysis, optimization signals, historical session replay, and JSON/CSV export.
DeepSeek Harness (DSH) 插件,在 Web 设置面板中提供 Token 分析仪表板:每个工具的 Token 归因、成本分解、缓存分析、优化信号、历史会话重放,以及 JSON/CSV 导出。
Real-time metrics for the selected session:
Detects tool operations that deviate from the session's per-tool baseline:
| Severity | Threshold | Meaning |
|---|---|---|
| 💡 OPPORTUNITY | ≥1.5x AND ≥200 tokens | Possible optimization |
| 🟡 WARNING | ≥3.0x AND ≥800 tokens | Unusual operation |
| 🔴 CRITICAL | ≥6.0x AND ≥3000 tokens | Extreme operation |
Thresholds are fixed for consistent results (see lib/waste.js).
On startup, the host half automatically replays persisted session logs and rebuilds every session's report. Each session is fully isolated — no cross-session contamination. Sessions with corrupt logs are skipped with a warning instead of aborting the restore.
An aggregate view across all restored sessions: total tokens, cost, waste signals, and per-session comparison.
| Format | Scope |
|---|---|
| JSON | Current session / All sessions / Summary |
| CSV | Current session / All sessions / Summary |
Syncs with the my-skin plugin's global saturation slider.
所选会话的实时指标:
检测偏离会话内工具基线的操作:
| 严重性 | 阈值 | 含义 |
|---|---|---|
| 💡 OPPORTUNITY | ≥1.5x 且 ≥200 Token | 可能的优化机会 |
| 🟡 WARNING | ≥3.0x 且 ≥800 Token | 异常操作 |
| 🔴 CRITICAL | ≥6.0x 且 ≥3000 Token | 极端操作 |
阈值固定以确保结果一致(见 lib/waste.js)。
启动时宿主半边自动重放持久化的会话日志,重建每个会话的报告。会话完全隔离,无跨会话污染。日志损坏的会话会带警告跳过,不会中断整体恢复。
所有已恢复会话的聚合视图:总 Token、成本、浪费信号与逐会话对比。
| 格式 | 范围 |
|---|---|
| JSON | 当前会话 / 所有会话 / 摘要 |
| CSV | 当前会话 / 所有会话 / 摘要 |
与 my-skin 插件的全局饱和度滑条同步
dsh CLI on PATHDSH loads plugins as profile bundles:
dsh plugin --profile web add github:fthuu/Tokan-dsh-token-analytics
dsh plugin initializes the profile on first use, runs pnpm add in the profile directory, and reconciles the dsh.profile.bundles list automatically. Then boot the Web GUI:
dsh web
Open the printed URL and find Settings → General → Token Analytics.
See CHANGELOG.md for detailed version history. Latest: v0.37.1.
详细版本历史请查看 CHANGELOG.md。最新版本:v0.37.1。
This project is licensed under the GPL-3.0-only License - see the LICENSE file for details.
本项目采用 GPL-3.0-only 许可证——详情请查看 LICENSE 文件。
SPDX-License-Identifier: GPL-3.0-only
Copyright (c) 2026 fthuu