EveGoodEvening/dsh-shake ↗★ 0

dsh-shake

适用于 DeepSeek Harness 的第三方持久化手动上下文减重 Host 插件 适合需要手动精简上下文以节省 Token 的用户,通过发送 /shake 指令触发。

Package
dsh-shake
Compatibility
Unverified
Harness peer range
0.2.0-rc.2
Cordis peer range
~4.0.4
Version
0.0.2
License
MIT
Last updated
Oct 10, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:EveGoodEvening/dsh-shake

Usage

  1. Wait until the current session is idle, then send the following in the Web message input:

    /shake
    
  2. Once you receive the confirmation “Scheduled; will run before the next model request,” the cleanup request has been saved. This does not call the model or immediately reduce the context.

  3. Send your next normal message. The plugin replaces eligible older text before DSH sends the model request.

If execution has not started, you can cancel:

/shake cancel

Cancellation applies only to pending requests. It cannot undo completed replacements.

SituationMeaning and action
“No cleanup needed” messageThere is currently no eligible text that would save tokens. No further action is needed.
The session is busy or under maintenanceWait until the session is idle and retry. The command neither interrupts existing work nor queues itself.
A request is already pendingEach session can have at most one pending request. Repeating /shake does not reselect content. Cancel first if you want to schedule a new selection.
Attachments or other arguments are includedOnly /shake and /shake cancel are supported; neither accepts attachments.

Configuration

Keep the defaults unless you need to change them. To adjust settings, add a configuration override to the target profile's cordis.patch.yml. Do not insert a second plugin instance.

The default configuration is shown below:

- id: dsh-shake
  config:
    protectedTokens: 4000
    toolTextMinTokens: 1000
    assistantBlockMinTokens: 400
    readDefaultLimit: 2048
    readMaxLimit: 4096
ParameterDefaultPurpose
protectedTokens4000The amount of recent history to protect, counted using locally estimated tokens, with whole messages preserved.
toolTextMinTokens1000A tool result is considered for cleanup only when its total text reaches this threshold.
assistantBlockMinTokens400An individual code or XML block in an assistant reply is considered for cleanup only when it reaches this threshold.
readDefaultLimit2048The page size for shake_read when limit is omitted, measured in Unicode code points.
readMaxLimit4096The maximum page size allowed by shake_read, in the same units.

The first three values must be non-negative safe integers. Pagination settings must be integers satisfying 1 ≤ readDefaultLimit ≤ readMaxLimit ≤ 4096. No other configuration fields are accepted.

Restart DSH after making changes. Requests that have already been scheduled retain the configuration and candidate fragments saved when they were scheduled.