Preface

Developers who have run DSH (DeepSeek Harness) for a while often have a question: Where exactly are the tokens being spent? Is it a long session eating them up, or is a specific plugin or Skill continuously consuming them? DSH’s built-in token-meter has data, but there is no place on the interface to aggregate and view the consumption of the entire instance in one place.

dsh-token-usage solves this problem: adding a Token usage statistics panel to the DSH Web interface to aggregate and display the Token consumption of all sessions in the currently running instance. The interface mimics the style of the Codex personal usage page, requiring almost zero learning curve for developers familiar with Codex.

What is this

dsh-token-usage is a DSH plugin developed by jiamuAi, currently version 0.1.0, status is beta, license MIT. One-sentence positioning: DSH Token Usage Statistics Panel (Codex Style) — Full Instance Token Consumption Aggregation + Activity Heatmap.

The plugin relies on DSH built-in packages (@deepseek-ai/*). Placing it in the DSH repository allows for automatic resolution without additional installation. The build artifacts lib/ have been committed to the repository; once installed, it runs immediately.

Core Features

  • 5 Key Metrics: Cumulative / Single-session Peak Token, Longest Chat Duration, Current / Longest Consecutive Days
  • Token Activity Heatmap: Three views: Daily (GitHub contribution graph style) / Weekly (bar chart) / Cumulative (line chart), hover to view values
  • Activity Insights + Top 5: Includes activity insights for the most frequently used models, as well as Plugin / Skill Top 5
  • Two Native Entry Points: “Token Statistics” button at the bottom of the sidebar (app-level persistence); real-time usage capsule in the session header, auto-refresh every 5 seconds
  • Deep Space Purple Dual Theme (Dark / Light), follows system or manual toggle
  • Data refreshes every 5 seconds, historical sessions are auto-filled, and data is retained after restart

Data scope is consistent with DSH’s built-in token-meter: Cumulative Token = input + output + cacheRead + cacheWrite, no double counting.

Installation and Activation

There are two installation methods.

Send this sentence to your DSH Agent, and it will read the repository documentation and complete the installation:

You take a look at this repository: https://github.com/jiamuAi/dsh-token-usage , then help me install dsh-token-usage on my DSH.

Method 2: Manual Installation

First clone the repository and copy it to the plugin directory of the DSH source code, then execute installation and build in the DSH repository root directory:

git clone https://github.com/jiamuAi/dsh-token-usage.git
cp -R dsh-token-usage <your-deepseek-harness-path>/packages/extensions/
cd <your-deepseek-harness-path> && pnpm install && pnpm run build:lib

<your-deepseek-harness-path> refers to the location of the DSH source code on your machine. If you don’t know where it is, execute in the terminal:

readlink -f $(which dsh)

You can see the real path of dsh, then look up the deepseek-harness directory.

After copying is complete, edit ~/.dsh/profiles/web/package.json, add "dsh-token-usage" to dsh.profile.bundles, then restart dsh web and refresh the page.

Two notes:

  1. lib/ is the committed build artifact; general users usually do not need to build. If you want to modify the code, you need to place src/ under packages/extensions/dsh-token-usage/ in the DSH repository, build using the DSH repository’s compilation tools (tsc + tsdown + Typert generator), and sync the artifacts back to the repository for commit.

  2. The plugin relies on DSH built-in packages (@deepseek-ai/*). After placing it in the DSH repository, it is automatically resolved; no additional dependencies need to be installed.

Typical Usage

After installation and activation, use it as follows:

  1. After restarting dsh web, a “Token Statistics” entry appears at the bottom of the left sidebar.

  2. Open any session, a real-time usage capsule appears next to the title, for example ⚡ 2.61亿, auto-refreshing every 5 seconds.

  3. Click any entry to open the panel; you can switch themes and close the panel in the top right corner.

  4. The heatmap supports switching between three views; hovering shows single-day / single-week / cumulative values.

Data refreshes every 5 seconds, historical sessions are auto-filled, and data is retained after restart.

Suitable Scenarios and Notes

Suitable for these people:

  • Individual developers who have been using DSH for a long time and want to know where tokens are going
  • Users familiar with the Codex usage page who hope DSH has a similar view
  • Users who need to troubleshoot which plugin or Skill consumes the most

Two things to note before use:

  1. The plugin is currently beta (0.1.0), and functionality and data scope may change with versions.

  2. The plugin runs with the permissions of the current dsh process. It is recommended to check the repository source code and license (MIT) before installation to ensure everything is correct.

Ending

dsh-token-usage does one simple thing: turning the Token data already recorded by DSH into a directly viewable panel, presenting cumulative, peak, heatmap, and Plugin Top 5 all at once. If you are concerned about “Where are the tokens going?”, you can install and try it.

  • GitHub Repository: https://github.com/jiamuAi/dsh-token-usage
  • Community Directory Page: https://www.skillhub.cn/plugins/jiamuAi/dsh-token-usage

It should be noted that skillhub.cn is an independent community plugin directory site with no official affiliation with DeepSeek / High-Flyer, serving only as a plugin index.