dsh-context-guard: DSH Tool Output Budget, Disk Persistence, and Risky Command Confirmation

dsh-context-guard is a DSH Host-only plugin maintained by person-clouds, designed to address issues in long sessions where large outputs from bash and similar tools saturate the context window, as well as the 16K truncation imposed by persistent-bash. It provides bounded summarization with full disk persistence, same-parameter deduplication within a 10-minute window with line-level diff, read-only diagnostics via inspect.sh, ask-confirmation for risky commands, and archival metrics with quota cleanup. The article covers Release/npm installation commands, apply-profile.sh migration steps, budget and configuration examples, and usage boundaries.

Read More
dsh-context-guard: Session Handoff and Context Pressure Monitoring

`dsh-context-guard` is a workflow plugin for DeepSeek Harness (DSH) designed to address the escalating cost of long sessions. When session usage exceeds 45%, it automatically reminds the user to end the session and start a new one, and generates a handoff document containing machine facts in the working directory. Its core advantage is a “zero context tax”: it registers no tools, injects no prompts, and sends no extra requests, performing all calculations entirely within the host process using official token-meter data. It supports English and Chinese, triggers by default at a 45% threshold, and refreshes the handoff document for every additional 5% increase. The plugin uses atomic writes, enforces strict permission restrictions, and includes safety boundary checks.

Read More
dsh-context-guard: A Token-Efficient Tool Result Pruning Plugin for DeepSeek Harness

`dsh-context-guard` is a plugin for DeepSeek Harness (DSH), intended to address context overflow caused by the large size of tool results in long sessions. It controls token consumption by pruning oversized tool results. Specifically, it replaces regular results with an approximately 2.3K-character preview (retaining the beginning and end) before the next request, while storing the original data in an append-based history for targeted recovery. The plugin supports search and recall strategies and must be used with specific threshold settings and a Persona prompt. DSH must be restarted after installation.

Read More