Introduction

DeepSeek Harness (DSH) relies on plugins to extend its functionality. In daily development or use, it is important to intuitively track the day’s Token consumption, cache hit rate, and account balance. The dsh-plugin-duwg plugin mounts a widget below the input box, aggregates Token consumption from all sessions for the day, and provides a visual display of cache hit rate and balance.

What It Is

This plugin is maintained by developer Yolotd and is a client-side plugin. The core problem it addresses is: while using DSH, users cannot quickly see precise Token statistics and balance status for the current day. The plugin reads local session logs and gateway-passed-through data to aggregate and display the data.

Core Features

The plugin provides the following features:

  • Today’s total consumption: Aggregates the total Token count for input, output, cache-read, and cache-write across all sessions for the day.
  • Session log calibration: When the plugin starts, it scans .l.zstd files in the $DSH_HOME/sessions directory for calibration, ensuring data is not lost after process restarts or crashes.
  • Compact “wan” / “yi” display: Large numbers are automatically converted into shorthand forms such as “wan” or “yi”; hovering the cursor displays the exact value.
  • Cache hit rate: Displays in real time the proportion of cache reads out of the total, shown as green numbers.
  • Balance health bar: Displays the current DeepSeek account balance and the highest balance for the day. The bar turns red to alert when the balance is low.
  • Estimated cost: Calculated cumulatively based on the usage.cost field passed through the gateway.
  • Persistence: Data is written to the $DSH_HOME/storages/duwg/usage.json file, supporting retention across processes and automatic reset across days.

Installation and Enabling

Before installing, make sure DSH is installed. Install the plugin with the following command:

dsh plugin --profile web add dsh-plugin-duwg

Or install from a local repository/source code:

dsh plugin --profile web add <本仓库路径或 git URL>

After installation, restart dsh web, and the widget will automatically appear below the input box.

Security and Privacy

The plugin has explicit design principles for privacy and security:

  • API Key security: The API Key exists only on the host side and never enters the browser environment.
  • Network requests: Balance queries call only the official DeepSeek API, with a 60-second cache to reduce call frequency. There are no third-party network requests or telemetry behaviors.
  • Local scanning: Session log scanning reads only local files under $DSH_HOME/sessions for usage calibration and does not send data externally.

Use Cases

This plugin is suitable for developers or users who need to monitor Token cost and cache efficiency in real time within the DSH interface. Because the data is calculated based on local files and official APIs, there is no need to worry about cloud data leakage.

Conclusion

dsh-plugin-duwg aggregates scattered Token consumption and balance information through a lightweight UI component. For those concerned with cost control or cache optimization, this plugin provides intuitive reference data.

  • Directory page: https://www.skillhub.cn/plugins/Yolotd/dsh-plugin-duwg
  • GitHub: https://github.com/Yolotd/dsh-plugin-duwg