ChatGPTClaudeGrok / X / CursorGemini

dsh-optimizer: A Usage Tracking and Context Management DSH plugin for DeepSeek Harness

ironman888-star/dsh-optimizer

Models & ReasoningVerified
Listed on 2026-11-10
Page last updated 2026-11-18

A DSH plugin for DeepSeek Harness that tracks local token usage and cost estimates, sends budget alerts, safely trims older conversation turns, and lets you edit custom task instructions.

dsh-optimizer is a local usage and context management DSH plugin for DeepSeek Harness that gathers the invisible token spending of long sessions, ever-growing old conversations and scattered task instructions into one settings page. It offers a local usage log with cost estimates, daily, task and agent level budget alerts, and round-based trimming of model-visible history while keeping the original log intact. Task instructions can be edited and saved in the settings page, tool results support both audit and enforce handling, and a local dashboard shows configuration, diagnostic reports and usage summaries. Maintained by Ironman888-star under the MIT license, it is an unofficial open-source project.

How to Install

install
dsh plugin --profile web add github:ironman888-star/dsh-optimizer

Replace --profile with the profile name you actually run (see ls ~/.dsh/profiles/): usually web in the browser UI, desktop or desktop-NNN in the desktop app.

Category
Models & Reasoning
Platform
DSH Plugin
Author
ironman888-star
Distribution
Plugin

dsh-optimizer Key Features

Local usage and cost estimatesBudget alerts and checkpointsTurn-based history trimmingCustom task instruction editorLocal dashboard and diagnostics
Listed on dsh-plugin.org

dsh-optimizer Repo Summary

What Does It Do?

DSH Optimizer is a DSH plugin for DeepSeek Harness that turns local model usage, cost estimates and session context into settings you can inspect and adjust. It solves the problem of opaque token spending in long sessions, ever-growing old conversations and scattered task instructions, letting you see usage logs, budget alerts and diagnostic reports right inside the DSH settings page. Its core capabilities cover local usage and cost estimation, round-based trimming of model-visible history, a custom task instruction editor, plus tool-result checkpoints and anomaly monitoring. The plugin is maintained by Ironman888-star under the MIT license and is an unofficial open-source project.

Core Features

  • Usage and cost observation: keeps a local usage log, estimates cache hits, and raises daily, task and agent budget alerts, with estimates that are not official billing.
  • Round-based context packing: a separate switch that is off by default, retaining the last 1–20 completed rounds (3 by default) and replacing safely trimmable old messages with UUID-tagged markers while the original append-only log stays intact.
  • Task instruction rewriting: edit, save and restore preset task instructions in the settings page; content is stored in local config and fed to later model requests through the DSH system prompt interface.
  • Tool results, checkpoints and anomalies: the default audit mode only observes tool output, while enforce mode can condense it according to configuration, with checkpoints and anomaly monitoring following existing settings.
  • Local dashboard: shows configuration, diagnostic reports and usage summaries in one place for quick status checks inside DSH.

How to Use This Plugin?

After enabling it in DSH, open Settings → DSH Optimizer to see the version and each switch; new switches are not turned on for you and must be enabled manually. In daily use, check the usage and budget summary first, then enable context packing and set the retained round count as needed; task instructions take effect for later model requests once saved in the settings page. Validate tool messages, history trimming and restart recovery in a test session before using it on real conversations, and disable context packing and back up config and session directories before upgrading.

How to Troubleshoot This Plugin?

If a session fails validation with lacks an identified message after a restart, the usual cause is replacement markers written by an older version that lack an identifier field; upgrading the source alone cannot repair replacement events already written to disk, so the session needs separate diagnostic recovery per the official troubleshooting notes. Do not edit compressed session files while DSH is running; disable context packing and back up config, session directories and plugin source before upgrading, then follow the official upgrade instructions.

This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: ironman888-star/dsh-optimizer. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.

Install, update, and uninstall this plugin in the Plugin Market of DeepSeek Harness's DSH Plugin Hub
ChatGPTClaudeGrok / X / CursorGemini

DSH Plugin FAQ