Introduction

DeepSeek Harness (DSH) delegates functional extensions to plugins. For developers using DSH Web, token usage often needs to be compiled from session logs. If you need cumulative reviews, daily peak checks, or observing consecutive days, you need a centralized entry point.

QuanWenG/token_usage_heatmap is a Token usage statistics plugin for the DSH Web settings page. It provides daily, weekly, and cumulative views for the last 53 weeks, and supports mouse hover and keyboard focus to view details. This plugin does not modify the DSH source code.

What is this

This plugin is maintained by QuanWenG with the repository at QuanWenG/token_usage_heatmap. It targets the DSH web profile, is compatible with DeepSeek Harness >=0.1.0-rc.5 <0.2.0, and is licensed under MIT.

After installation, it displays Token usage statistics in “Settings → Personal Statistics” in DSH Web, including cumulative tokens, daily peak, maximum chat duration, current streak, maximum streak, and a 53-week heatmap.

Core Features

Below are the main capabilities listed for the plugin:

  • Display cumulative tokens, daily peak, maximum chat duration, current streak, and maximum streak.
  • Provide daily, weekly, and cumulative views for the last 53 weeks.
  • The higher the token usage, the more pronounced the cell color or weekly bar height.
  • Mouse hover and keyboard focus allow viewing precise token counts, as well as details for Input, Output, Cache Read, and Cache Write.
  • Supports Chinese and English, Light/Dark themes, horizontal scrolling, and responsive layout.
  • Derives statistics in real-time from existing session logs; historical records before installation are automatically included.
  • Does not modify the DSH source code.

Installation and Enabling

Install after cloning source code

First, clone the repository and enter the plugin directory:

git clone https://github.com/QuanWenG/token_usage_heatmap.git
cd token_usage_heatmap

Next, install dependencies, and run tests, type checking, and building:

pnpm install
pnpm test
pnpm typecheck
pnpm build

Then, in the plugin directory, execute the installation, configuration export, and start commands:

dsh plugin --profile web add .
dsh --profile web --dump-config
dsh --profile web

After starting, open:

http://127.0.0.1:3080

Go to “Settings → Personal Statistics” to view the plugin page.

Install directly from GitHub

You can also add the GitHub repository directly to the web profile and lock it to a specific tag or commit:

dsh plugin --profile web add github:QuanWenG/token_usage_heatmap#<tag-or-commit>

The <tag-or-commit> in the command is a placeholder; it needs to be replaced with a specific tag or commit during actual installation.

pnpm Build Script Notes

Source code building requires Corepack, and the repository is fixed to use pnpm 11.7.0. When installing directly from GitHub, pnpm 10 or higher is required.

pnpm 10 and above blocks dependency build scripts by default during installation. If the first installation is rejected, you need to confirm the source is trusted first, then add the allowBuilds configuration to the pnpm-workspace.yaml of that profile:

allowBuilds:
  dsh-plugin-token-usage-heatmap: true

After confirming the source is trusted, re-run the installation command.

Typical Usage

After successful installation, open “Settings → Personal Statistics” in DSH Web to see cumulative tokens, daily peak, maximum chat duration, current streak, and maximum streak.

The heatmap will display daily, weekly, and cumulative views for the last 53 weeks. The higher the token usage, the more pronounced the cell color or weekly bar height.

When hovering over or focusing on a statistical unit with the mouse or keyboard, you can see precise token counts, as well as details for Input, Output, Cache Read, and Cache Write. Statistics are derived in real-time from existing session logs, and historical records that existed before installation are also included.

Configuration Notes

If you need to adjust plugin configuration synchronously, you can override maxConcurrentSessionReads in the profile’s cordis.patch.yml. The allowed range is 1–32:

maxConcurrentSessionReads: 1

The 1 above is just a lower limit example; choose the actual value as needed. Since DSH’s post-patch replaces the entire config rather than performing a deep merge, you need to retain all still-needed configuration keys when overriding plugin configuration.

Streaks and Deleting Sessions

If there is no usage today, the current streak is not immediately broken. If usage occurs today, today is counted toward the streak.

After deleting a session, that session’s token contribution will disappear on the next read. The plugin does not create or copy session events.

Use Cases and Notes

Suitable for developers using the DSH web profile who want to review token usage, 53-week usage trends, and streaks within a single settings page. You should confirm that the running version is within the compatible range before use: DeepSeek Harness >=0.1.0-rc.5 <0.2.0.

The plugin runs with the permissions of the current dsh process and reads session logs to derive statistics, so you should check the source code, license, and dependencies before installation. This plugin is licensed under MIT.

The community directory is an independent site with no official affiliation to DeepSeek or Huansuan; do not interpret it as an official app store.

Links

  • GitHub: https://github.com/QuanWenG/token_usage_heatmap
  • Directory page link: https://www.skillhub.cn/plugins/QuanWenG/token_usage_heatmap