dsh-token-usage
Run the following command in DeepSeek Harness:
dsh plugin install LeemanCheung/dsh-token-usage
Paste the following prompt into your AI chat to install this plugin:
You can install this plugin by running `dsh plugin install LeemanCheung/dsh-token-usage`, with the full source code available at https://github.com/LeemanCheung/dsh-token-usage.
About this plugin
When building and running complex AI Agents, Token consumption often remains a black box. It is notoriously difficult to accurately track the hidden costs of context compaction and retries, let alone establish effective budget alerts or compliance audits. dsh-token-usage is designed to solve these exact pain points, offering a local-first, privacy-centric Token observability and trajectory auditing solution for DeepSeek Harness, ensuring every unit of AI compute is fully transparent.
The plugin's core strength lies in its meticulous passive ledger design and multi-dimensional analysis engine. It precisely breaks down four Token buckets—uncached input, output, cache read, and cache write—while independently accounting for context compaction and retry overhead. With features like a 30-week heatmap, robust run-rate forecasting, and anomaly detection, users can effortlessly monitor usage trends and manage rolling budgets. Furthermore, its on-demand AI analysis capabilities stand out: whether generating global usage optimization recommendations or conducting deep trajectory reconciliation for a single session, it strictly adheres to privacy boundaries by relying solely on aggregated metrics or whitelisted metadata, never exposing conversation payloads.
If you are a DeepSeek Harness developer or team manager focused on AI operational costs, requiring fine-grained Agent efficiency tuning, or prioritizing data privacy and compliance auditing, this plugin is an indispensable tool. It operates without intercepting requests or altering routes, empowering you to find the optimal balance between performance, cost, and security through pure, evidence-driven insights.
Screenshots
Use Cases
- Monitor Token consumption and cache structures across multiple model routes to optimize API costs.
- Audit retries, context compaction, and tool call trajectories within complex Agent sessions.
- Set rolling budgets and receive robust statistical alerts for anomalous usage fluctuations.
Best For
- Developers and team managers focused on AI compute expenses and API bill optimization.
- Algorithm engineers needing fine-grained tuning of Agent prompts and context compaction strategies.
- Enterprise security leads prioritizing data privacy, compliance auditing, and operational traceability.
Related Plugins
Traceable, searchable cross-session memory for AI agents that turns conversation knowledge into a typed knowledge graph and recalls relevant subgraphs instead of replaying full history, natively integrated with DeepSeek Harness.
Gives DSH AI cross-session long-term memory, to-do and skill management, plus multi-session orchestration, external AI delegation, and an infinite canvas that grows with you.
dsh-mnemon is a three-tier, pluggable, Agent-driven memory system for DeepSeek Harness, combining Runtime memory, Project Documents, and replaceable Memory Spaces with nine long-term providers.
An opinionated, zero-infrastructure file-based memory protocol: human-readable markdown files plus a bounded always-loaded index, curation discipline, and no database or embeddings.



