The Settings page of DeepSeek Harness (DSH) currently lacks visualization of Token usage. zcode-usage-stats is an unofficial plugin that adds a statistics panel to the Settings page for viewing Token consumption across the entire session history.
Plugin Positioning¶
This plugin is maintained by Amer-CN and is a community plugin. It is not affiliated with DeepSeek or ZCode. It uses purely local scanning and rendering, keeping data on the local machine.
Core Features¶
- Local scanning and aggregation of full session history: Reads local session files and aggregates them by day, hour, and model.
- Calendar dot matrix heatmap: Displays daily activity, with support for daily/weekly/cumulative bucketing.
- Multi-model usage trends: Line charts show usage trends for each model, with hover support to view individual model breakdown.
- Gauge dashboard: Displays the usage share of each model.
- Custom time range filtering: Supports Today, Yesterday, Last 7 days, Last 30 days, This month, Last month, All, and custom date ranges.
- Dark/light theme support: Follows DSH dark/light themes and complies with WCAG AA contrast requirements.
- Statistics metrics: Cumulative Tokens, single-day peak, longest session duration, and consecutive days.
Installation and Activation¶
Prerequisite: @deepseek-ai/dsh must be installed (along with pnpm required by DSH plugin commands).
dsh plugin --profile web add zcode-usage-stats
After installation, restart the DSH process and open Settings → Usage Statistics to view the statistics page.
Usage¶
- Switch time range: Switch the time range at the top; the “All” option displays all historical data.
- View trends: Hover over the trend chart to view model-level breakdowns, and click the legend to show or hide the corresponding model.
- Refresh data: Click the “Refresh” button to force a rescan of all sessions.
Technical Details¶
- Zero-dependency charts: Charts are rendered with hand-written SVG, with no runtime chart library dependencies.
- Dual-layer caching: Uses an in-memory + disk dual-layer cache (SWR) to avoid lag during initial page load.
- Security mechanism:
/api/usage-statsis authenticated via the host trust fence.
Notes¶
- Unofficial plugin: Not affiliated with DeepSeek or ZCode.
- Data security: Purely local scanning, local aggregation, and local rendering keep data on the local machine.
- Dependency version: Pinned to
@deepseek-ai/dsh >= 0.1.0-rc.5.