DeepSeek Harness (DSH) is a platform for agent development. During development and debugging, managing the context budget is often overlooked until cost or performance issues arise. dsh-context-dashboard aims to address this problem by providing per-session consumption details and a global aggregate report.

This is a client-side plugin for tracking the context consumption of local DSH sessions. It is maintained by uckkk and licensed under the MIT License. The plugin can parse DSH session logs and provide a statistics panel based on character counts and estimated tokens.

Installation

Installing the plugin requires using the DSH plugin management command.

dsh plugin --profile web add dsh-context-dashboard

The command above applies to the web profile and can be replaced with other profile names.

Core Features

The plugin mainly provides two types of statistics views:

  1. Per-session statistics
    For each session, it provides the following data: message count, user and assistant message counts, tool call count, turns, character count, and estimated tokens. Sorting by token count, message count, or time is supported.

  2. Global report
    It provides an aggregate summary of all data: total message count, total estimated tokens, a list of top-consuming sessions, and summary information grouped by project (working directory).

Usage Examples

In the DSH interactive environment, you can directly call the following commands to retrieve information:

  • View per-session details: Enter session_stats. It is sorted in descending order by estimated tokens by default, making it easier to quickly identify top consumers.
  • Get the global report: Enter context_report.

Technical Details

  • Token estimation: The plugin uses the heuristic formula estimated tokens = character count / 1.5 for estimation. This formula is suitable for Chinese-centric scenarios and is for reference only.
  • Log format: Supports parsing DSH session logs in the default zstd compressed format (.l.zstd) and plain-text format (.l).
  • Runtime environment: A pure Node implementation with no third-party runtime dependencies.

Notes

  • The plugin runs with the permissions of the current DSH process. It is recommended to review the source code and license (MIT) before installing.
  • Ecosystem context: DSH follows the philosophy that “everything is a plugin,” and the community directory has no official affiliation with DeepSeek / Huanfang.