DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

token-usage-counter

t

token-usage-counter

Manifest valid

Persistent provider-reported token usage totals with per-session, per-model, and daily activity statistics.

UI (client)hasBundlePatch

Token Usage Counter for DeepSeek Harness

Persistent provider-reported token usage statistics for DeepSeek Harness. The plugin keeps uncached input, cache read, cache write, and output usage in separate buckets, and exposes cumulative, daily, per-session, and per-model views.

Features

CapabilityDescription
Accurate bucketsKeeps the four provider-reported usage buckets separate.
Persistent totalsStores data in the plugin-owned dsh-token-usage-counter settings namespace.
Multiple viewsProvides global, session, and provider/model summaries.
Daily activityTracks local-day token totals and call counts.
Built-in settings pageShips its own Web settings view and heatmap.
Safe commitsCounts usage only after a successful completion anchor.
Interactive commandRegisters /tokens when the commands service is mounted.

Install

Install the published DSH Bundle into the web profile:

dsh plugin --profile web add -w dsh-token-usage-counter
dsh web

The Bundle is additive: it mounts only the plugin-owned token-usage-counter entry and leaves the built-in usage accumulator and page enabled.

Version 0.4.0 moves persistence from the shared usage-stats namespace to the plugin-owned dsh-token-usage-counter namespace. Existing 0.3.x totals are not silently migrated because the shared namespace belongs to the built-in plugin; the new counter starts with an independent snapshot after the upgrade.

Local development

From this checkout:

dsh web --patch ./cordis.yml

The local overlay mounts src/index.ts without replacing built-in components. For a manual composition, add only the plugin-owned entry:

- insert:
    - id: token-usage-counter
      name: './src/index.ts'

Compatibility

  • Node.js: 22.13.0 or newer.
  • DSH: 0.1.2-alpha.3–0.1.2-alpha.5, 0.1.5-alpha.2, and 0.1.6-alpha.1 have profile or UI checks; intervening releases are explicitly unknown.
  • Profile: web.
  • Exact per-release results and disposable-profile evidence are recorded in docs/VERIFICATION.md.

Store listing migration details: docs/STORE-REMEDIATION.md.

Build

npm install --ignore-scripts --legacy-peer-deps --no-package-lock
npm run build
npm run verify

The generated host and client bundles are committed under lib.

Counting rules

The plugin listens to the durable session event stream:

  • assistant/message.usage is counted once.
  • compaction/summary.usage is counted as one provider call.
  • A usage-only assistant/chunk is held until its matching assistant/message.
  • When a chunk and final message describe the same turn and step, the final value replaces the early sample.
  • Failed requests, retries, and fork seed history are not counted twice.

API

The plugin provides ctx.tokenUsageCounter:

ctx.tokenUsageCounter.getSummary()
ctx.tokenUsageCounter.getSession(sessionId)
ctx.tokenUsageCounter.getModel(provider, model)
ctx.tokenUsageCounter.formatSummary()

Links

License

MIT

Compatibility

DSH 0.1.7-alpha.1: failedDSH 0.1.7-alpha.2: failedDSH 0.1.7-rc.1: failed

Versions

Latest versionPublishedSize
0.1.0——
0.1.1——
0.2.0——
0.2.1——
0.2.2——
0.3.0——
0.3.1——
0.4.0——
0.4.1——
0.4.2——
0.4.3——

Comments

Loading…

Similar plugins

dsh-usage-stats

Token usage statistics by model, session and date in a sidebar panel, plus OpenCode Go quota, DeepSeek balance and Z.ai quota monitoring.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 1

↓ 409/wk

MIT

TypeScript

dsh plugin --profile web add @xfqz86/dsh-usage-stats

Usage statistics panel: silent per-model token collection, activity heatmap, trend charts, cost estimation and daily-limit guard.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 0

↓ 112/wk

dsh plugin --profile web add dsh-usage-guard

by iuuuuuuuu

DSH plugin: per-day token usage and time-to-first-token statistics, broken down by workspace and session. Reads local session logs only.

Manifest valid

★ 0

MIT

JavaScript

Sep 16, 2026

dsh plugin --profile web add dsh-usage-stats

Token usage statistics for DeepSeek Harness. Per-channel usage with balances and plan quotas for mainstream providers, CNY cost estimates, and daily charts — a settings-sidebar section.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 1

NOASSERTION

TypeScript

dsh plugin --profile web add @linxin666/dsh-stats-panel

by fakeNihilist

Whole-corpus token usage statistics for DSH: daily and cumulative tokens, cache hit rate, per-model breakdown, and a year-long activity heatmap.

Tools & CapabilitiesUI & ExperienceManifest valid

★ 0

MIT

JavaScript

Sep 24, 2026

dsh plugin --profile web add dsh-plugin-usage-stats

by jkStars

DeepSeek-styled cross-session token usage, request count, and tiered cost analytics dashboard.

Tools & CapabilitiesModels & ProvidersManifest valid

★ 4

↓ 1.2k/wk

MIT

TypeScript

Oct 6, 2026

dsh plugin --profile web add dsh-token-usage-stats