
Young4ever33/dsh-token-attention
dsh-token-attention
dsh-token-attention is a community DeepSeek Harness plugin. Read the repository README before installing.
Install
npx @deepseek-ai/dsh plugin --profile web add dsh-token-attentionRestart `dsh web` after install. Bundle APIs can change during the developer preview.
README badge
[](https://dshhub.dev/plugins/dsh-token-attention)Paste this into your README. The star count updates with every catalog sync.
From the README
Excerpt from Young4ever33/dsh-token-attention, cleaned of badges and images.
dsh-token-attention — Token Check for DeepSeek Harness
English | 中文说明
Token Check is a token-attention management panel for DeepSeek Harness (DSH). It records every conversation's token usage and estimated cost by task / day / week / month, recognizes task types, and — combined with DeepSeek's peak/off-peak pricing and DSH's context mechanics — tells you when to run a task, whether to switch sessions, and whether to write a hand-off file.
It is not a money-saving tool: it never throttles or cancels requests. It presents facts and advice; you decide.
Features
- Five views in DSH Settings — Overview / Sessions / Tasks / Cost / Settings
- Per-task ledger — token consumption (input hit / miss / output / reasoning) and estimated cost, rolled up by day / week / month
- Task-type recognition & advice engine — best execution window, switch-session, hand-off, context, cost and model suggestions
- Attention KPI — attention score, hit rate, context occupancy, compaction count per session
- Peak/off-peak pricing — DeepSeek off-peak half-price windows (peak 9:00–12:00 / 14:00–18:00), estimated cost breakdown by bucket
- Multi-model breakdown — cost and hit rate per model (e.g. deepseek-v4-flash / pro / grok)
- Ledger export — Markdown / CSV download, one-click hand-off template
- Editable settings — pricing table, peak hours, advice thresholds; new records are priced immediately
- Zero runtime dependencies — local SQLite via
node:sqlite; no network calls
Screenshots
Overview — today's usage, cost, hit rate, attention score, model mix, advice card, and trend
Session card — per-session model breakdown and attention metrics
Tasks — task ledger with Markdown / CSV export
Cost — peak split, cost leverage breakdown, and model comparison
Settings — pricing table, peak hours, and advice thresholds
Install
Once published to npm:
dsh plugin --profile web add dsh-token-attention
Restart DSH, then open Settings → 词元管理 (Token Check). Data is stored at DSH_HOME/token-attention/token_records.db.
Development install (link)
npm install && npm run build
Then register the plugin in the web profile (%APPDATA%\dsh-desktop\harness\profiles\web\package.json):
{
"dependencies": { "dsh-token-attention": "link:/path/to/dsh-token-attention" },
"dsh": { "profile": { "bundles": ["...", "dsh-token-attention"] } }
}
Run pnpm install inside profiles\web, restart DSH, and verify:
curl http://127.0.0.1:<port>/token-attention/api/health # → {"ok":true,...}
How it works
- Collection: the node half subscribes to DSH's
session/eventstream (usage, goal, subagent, compaction, turn) and writes normalized records to SQLite; a startup backfill replays existing sessions with an idempotentlast_seqcursor. - Aggregation: hourly incremental rollups into
daily_agg, with a daily full rebuild for correction. - Advice:
src/shared/advice.tsevaluates context occupancy, turns, hit rate, cost and model mix against your thresholds and suggests concrete actions.
Configuration
Settings are editable in the panel and saved to SQLite:
…

