Introduction¶
DeepSeek Harness (DSH) bills by the token, and sessions can run for a long time. Without a hard boundary like a “plan quota,” it is easy to sit down for ten-plus hours. Some in the community use external bookkeeping or simply force themselves to stop, but these methods are disconnected from the client’s input pipeline and cannot stop the impulse to “send just one more.”
Here we introduce dsh-ration (Rationing), a plugin by maintainer wobenshiwomu: it uses two gates within DSH to enforce a 5-hour rolling window and a weekly limit. If a limit is exceeded, new commands are no longer accepted. It is categorized under admin-security. See the SkillHub directory page, and the source code and documentation on GitHub.
What is this¶
Ration is a DSH plugin that installs token usage limits for yourself. The default scale is benchmarked against Kimi: the ratio of the 5-hour window to the weekly quota is 1 : 5, i.e., 40 million / 200 million tokens.
| Gate | Default Quota | Reset Method |
|---|---|---|
| 5-hour Rolling Window | 40 million tokens | Rolling: Consumed shares flow back over time (Kimi-style) |
| Week | 200 million tokens | Every Monday at 00:00 |
When either gate is crossed and enforcement is enabled, the widget in the bottom left turns red, and new commands cannot be sent; currently executing turns are not affected. Commands starting with / are always allowed. If blocked, you can use /ration off to turn off enforcement immediately.
Interface and Statistics¶
There is a small widget in the bottom left: two thin bars represent the 5-hour window and weekly usage. They follow the DSH theme for brightness (design tokens, no manual theme modification needed).
Clicking it reveals the progress of both gates and detailed token consumption, including today’s breakdown (new prompt / output / cache read), cache ratio, and a mini bar chart for the last 7 days. Usage turns yellow when it reaches the warning ratio configured (default 80%) and turns red when the limit is crossed.
The statistical criteria is based on usage.totalTokens for each assistant message (including cache reads and writes). The ledger backfills all session logs via sessionPersistence upon startup, and is then incrementally updated by session/event; it is idempotent by (session, seq), ensuring no double counting during restarts or replays, and does not consume extra tokens or disturb the model.
Commands¶
You can use slash commands in DSH daily to view and modify limits:
/ration View status of both gates
/ration on | off Toggle blocking on limit exceeded
/ration set 5h|week N Change quota (supports k/m/b/10k/100m: /ration set week 150m)
/ration unset 5h|week Revert to profile configuration
/ration gate 5h|week on|off Toggle a specific gate individually
Installation and Activation¶
The installation method provided in the README specifies a tar package URL (the v0.1.1 at the end is the version tag; to upgrade, simply replace it with the new version tag from the repository and reinstall):
dsh plugin --profile web add 'https://codeload.github.com/wobenshiwomu/dsh-ration/tar.gz/v0.1.1'
GUI path: Sidebar “Plugins” → Add Plugin → Enter the URL above. A DSH restart is required for the changes to take effect.
package.json declares the runtime environment as Node ^22.19.0 || >=24.0.0 and DSH >=0.2.0-rc.1; the plugin targets the web profile client bundle. The license is MIT.
Profile Configuration¶
You can override default quotas and behavior at the profile level:
- id: dsh-ration
config:
cap5h: 40000000 # 5-hour rolling window
capWeek: 200000000 # Week
enforce: true # Block on limit exceeded
gate5h: true
gateWeek: true
warnPct: 0.8
keepDays: 35
State is persisted in $DSH_HOME/storages/dsh-ration/state.json, and the ledger is kept for 35 days by default.
Implementation Details and Ecosystem Interfaces¶
Blocking on limit exceeded is handled at the client capture layer, intercepting Enter in the input box and the send button; when the state expires, it automatically fails open to avoid blocking normal work due to plugin failure.
Since v0.1.2, a cross-plugin interface is provided: the ctx.provide('ration') service (setCaps / getCaps) and the POST /dsh-ration/set route, allowing plugins like dsh-plan to subscribe and automatically calibrate quotas.
Use Cases and Notes¶
Suitable for developers who write code and run agents in DSH for long periods and want to constrain token spending with hard boundaries. The two gates can be toggled individually, and quotas can be adjusted via commands or profiles, making it suitable for custom rules like “strict on workdays, loose on weekends.”
The plugin runs under the current DSH process permissions and will read session logs and write local state; before installing, it is recommended to read the repository source code and the MIT license to ensure compliance with your security policy. SkillHub is a community directory site and has no official affiliation with DeepSeek / High-Flyer.
The DSH ecosystem emphasizes “everything is a plugin”; Ration does not do time management for you, it only blocks new commands when limits are crossed, turning “unlimited refills” into a configurable self-discipline tool. For more details, see the Directory Page and the GitHub README.