Introduction

When developing agents with DeepSeek Harness (DSH), you often need to manage multiple projects or long-running tasks simultaneously. Tracking token consumption and cost distribution is a common pain point. Manually opening each project to view logs is inefficient and makes it hard to intuitively compare model costs. dsh-cost-tracker aims to display real-time global cost statistics in the sidebar, so you can monitor costs without switching projects, and automatically sync official pricing.

Plugin Positioning

This is a sidebar task cost statistics plugin for DSH, maintained by ruozhi5067. It solves the problem of cross-project cost tracking and official pricing synchronization. It is a memory-type plugin.

Core Features

  • Sidebar card: Displays total cost, current project cost, and token breakdown (input hit, input miss, output) at the bottom of the sidebar. Supports collapsed and expanded states; in the expanded state, per-project details are available.
  • Official pricing sync: Automatically updates DeepSeek official RMB unit prices. The fetch logic refreshes on startup, every 12 hours, or if not updated for more than 6 hours. You can also click ↻ to refresh manually. If fetching fails, it falls back to built-in RMB prices.
  • Incremental log reading: In addition to active sessions in memory, it incrementally reads persisted session logs. Therefore, projects that are not opened also display costs in the sidebar without needing to open each one individually.
  • Plugin management: Can be managed on the plugin management page (approve/stop/remove).
  • Hot reload support: Supports hot reload patches (cordis.patch.yml), taking effect without restarting.
  • Billing logic: Only model calls in session logs with usage are billed.
  • Built-in price table: The built-in price table is compatible with deepseek-v4-flash / deepseek-v4-pro.

Installation and Enablement

This plugin is installed as a profile bundle.

1、Enter the profile directory

cd ~/.dsh/profiles/<profile>

2、Install the plugin package

pnpm add dsh-cost-tracker

3、Add the plugin to the bundle list
Modify the dsh.profile.bundles field in ~/.dsh/profiles/<profile>/package.json and add dsh-cost-tracker to the list:

{
  "dsh": {
    "profile": {
      "bundles": ["@deepseek-ai/dsh-base", "...", "dsh-cost-tracker"]
    }
  }
}

This configuration automatically inserts the plugin entry.

Usage

After installation, a cost card appears at the bottom of the sidebar (above the Cordis plugin panel).
- View data: The card displays total cost and current project cost by default. Click the card to collapse or expand it; when expanded, token breakdown and official model unit prices are shown.
- Quick action: In the narrow sidebar (56px icon bar), a compact Cost ¥x button is displayed; click it to expand the sidebar.
- Refresh unit price: Click the ↻ icon on the card to manually refresh official unit prices.
- Component management: In the sidebar Cordis plugin panel, you can approve/stop/remove the dynamic component “Task Cost Statistics”.

Notes

  • Browser-side authorization: Browser-side authorization does not cross processes. After a restart, when the dynamic component is first loaded, click “Allow” once in the Cordis plugin panel.
  • Billing basis: Costs are calculated using the official main price table. Peak/off-peak time-based prices are for display only; cost calculation uses the official main price table.
  • Data privacy: All data is calculated locally, and no session data is sent. Only price numbers are read from the official pricing page.
  • License: MIT License.