kpl0111/dsh-context-guard

kpl0111★ 0JavaScriptLast synced: 2026-08-16

Open on GitHub

Token-efficient tool-result pruning for DeepSeek Harness: compact previews, targeted recall, and long-session context control.

README excerpt

dsh-context-guard dsh-context-guard is a small DeepSeek Harness (DSH) preset add-on for controlling long-agent-session token growth. It prunes oversized tool results before the next model request, while leaving durable session history intact for targeted recovery. It does not replace DSH compaction and does not send its own LLM request. Policy The recommended balanced policy is: Layer Setting Purpose Immediate tool pruning thresholdRatio: 0.001 Replace bulky tool output with a 2.3K-character preview before the next turn. Preview head 1792 / tail 448 Retain the beginning plus terminal exit/spill-file marker. Full compaction Instant at 80% Compact conversation history only when the useful context is genuinely large. Recovery recall When prior tool output has been pruned, first use the retained file path, a narrow filesystem search, or search. Use recall only when that is insufficient, and recall the smallest relevant result or sequence; never broadly recall large historical output. Restart DSH and create a new session after installing or updating bundles. The legacy presets/standard-lite.fragment.yml is retained only for users who deliberately manage the guard inside a preset; do not…

View full README on GitHub →
Tools / Devcontext-managementcordisdeepseek-harnessdsh-plugintoken-optimizationterminalagent

Category