AI Agent Hub
Back to plugins
🧠

dsh-cwl

Memory Updated 2026.09.04

Run the following command in DeepSeek Harness:

dsh plugin install kalifun/dsh-cwl

Paste the following prompt into your AI chat to install this plugin:

Run dsh plugin install kalifun/dsh-cwl in your DeepSeek Harness to install this plugin, available at https://github.com/kalifun/dsh-cwl

About this plugin

The slowest killer of long-horizon agents is context pressure. The standard fix—asking an LLM to summarize the history—has four structural flaws: the summarizer decides what matters rather than the task, causal chains collapse into prose, a full LLM call fires mid-task under token pressure, and compression under length constraints is a well-known hallucination trigger. dsh-cwl, grounded in the CWL paper (arXiv:2606.11213), takes a different path: no summarization at all. It infers the transcript into a typed episode graph—exploration nodes (pure reads/searches) linked by dependency edges to action nodes (side-effecting edits/writes)—then applies a fully deterministic, zero-LLM eviction policy in graduated levels. Large tool-result content in exploration episodes is stubbed first; completed action episodes whose effects are already persisted are evicted whole. User messages are never touched at any stage.

In practice, context pressure accumulated across dozens of tool calls in a single request or over many long conversation rounds can be released stably before every LLM call without breaking task structure. Eviction executes through the official surface-replace seam, original events remain in the log, and the agent can invoke cwl_recall at any time to re-read evicted content by file path. Offline cache-replay benchmarks show roughly a 24% reduction in cacheRead tokens after eviction, consistent across sessions and independent of eviction strategy.

Best suited for any DeepSeek Harness deployment where the context window is the bottleneck: multi-round long conversations, single-request autonomous tasks, or agent loops that keep accumulating tool calls. Zero configuration required—the plugin stays completely inert until context pressure exceeds its budget (default 80% of the model's context window), then activates automatically.

Use Cases

  • Multi-round conversations where context window is gradually filling up
  • Single-request autonomous tasks chaining dozens of tool calls
  • Agent loops with ever-accumulating tool calls that risk OOM or hallucination drift

Best For

  • Developers building long-horizon agents on DeepSeek Harness
  • Teams hitting context window limits in production workloads
  • Researchers exploring agent context strategies and token cost reduction