dsh-context-compression-improved
Run the following command in DeepSeek Harness:
dsh plugin install drscrewdriver/dsh-context-compression-improved
Paste the following prompt into your AI chat to install this plugin:
Clone and build the source from https://github.com/drscrewdriver/dsh-context-compression-improved, then run dsh plugin install drscrewdriver/dsh-context-compression-improved to add the context-compression selector plugin to your DeepSeek Harness profile.
About this plugin
Running multi-round agent tasks in DeepSeek Harness means tool outputs pile up relentlessly—file reads, API responses, build logs—swelling the context window, burning through token budgets, and diluting the model's focus on what actually matters. dsh-context-compression-improved adds a suite of selectable, fully auditable compression policies without modifying Harness core code. Fresh pre-compresses a newly oversized result before the model ever sees it; Aggregate re-compresses material that still exceeds its budget after aggregation; History (micro-compact) replaces stale tool results while preserving the recent working set; TailTrim provides an optional tail-reduction path; and Native keeps the classic head-middle-tail trim as one explicit profile. Every decision is logged with its stage, reducer, trigger, skip reason, and exact token counts, making the entire pipeline transparent and traceable end to end.
On top of the upstream selector, this fork introduces an orthogonal code-skeleton compression gate. When a large source-code tool result (such as a bulk read_file) exceeds the size threshold, the gate first attempts a skeleton reduction: imports, type annotations, and function or class declarations are kept, function bodies are elided behind a marker, and any error lines inside elided bodies are preserved. If the skeleton cannot be produced or verified, the plugin falls back to the original head-pruning routine, guaranteeing the gate can never make context worse. The gate is fully independent of every compression profile, off by default, strictly measurement-gated on the bundled DeepSeek tokenizers, and session-frozen like all selector settings.
This plugin is aimed at developers who run multi-round coding, file-read, or API-driven agent tasks inside DeepSeek Harness and are fighting context-window bloat from raw tool logs. If you want fine-grained, auditable control over how tool results are compressed without touching Harness internals, and you need every compression action to be provable and reversible, the combination of the profile-based selector and the optional code-skeleton gate is built for exactly that workflow.
Screenshots
Use Cases
- Multi-round coding agent tasks accumulate large file-read and build-log outputs that need fine-grained context control.
- API-driven workflows produce repeatedly bloating JSON tool results that must be trimmed before model inference.
- Long debugging sessions flood the context window with verbose stack traces and build output while preserving critical error lines.
Best For
- Developers building multi-round agent pipelines inside DeepSeek Harness.
- Engineering teams that must manage token budgets for long-running automation tasks.
- Engineers who need auditable, reversible compression without modifying framework core code.
Related Plugins
A unified suite combining hot runtime injection, task-aware thinking-mode routing, and a graded session protocol with red-team gates to sustain model diligence across long-horizon inference.
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.