dsh-active-context-pruning
Run the following command in DeepSeek Harness:
dsh plugin install aerince/dsh-active-context-pruning
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install aerince/dsh-active-context-pruning in your terminal, or paste the source URL https://github.com/aerince/dsh-active-context-pruning into the Desktop plugin panel, then restart DSH to activate.
About this plugin
Long multi-turn tool-calling sessions in DeepSeek Harness quickly exhaust the context window, and the built-in auto-compaction treats all old messages uniformly—compressing content that should remain visible while potentially discarding details that matter later. dsh-active-context-pruning inverts this: the model itself decides which history segments are worth compressing, writes its own checkpoint summaries, and then calls the official compactRegion API to hide that range from the next request's surface layer, saving tokens while the original text stays intact in session.events.
The plugin provides four tools: acp_status to inspect compaction state and the surface-layer seq table, acp_compress to replace a surface-layer seq range with a model-authored summary, acp_decompress to read back the hidden text, and acp_search to query both the surface layer and compressed content. Safety guards are built in: the most recent preserveRecent surface entries (default 2) are protected from compression, summaries must be shorter than the content they replace, tool-call pairs must stay balanced, and the raw events log is never modified—decompress returns the text as a tool result without undoing the surface replacement.
This plugin is ideal for developers running long-horizon Agent tasks or multi-step tool chains in Harness, especially when you want the context window reserved for the steps currently in flight rather than buried under completed history, while still keeping the ability to retrieve any original text on demand.
Use Cases
- Long multi-turn tool-calling sessions approaching the context window limit, requiring selective history compression instead of blanket compaction
- Complex Agent workflows where you want the window reserved for in-flight steps while retaining on-demand retrieval of older records
- Built-in auto-compaction is too coarse; you prefer model-led judgment on which history deserves summarization
Best For
- Developers running long-horizon Agent tasks in DeepSeek Harness
- Harness users working with multi-step tool chains who need fine-grained context control
- Prompt engineers who prefer model-decided compression over uniform auto-compaction
Related Plugins
ModLens is a vision plugin for DeepSeek Harness that gives text-only models sight by reading images pasted directly into chat, with zero-config setup and multiple vision engines.
On-demand vision for text-only DeepSeek Harness agents: built-in free keyless vision chain and 14 vision tools, routing image turns as tool calls to vision models with pixel fidelity, no Python needed, one-command install.
Give text-only models in DeepSeek Harness eyes, enabling image Q&A, long-screenshot OCR, UI restoration, and GUI visual tasks.
An armor-breaking plugin for DeepSeek: rewrites instruction priority, expands refusal-blocked phrases, persists across sessions, and shows a green active indicator.