dsh-context-guard
Run the following command in DeepSeek Harness:
dsh plugin install kpl0111/dsh-context-guard
Paste the following prompt into your AI chat to install this plugin:
Run dsh plugin install kpl0111/dsh-context-guard in DeepSeek Harness to install this plugin; full source is available at https://github.com/kpl0111/dsh-context-guard .
About this plugin
Once a long agent session reaches several hundred turns, the context window often gets clogged first by tool output: a single command spitting out thousands of log lines, a file read pulling in an entire codebase. Before the next request even starts, most of the token budget is already consumed. dsh-context-guard solves this without replacing built-in compaction and without issuing its own LLM call. It swaps oversized tool output for a compact preview of roughly 2.3K characters right before each model request, keeping the focus on the actual conversation.
Pruned output is never lost; it stays intact in DSH's append-only session log. The plugin offers a layered recovery path: first use the retained file path or a narrow filesystem search, and only fall back to recall for the smallest relevant fragment when that is insufficient. A recall result is preserved in full for exactly the next model step, after which it re-enters normal pruning, so the model can act on complete content without letting large payloads linger in context.
Built for developers running multi-turn agent workloads in DeepSeek Harness who need to control context bloat without discarding raw tool data. It is compatible with the built-in compaction tool-result pruner and takes effect immediately in a new session after a DSH restart.
Use Cases
- Tool output bloats the context window in long multi-turn agent sessions
- Need token savings while preserving raw output for targeted downstream recall
- Balancing immediate pruning with selective recovery via recall in extended sessions
Best For
- Developers running multi-turn agent workloads on DeepSeek Harness
- Engineers who need context control without losing raw tool data
- Users already on DSH compaction seeking finer-grained tool-output management
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.