Introduction

In DeepSeek Harness (DSH), the longer the session, the more surface history may be carried in the next request. Existing approaches usually rely on automatic compression or manual cleaning; if you want the model itself to judge which surface history can be replaced with a summary, you need a plugin that can reuse DSH compaction transactions.

aerince/dsh-active-context-pruning provides this capability: it lets the model provide a summary, and then hides a segment of history from the next request’s surface through DSH’s official compaction path. This process does not modify the original session.events.

What is this

aerince/dsh-active-context-pruning is a DSH host plugin maintained by aerince. The repository identifier provided in the documentation is aerince/dsh-active-context-pruning, and the package name is dsh-active-context-pruning.

It solves the problem of: in a DSH session, allowing the model to actively select a surface seq range and replace that history with its own summary, thereby shortening the surface context for subsequent requests.

Key information is as follows:

  • License: MIT
  • Version: 0.1.0
  • Node engines: ^22.19.0 || >=24.0.0
  • Plugin type: host plugin, requires tools
  • Behavior: does not initiate network requests, has no prepare installation script
  • Data boundaries: reuses existing DSH compaction transactions, does not modify the original session.events

Note: This is not @deepseek-ai/dsh-acp; the latter refers to the Agent Client Protocol.

Core Features

The features listed in the documentation are as follows:

Tool or Command Function
acp_status View usage, surface seq table, checkpoints
acp_compress Replace a surface seq range with the summary provided by the model
acp_decompress Read the hidden original text; does not undo the surface replacement
acp_search Search surface and compressed original text
/acp Status command for viewing

acp_decompress can only read the hidden original text and cannot undo a surface replacement that has already occurred. The original text is still stored in session.events, but is returned as a tool result.

Installation and Enablement

The prerequisites for installation are an available dsh, pnpm, and git, and confirming that the Node version meets ^22.19.0 || >=24.0.0.

Example uses the web profile. If using another profile, please replace web in the command.

Install the latest main:

dsh plugin --profile web add github:aerince/dsh-active-context-pruning

Install a reproducible version v0.1.0:

dsh plugin --profile web add github:aerince/dsh-active-context-pruning#v0.1.0

When there is no CLI, you can paste the same github: source spec in the Desktop plugin panel.

DSH will write the plugin to:

$DSH_HOME/profiles/<profile>

Please confirm that CLI and Desktop use the same DSH home. Restart DSH after installation.

Before actually calling acp_compress, you also need to load @deepseek-ai/dsh-compaction-basic, which provides ctx.compaction.compactRegion.

Verification and Typical Usage

  1. First, confirm the plugin enters the configuration tree. Run:
dsh --profile web --dump-config

active-context-pruning should appear in the configuration tree.

  1. In a new session, confirm the tools are available. acp_* tools and /acp should appear in the new session.

  2. Optional: Run the pure function self-check in the source code directory:

node check.js
  1. Use /acp to view the status in the session, and then call acp_status, acp_search, acp_compress, or acp_decompress as needed.

Usage Limits and Notes

  • Cannot compress the newest preserveRecent surface items. The default preserveRecent is 2, which includes currently unclosed tool calls.
  • The compression range must be tool-paired balanced.
  • The summary must be shorter than the content being hidden; otherwise, the official engine will reject it.
  • acp_decompress does not undo replace. The original text remains in session.events, but is returned as a tool result.
  • config is a full replacement of the profile patch line, not a deep merge; when modifying, please keep all necessary keys.
  • The plugin is a host plugin and requires tools; it does not initiate network requests and has no prepare installation script.
  • It will load tools with the current DSH process. Please check the source code and license before installing.

Conclusion

The value of aerince/dsh-active-context-pruning lies in: it does not treat compression as a black-box replacement, but provides a set of acp_* tools for DSH sessions, allowing the model to perform active compression based on surface seq while preserving the original session.events. It is suitable for developers who already use DSH and wish to control the boundaries of context compression.

  • GitHub: https://github.com/aerince/dsh-active-context-pruning
  • Directory Page (URL provided in documentation, community directory page, not equivalent to DeepSeek / Huanfang official app store): https://www.skillhub.cn/plugins/aerince/dsh-active-context-pruning