Preface¶
When running agents with DeepSeek Harness (DSH), tokens from a single conversation can be scattered across multiple turns, steps, retries, and streaming outputs. While the host persists usage events, the default interface does not offer daily summaries, model breakdowns, or cost estimations. If you are accustomed to viewing statistics in tools like CC Switch, you might want a similar view within DSH that aligns with the official tokenUsage metrics.
Below, we introduce the community plugin dsh-plugin-usage (maintainer bennett-dsh): it injects a “Usage Statistics” dashboard into the client by folding and aggregating data from existing session logs, without implementing a separate set of accounting logic.
What is this¶
dsh-plugin-usage is a Token Usage Statistics plugin for DeepSeek Harness, classified as a client-side plugin. It addresses three main issues: viewing tokens and call counts by time range, filtering and detailing by model, and estimating reference costs using a configurable price list. It also provides a yearly heatmap and adapts to dark/light themes. It is inspired by the statistical capabilities of CC Switch.
- Directory: https://www.skillhub.cn/plugins/bennett-dsh/dsh-plugin-usage
- Source code & docs: https://github.com/bennett-dsh/dsh-plugin-usage
- npm package:
dsh-plugin-usage(see repositorypackage.jsonfor the current version, e.g.,0.3.0) - License: MIT
Core Features¶
All the following capabilities are sourced from the plugin README and are available in the “Usage Statistics” dashboard on the settings page after installation.
Time & Aggregation¶
- Presets: Today, Last 7 days, Last 30 days, All
- Custom time ranges with unlimited span; supports hourly and daily aggregation
Models & KPIs¶
- Model filtering; per-model details (request count, input/output, cache, cost, proportion)
- “Model Proportion” card in the KPI grid: displays the top 4 models and “Others” based on total tokens
Cost & Currency¶
- Reference cost can be switched between ¥ / $ (fixed exchange rate 1 USD = 7 CNY, converted on the host side)
- Configurable price list per million tokens; built-in default prices for common DeepSeek models
- The price list uses USD / million tokens as the base; when displaying ¥, it converts at 7:1 without altering the price list itself
Display¶
- Yearly heatmap
- Dark/light adaptive, utilizing only DSH theme variables (no third-party chart libraries)
Data Sources & Billing Metrics¶
The plugin does not log independently; instead, it folds the usage events already persisted in DSH session logs:
- Active sessions via
snapshotEvents(); historical sessions viasessionPersistence.open/read, skipping unchanged logs based onrevision - Billing aligns with the official
tokenUsageprojection: replaced at the same(turn, step); retries afterllm/retry-startedare accumulated; stream usage fromassistant/attemptis also included - For forked sessions, the parent session prefix is skipped via
inheritedEventCountto avoid double billing - Cost = Σ (each token bucket × corresponding unit price) / 1e6
- Price matching prioritizes
provider/model, followed by baremodel; unconfigured models are marked as “Unpriced” with cost recorded as 0
Installation & Activation¶
The plugin is published on npm as dsh-plugin-usage. Follow the README for installation commands; do not construct github:owner/repo formats manually.
DSH Desktop
- Open Settings → Plugins → Add Plugin
- Enter
dsh-plugin-usageand confirm
Web / CLI profile
After adding the plugin under the corresponding profile, a restart is required for it to take effect:
dsh plugin --profile <name> add dsh-plugin-usage
For upgrades: click update on the plugin page in Desktop; use the update subcommand for CLI (following the same profile convention as add).
Note: The desktop profile is exclusive to the Electron app and cannot be operated via dsh plugin --profile desktop.
Configuration¶
Modify the following in Settings → Plugins → dsh-plugin-usage:
currency: Default display currencyprices: Price per million tokens
Configuration is written to the profile patch and retained after restart. The ¥ / $ switch on the reference cost card in the dashboard only affects the current interface (the choice is remembered within the same browser session).
Compatibility & Environment¶
Declared in package.json:
- DSH:
>=0.2.0-rc.2 <0.3.0(engines.dsh) - Node:
>=22
Earlier hosts retain the Session.events / readFrom fallback path.
Use Cases & Notes¶
Who is it for
- DSH users who need to review tokens and call counts by day or custom intervals
- Users mixing multiple models who require filtering, details, and model proportions
- Those who want to perform reference cost estimation within the same interface and are willing to maintain or use the built-in price list
Please be aware before use
- The plugin runs with the permissions of the current DSH process. It is recommended to read the source code and the MIT license before installation to ensure it meets your security and compliance requirements.
- The community directory SkillHub is an independent site with no official affiliation with DeepSeek / High-Flyer. Metadata such as stars is subject to the directory and GitHub pages (README-side repository shows approx. 3 stars, 1 fork).
Conclusion¶
dsh-plugin-usage folds existing session usage in DSH into a filterable dashboard: time ranges, model details, configurable pricing, and heatmaps, all aligned with official tokenUsage metrics. If you are running agents long-term in DSH, using this for usage and reference cost reviews is more direct than manually checking logs.