Preface

The core philosophy of DeepSeek Harness (hereinafter referred to as DSH) is “Everything is a plugin”: models, tools, sessions, and UIs are all composed of plugins, and developers can extend capabilities without modifying the framework source code. The official repository is located at deepseek-ai/deepseek-harness. There is also an independent plugin directory site in the community for retrieving and installing third-party plugins; this directory has no official affiliation with DeepSeek / FangFuture and is not an official app store.

A very specific problem repeatedly occurs when using DSH for long conversations: how much context the current session has taken up, how much this round of conversation cost approximately, and how many tokens have been used today and this month. DSH itself provides underlying services such as token metering and session projections, but these numbers are not permanently displayed in the default interface. The community plugin dsh-token-panel does a straightforward job: hanging a draggable Token dashboard in the lower right corner of the Web UI, displaying session pressure, per-model costs, and daily/monthly usage breakdowns.

This article is organized after cross-checking the plugin directory page, GitHub repository README, package.json, cordis.patch.yml, and CHANGELOG, with the version based on the currently released 0.4.7 of the repository.

What is This

dsh-token-panel is a session and message plugin for DSH, maintained by juhe291, licensed under MIT, mainly written in TypeScript, with the client platform declared as web. The GitHub repository currently has 7 stars (subject to the repository page; it showed 6 stars when listed on the directory site).

One-sentence positioning: A permanently displayed Token HUD in the lower right corner. It reads DSH’s tokenMeter, sessionProjections, session title and other services, separately displaying “how much context is currently occupied” and “how much has been used cumulatively in history”, and estimates costs based on DeepSeek’s official price list; budgets and balances can be modified directly on the panel, and usage is logged to local files by day.

The repository was created on 2026-08-14, with the latest push around 2026-08-17. The listing description on the plugin directory page and the repository README are consistent in describing the core capabilities: real-time session pressure, session cost, historical curves, daily/monthly statistics, the panel follows the current conversation, can be dragged and the default position customized.

Core Features

A mini capsule first appears in the lower right corner, showing the total token pressure; clicking it expands to a dual view of Real-time / Statistics. The color scheme follows DSH’s light/dark theme. By default, the panel only follows the currently open conversation, does not display empty sessions (0 tokens), and historical sessions are hidden behind “Expand All”.

Real-time View

  • One row per session: title, current context pressure (in k units), cumulative consumption (gray small text, in M units, including cache reads), estimated cost of this session (green ¥). The title comes from DSH’s session title service.
  • Clicking on a session row reveals input/output/cache read/cache write, pressure/estimated/capacity, estimated cost and a context occupancy progress bar; the progress bar turns red when occupancy exceeds 85%.
  • Each session has an independent SVG area curve, supporting 2-minute/5-minute/15-minute windows; the curve comes with automatic Y-axis scaling, time scaling and hover bubbles. There is a time drag bar below the curve to review an earlier segment in the buffer.
  • The peak consumption rate (t/s) within the window is displayed at the top of the curve area; the capsule and bottom bar also show the generation speed TPS.
  • The real-time curve is a rolling memory window (about 600 points, corresponding to approximately 15 minutes), and resets to zero after restarting. Long-term trends require the statistics view.

There is an easy-to-misunderstand metric, which is clearly stated in the repository README: the main real-time number is current context pressure (currently occupied, usually in the hundreds of thousands, in k units); the daily/monthly metrics in the statistics view are historical cumulative consumption (input + output + cache reads all summed up, cache reads are often the largest, up to hundreds of millions per day, in M units). Seeing “Real-time 400k / Statistics 100M” does not mean the panel is miscalculated, the two metrics are not the same thing. The gray small text on the session row matches the statistical metric.

