dsh-token-usage
Manifest validA clearer, more polished session Token usage bar: context usage, input/output/cache breakdown, throughput, and time-to-first-token, replacing the default plain-text stats line
The shipped DeepSeek Harness web UI squeezes token usage into one cramped line of text under the composer. dsh-token-usage replaces it with a glanceable chip bar plus a details panel with the full breakdown — and it follows your theme, light or dark.
🎯 Token usage shouldn't have to be decoded — it should be readable at a glance.
Screenshots
The token-usage bar under the composer.
The details panel — click the bar to open it.
Contents
Highlights
- Context at a glance — a thin occupancy bar that turns green → amber → red as you fill the context window.
- Input, output, and cache, separated — billed input splits into cache-read / cache-write / uncached, with the cache-hit rate shown up front.
- Speed where you need it — decode throughput (
tok/s) and average first-token latency (TTFT) right on the bar. - A details panel on click — context composition (system / tools / messages), a stacked input split, and session turn / step / model / tool time.
- Natural edge fades — the panel's top and bottom edges fade and blur while there's more to scroll, and vanish at the ends.
- Theme-adaptive and bilingual — styled only with
--dsw-*tokens (light/dark), shipped in Chinese and English.
What it shows
The bar under the composer shows these chips, left to right:
| Chip | Meaning |
|---|---|
| Context | Used / window tokens, with a color-coded occupancy bar |
| Input | Total billed input (cache read + cache write + uncached) |
| Output | Provider-reported output tokens |
| Hit rate | Cache-read share of billed input |
| tok/s | Decode throughput over usage-reporting steps |
| TTFT | Average first-token latency |
Clicking the bar opens a panel with context occupancy + composition, the input-split stack, throughput / TTFT, and session counts. The whole line hides itself when there is no data yet.
Install
From GitHub (recommended):
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:hashdiana/dsh-token-usage
From a local checkout:
npx -p @deepseek-ai/dsh dsh plugin --profile web add <path-to-this-repo>
Then restart the profile:
dsh web
The Git path ships the built
lib/(see Build & develop), so no build script runs at install time.
Uninstall / Disable
Temporarily disable without uninstalling — add to $DSH_HOME/profiles/web/cordis.patch.yml:
- id: dsh-token-usage
disabled: true
Restart dsh web; the default stats line returns. Remove those lines to re-enable.
Build & develop
pnpm install
pnpm typecheck # tsc -b
pnpm build # tsc -b + tsdown → lib/index.js (host) + lib/client.js (browser)
pnpm test # vitest: folds, locale parity, jsdom render, slot registration/dispose
The client bundle is emitted as window.__ModuleLoader__.load({ id, factory }); CSS Modules are hashed by lightningcss and injected as a <style data-plugin="dsh-token-usage"> tag. Commit lib/ — Git installs consume the built output, not src/.
How it works
- Pure client plugin — the host half is an empty
apply(); the browser half ships viaexports["./client"]. - Slot — registers into
conversation.composer.dock(cellid: "stats",priority: -1), shadowing the shipped text line; the registration is withdrawn with the plugin fiber. - Data — reads the durable projections
tokenUsage,contextPressure,contextBreakdown, andsessionStats; a window fold serves only as the no-projection fallback. - Locale — owns the
tokenUsagenamespace, Chinese and English.
License
Comments
Loading…
From the same category
by nexu-io
🎨 Best DeepSeek Harness Design Plugin. The open-source Claude Design alternative. 🖥️ Local-first desktop app. 🖼️ Your coding agent becomes the design engine: prototypes, landing pages, dashboards,
★ 98.6k
Apache-2.0
TypeScript
Sep 29, 2026
by Molunerfinn
:rocket: The Ultimate Image Uploader for Efficient Creators. Supports Obsidian, Typora, VS Code etc. and 60+ image hosting services (S3, GitHub, Cloudflare R2, Imgur, Aliyun OSS...). Paste, upload, d
★ 27.3k
MIT
TypeScript
Sep 24, 2026
by zhu1090093659
DeepSeek Harness (DSH) Web Plugin Aggregation Ecosystem · Everything is a plugin, distributed via the Creative Workshop
★ 8.1k
Apache-2.0
TypeScript
Sep 29, 2026
dsh plugin --profile web add dsh-webby YaoApp
✨ All your agents and workspaces in one place, on every device you own. Track tasks on a board, accessible from desktop, mobile, browser, or API. Self-hosted.
★ 8k
Go
Sep 28, 2026
by omdsh-dev
开放的侧边栏底座,支持三方拓展注册新侧边栏页面。内置文件渲染编辑/终端/侧边对话/Git/子代理页面 | Open sidebar foundation, supports third-party extensions to register new sidebar pages. Built-in file rendering/editing, terminal, side chat, Git,
★ 3.9k
↓ 49.8k/wk
MIT
TypeScript
Sep 28, 2026
dsh plugin --profile web add dsh-better-sidebarby ccch1mneyyy
DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol
★ 3.8k
↓ 10.1k/wk
MIT
TypeScript
Sep 29, 2026
dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tui