pythonshiyi/dsh-plugin-tokenmeter
Token consumption display plug-in (DeepSeek Harness web UI): real-time token usage of each reply | Per-message token usage chips for DeepSeek Harness web UI
dsh-plugin-tokenmeter shows per-message token usage under every completed assistant turn in the DeepSeek Harness web UI. A chip displays ↑ input / ↓ output ·cache<rate>% for the whole turn (including tool-call steps, which are billed separately on the input side) plus a session total, with a brain marker on turns that used reasoning tokens (a subset of output, never double-counted). The session total comes from the harness tokenUsage projection (an incremental fold over the whole durable log) and by default renders only on the last assistant message. Hovering shows cache read/write, reasoning tokens and step count. It is localized (zh/en) and uses theme variables so it adapts to light/dark automatically. Billed input is counted as inputTokens + cacheReadTokens + cacheWriteTokens (disjoint counts).
Install
cd ~/.dsh/profiles && npm install https://github.com/pythonshiyi/dsh-plugin-tokenmeterThe package is NOT published to the public npm registry -- a registry lookup for dsh-plugin-tokenmeter returns 404 as of 2026-09-30 -- so the README's Option A (npm install dsh-plugin-tokenmeter, 'once published') is not currently usable; use the GitHub URL form above into your profile's ~/.dsh/profiles directory, then register the row (id: plugin-tokenmeter, name: dsh-plugin-tokenmeter) in the profile patch and restart dsh --profile web. The README also documents a local-directory form (npm install /path/to/dsh-plugin-tokenmeter).
Compatibility
DeepSeek Harness web profile (dsh --profile web) with the standard web plugin roster (conversation UI, sessions). The plugin depends on internal snapshot shapes (chat.legacy.nodes / chat.locations / assistant-step node finalNode.usage); the README states that if a future harness changes these shapes the chips degrade silently to nothing (every access is guarded) rather than erroring. Developed against DSH 0.1.0-rc.6.
Details
- Repo: pythonshiyi/dsh-plugin-tokenmeter
- Category: Web UI Enhancements
- Stars: 1
- Version: source / GitHub install (not on the public npm registry as of 2026-09-30); MIT
- Last push: 2026-08-15
- First seen: 2026-08-14
Recent updates
The README documents the row config block (showCumulative: all/last/none, showCachePercent, compact) and the slot it registers into (conversation.chat.assistant-actions, id token-usage, order 5), plus the note that a retried step only counts its last attempt (following the harness's own snapshot semantics) and that only calls where the model reported usage show a chip.
FAQ
- How do I install dsh-plugin-tokenmeter?
- Use the README's Option B: cd ~/.dsh/profiles && npm install https://github.com/pythonshiyi/dsh-plugin-tokenmeter, then register the plugin-tokenmeter row and restart. The package is not on the public npm registry (a lookup returns 404), so the README's Option A is not currently usable.
- Why are multi-step tool-call turns so expensive?
- The README explains each tool call re-sends the full context and is billed separately on the input side, and the plugin truthfully aggregates every step of the turn.
- Why do some messages have no chip?
- Only calls where the model reported usage show a chip, and history outside the current window cannot be tallied; the README notes failed retries under-report their real cost because only the last attempt is kept -- a documented convention, not a counting bug.
Alternatives
LeemanCheung/dsh-token-usage · YZz-S/dsh-token-cost-meter · zhangzheng25/dsh-token-monitor