Statistics View

  • A top row summarizes cumulative tokens and estimated costs.
  • Switch granularity between “Daily / Monthly”, with trend curves and detailed lists; the details are collapsed by default, expand by clicking “Expand All”.
  • Monthly budget and account balance can be edited inline after clicking (press Enter to save, Esc to cancel). The budget will display a progress bar of this month’s used / total amount, turning red when over budget. The balance decreases locally according to the estimate as tokens are consumed; if not manually set, it falls back to the official website balance pulled via API (5-minute cache).
  • Data is written as JSONL by day, with the default directory being ~/.dsh/cache/dsh-token-panel/, and continues after restarting without losing or duplicating data.

Cost Estimation

The cost is not calculated arbitrarily, but is bucketed by model: two built-in price lists for deepseek-v4-flash and deepseek-v4-pro, with separate billing for cache hits, missed inputs, and outputs. Sessions that have used mixed models will not be assigned a single price for the entire segment.

The default priceMode is auto: before 00:00 (Beijing time) on 2026-08-17, the original flat price is used, and after that, it automatically switches to DeepSeek’s official peak/off-peak pricing (peak hours 9-12, 14-18). A badge at the bottom of the panel will display “Standard Price / Peak Price / Off-Peak Price”. The repository clearly states: these numbers are for display reference only, and the final bill shall prevail at the DeepSeek Open Platform.

Panel Interaction

Three gestures do not conflict with each other:

  1. Single-click the capsule to open the panel.
  2. Press and hold the capsule or panel header to drag; it can be dragged off the screen edge, but a header bar will remain for easy retrieval. The position is remembered and will not be lost after refreshing.
  3. Long-press for about 0.6 seconds to bring up the position menu: preset four corners, customize the default position, and hide the entire HUD. After hiding, you can turn off the hidden switch in DSH settings to display it again without uninstalling the plugin.

Installation and Activation

The installation command given on the plugin directory page is as follows, run it in the DSH terminal:

dsh plugin add github:juhe291/dsh-token-panel

The directory page also reminds users that for reproducible installations, the commit hash should be pinned:

dsh plugin add github:juhe291/dsh-token-panel#<commit>

The repository README provides more details. It recommends installing to the web profile, and suggests installing the exact version (0.4.7 as stated in this document) from npm, so that the pre-packaged lib/ can be used directly without building locally:

dsh plugin --profile web add dsh-token-panel@0.4.7

Installation from GitHub is as follows:

dsh plugin --profile web add github:juhe291/dsh-token-panel

Local path installation (replace the path with your own checkout directory):

dsh plugin --profile web add /path/to/dsh-token-panel

After installation, you need to restart the profile, then refresh the browser, and the TOKEN capsule should appear in the lower right corner.

Uninstallation:

dsh plugin --profile web remove dsh-token-panel

Several installation-side limitations from the repository instructions should not be overlooked:

  • If the terminal prompts that dsh cannot be found, install the CLI first: npm install -g @deepseek-ai/dsh, then restart the terminal.
  • When installing from GitHub/local, pnpm ≥ 10 may block the prepare script of Git dependencies, reporting ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED. Add the allowBuilds entry to the profile’s pnpm-workspace.yaml as prompted by the error, then run the installation again. This is pnpm’s security mechanism, which allows this code to execute during the installation phase outside the agent sandbox.
  • Source code installation will run a build, and the repository specifies that Node ≥ 22.5 is required; Node 20 will fail. Installation from npm does not go through this step.
  • Newly published npm packages may be blocked by DSH’s supply chain age check within about 24 hours, and @latest may resolve to an older version, so the README requires specifying the exact version number. For the same reason, dsh plugin remove may also fail when the package is newly released, and the repository provides scripts/uninstall.mjs as an alternative uninstallation method.

Typical Usage

