Preface

When running multiple workspaces and sessions in DeepSeek Harness (DSH), it’s often difficult to track where tokens are being spent, which days have the highest usage, and whether cache hits occurred—usually requiring digging through logs or making rough estimates. The official console can check balances, but it doesn’t align with local session usage or workspace-level details.

Here, we introduce the community plugin dsh-usage-stats (maintained by Make0209, categorized under admin-security). It aggregates persistent session logs into a GitHub-style heatmap and statistical cards, provides workspace alias management in the settings panel, and automatically backfills historical data upon installation.

What This Is

dsh-usage-stats is a standard DSH community plugin package: it declares a dsh.bundle manifest and includes both host-side and web client-side components. All data comes from DSH persistent session logs, with no dependency on external statistics services.

  • Directory Page: https://www.skillhub.cn/plugins/Make0209/dsh-usage-stats
  • Source Code: https://github.com/Make0209/dsh-usage-stats
  • License: MIT

Core Features

Usage Heatmap

A 53-week GitHub-style green grid layout: each completed turn lights up the corresponding date. Hovering over a cell reveals the daily breakdown of counts and tokens by workspace.

Statistical Cards

The dashboard summarizes the following metrics:

  • Total tokens spent (with itemized display)
  • Cache hit rate
  • Account balance (queries DeepSeek’s official /user/balance endpoint, reusing the llm-deepseek API Key configuration)
  • Total usage count, consecutive days of usage
  • Token progress bars for each workspace

Supports switching between recent 30 days, recent 90 days, and all time ranges, with transition animations and adaptive light/dark themes.

Workspace Aliases

The settings page header provides a “Workspace Aliases” entry. Aliases are persistently saved in a KV unit usage-stats-aliases under $DSH_HOME/storages, allowing readable names to replace raw paths in the heatmap and cards.

Data and Interfaces

The host side (lib/index.js) scans session logs, aggregates turn/end and assistant/message.usage events, and listens to session/event for real-time updates. It registers the following externally:

  • GET /api/usage-stats — Statistics snapshot
  • GET /api/usage-stats/balance?force=1 — Account balance
  • POST /api/usage-stats/alias — Set workspace aliases

The client side (lib/client.js) registers the “Usage Statistics” page in the settings panel (in the settings.section slot) via window.__ModuleLoader__.

Only sessions that can be attributed to registered workspaces (matched by session cwd) are counted. Historical data is preserved after plugin uninstallation or restart.

Installation and Enablement

It’s recommended to install using the official plugin command to the web profile:

dsh plugin --profile web add dsh-usage-stats

After installation, simply refresh the page—no configuration changes or DSH restart required.

If using a local package, symlink the directory to $DSH_HOME/profiles/node_modules/ and insert the plugin registration entry into $DSH_HOME/profiles/web/cordis.patch.yml; the changes will take effect via page hot-reload after saving. For specific symlink and patch details, see the GitHub README.

Typical Usage

  1. Run the above installation command and refresh the DSH Web interface.
  2. Open Settings, go to the “Usage Statistics” page, and view the heatmap and cards.
  3. To display the account balance, first configure the llm-deepseek API Key in DSH; if not configured, the balance card will show guidance text.
  4. Click the header workspace alias management to set aliases for frequently used cwd paths, making it easier to compare usage across multiple workspaces.
  5. Switch between 30 days / 90 days / all time to observe changes in token usage and cache hit rates.

During development, modifying lib/client.js and refreshing the page takes effect immediately; modifying lib/index.js requires restarting DSH. The plugin package has no third-party dependencies.

Use Cases and Considerations

Suitable for developers who need to track local DSH usage long-term, compare token usage by workspace, and check DeepSeek account balances.

Before installation, please note:

  • The plugin runs with the current DSH process permissions and will read local session logs and API Key configurations. Before installing, review the source code and confirm the MIT license.
  • Balance queries go through the official interface and are independent of session statistics; the statistical scope is limited by workspace registration and cwd matching rules.
  • SkillHub is a community directory site and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-usage-stats consolidates scattered turn and token information from session logs into a heatmap and a set of cards, with support for workspace aliases. It’s well-suited as a daily usage self-check tool for DSH. For more information, see the SkillHub Directory Page and the GitHub Repository.