Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture, and the community ecosystem provides a variety of tools to extend agent capabilities. In context management, the official default compaction backend (compaction-basic) asks the model to re-summarize old conversations for every compaction. This not only consumes extra tokens, but also produces unstable results. dsh-dcp addresses this pain point by providing a deterministic compaction backend.

Core Positioning

dsh-dcp is a DSH plugin maintained by fan56, positioned as a deterministic context pruning and compaction backend. It does not call an LLM for summarization; it only preserves facts that appear in the conversation (such as paths, commands, errors, and the user’s exact words). Therefore, the output is stable, and identical inputs always produce identical results.

Core Features

The plugin mainly addresses the following issues:

  • Zero-LLM-call summarization: The compaction process itself consumes no additional tokens.
  • Stable output: Removes the uncertainty generated by LLMs.
  • Chinese-friendly: Content is preserved verbatim and not transliterated into English; token estimation uses actual CJK density (Chinese/Japanese/Korean/full-width characters at about 2 characters/token), rather than relying on the host’s low estimate.
  • Mechanism inheritance: Inherits DSH’s official safety mechanisms, triggering strategies, tail retention, transaction locks, and checkpoint format compatibility.
  • Command support: Provides the /dcp command for compaction, status viewing, and parameter tuning.

Installation and Activation

The installation process is very simple and can be completed using npm.

  1. Install the plugin package:
npm i @aiwayds/dsh-dcp
  1. Run the initialization script:
npx dsh-dcp-setup

The script automatically handles configuration backup and idempotency checks, ensuring a safe installation process without overwriting existing configurations.

Usage

After the plugin is mounted, you can directly use the /dcp command in the session:

  • /dcp: Immediately compact historical context (zero LLM calls).
  • /dcp status: View the current configuration and the tokens saved.
  • /dcp set dedup true: Dynamically adjust parameters within the session.

The plugin supports multiple trigger conditions, including pressure-triggered, overflow recovery, round-based triggering (by default, once every 50 assistant messages), and model-switch triggering.

Uninstallation

If you need to uninstall, please use the officially provided script or DSH plugin management commands.

Uninstall via script:

npx dsh-dcp-setup --remove

Uninstall via DSH plugin management:

dsh plugin remove @aiwayds/dsh-dcp

Notes

  • Version requirements: This plugin requires DSH version >= 0.1.7-rc.1 and does not support the alpha line.
  • Feature scope: The plugin does not perform semantic summarization; it only preserves facts that appear. For scenarios requiring deep semantic summarization, it is recommended to continue using the official compaction-basic.
  • Estimation mechanism: By default, token estimation uses actual CJK density, so the token budget will not be starved in Chinese-language scenarios.

Conclusion

dsh-dcp is suitable for scenarios that require stable, low-cost context compaction, especially Chinese conversations. It replaces LLM calls with code, significantly reducing the cost of context management.