After installation and refreshing the page, follow the operation sequence given in the repository:

  1. Single-click the lower right corner capsule to expand the panel.
  2. Use the header’s “Real-time | Statistics” to switch views, click “✕” to collapse (the position remains unchanged after collapsing).
  3. In the real-time view, click the session row to view details and curves; use 2m/5m/15m to switch windows, and use the bottom drag bar to review the buffer.
  4. In the statistics view, switch between “Daily / Monthly”, click the budget or balance value to modify directly; if no balance is set, the official website balance pulled via the API will be displayed.
  5. Click “Expand All” when you need to view historical sessions. To hide the HUD, long-press the menu and select “Hide HUD”, or turn on the hidden switch in DSH settings.

To modify pricing or polling intervals, edit cordis.patch.yml (or the plugin section in settings.yaml) in the profile. The default configuration given by the repository is as follows, refer to the README for the meaning of each field:

- id: token-panel
  name: dsh-token-panel
  config:
    pollInterval: 1500          # Browser real-time polling interval (ms)
    priceMode: auto             # auto / flat / peak-offpeak
    pricePerMInput: 1           # Missed input, CNY / million tokens
    pricePerMCacheRead: 0.02    # Cache hit
    pricePerMOutput: 2          # Output
    budgetMonthly: 0            # Monthly budget (CNY), 0 means disabled
    hidden: false
    # dataDir: ~/.dsh/cache/dsh-token-panel

priceMode: auto will automatically switch from flat price to peak/off-peak pricing at 00:00 on 2026-08-17, so generally no changes are needed. For other models or vendors, you need to supplement modelPrices yourself. budgetMonthly can also be modified without changing the configuration, by clicking the value directly in the statistics view.

The usage logs look like this by default:

~/.dsh/cache/dsh-token-panel/
├── usage-2026-08-14.jsonl   # Daily increment: input/output/cache read/cache write/model
├── state.json               # Last usage baseline, continues after restart
└── known-sessions.json      # Session registry, "Expand All" retains historical sessions

Technically, it is divided into two parts: The Host side aggregates ctx.tokenMeter.measure(), ctx.sessionProjections.snapshot(), ctx.sessionTitle.get(), and registers three routes: /plugins/dsh-token-panel/snapshot, /stats, /balance; The Client side mounts the panel to the lower right corner of the page, polling real-time data every ~1.5 seconds, statistics every 10 seconds, and balance every 60 seconds. The interface language follows DSH’s Chinese/English settings.

Applicable Scenarios and Notes

It is quite suitable for these types of usage: leaving the DSH Web UI running for a long time while coding or running agents, needing to monitor whether the context is approaching the upper limit at the same time, and wanting to view daily/monthly usage and estimated costs. The peer dependency declarations target the client and session/token-meter services of DSH 0.1.0-rc.6 and its variants, and the platform is web, so do not expect it to appear in a pure terminal profile.

Pay attention to these points when using:

  • Digital metrics: Do not compare pressure (real-time) and cumulative consumption (statistics) directly. Cache reads are included in the cumulative total, so the statistical numbers will be much larger.
  • Cost is an estimate: Calculated based on the built-in official price list, excluding discounts, credits and other account items. If the balance is manually entered by you, it will decrease locally according to the estimate afterwards, and if it does not match the official website, re-enter the value to calibrate.
  • Real-time curves are not persistent: Only a ~15-minute memory window; to retain historical data, check the statistics view and the JSONL files on disk.
  • Permissions and supply chain: The plugin runs with the permissions of the current dsh process, and code may be executed during installation. Both the directory page and official plugin documentation require: check the source code repository and license before installing; only turn on allowBuilds for trusted packages; in production environments, try to pin commits to avoid silent changes to the actual running code from subsequent pushes.

Summary

dsh-token-panel brings DSH’s existing token metering data to the lower right corner: current pressure, per-model costs, daily/monthly usage, and editable budgets, all viewable on a draggable HUD. It is an MIT-licensed open-source plugin maintained by juhe291, not an official DeepSeek component; the community directory is only responsible for listing and providing installation entries.

Directory page: https://deepseek-harness-plugin.com/zh-CN/plugins/dsh-token-panel/

GitHub: https://github.com/juhe291/dsh-token-panel