Sev7eEn7 / dsh-sieve
git clone https://github.com/Sev7eEn7/dsh-sieve.git
v0.2.0 · 15d ago
dsh-sieve: context engineering & token optimization plugin for DeepSeek Harness (DSH) — tool output filtering, context pruning, progressive skill disclosure. 36% smaller payload in offline replay. DSH 上下文管理与 token 优化节省插件。
+0
stars, 24h · #39,777
+~-16
stars, 7 days · #61,920
+103
stars, 30 days · #6,815
103
★ total · -13% this week
4
forks · 5 open issues
Star history (as recorded here)
LanguageTypeScript
LicenseMIT
Created2026-10-04 (18d ago)
Last push1d ago
Watchers2
OwnerUser
GitHub topics
agent-toolsai-agentai-codingcoding-agentcontext-engineeringcontext-managementcontext-pruningcontext-windowcordisdeepseekdeepseek-harnessdsh-pluginllmllm-agentllm-costprompt-compressiontoken-efficiencytoken-optimizationtool-outputtypescript
Links
- GitHub: github.com/Sev7eEn7/dsh-sieve
- Homepage: https://www.npmjs.com/package/dsh-sieve
- Releases · Issues · Hacker News mentions
README excerpt
English | 简体中文 sieve / dsh-sieve **LLM agent context engineering and token efficiency plugins for DeepSeek Harness (DSH)** sieve filters tool output, prunes older context and progressively discloses skills to reduce redundant input tokens in AI coding agents, improve context window utilization and provide observable usage data for LLM inference cost optimization. Originals are archived before rewriting and can be retrieved on demand. **Over 30% less request payload in offline replay, measured in characters**: a **36.28%** aggregate reduction across 100 public agent trajectories. See offline replay results. **Historical live model results: 21.2% lower main model input token usage** across 80 paired runs on deepseek-flash, with cache hit rate moving from 93.4% to 92.9%. This experiment used the now-removed session-model judge path; the current Jev / Laya configuration has not been remeasured. See live model results and the cache FAQ. Built around context engineering and token efficiency, sieve manages the context delivered to the model within the agent loop, reducing repeated input across multi-step tool use. --- > [!IMPORTANT] > sieve works only with a judge model configured: **Jev** (hosted, needs an API key) or **Laya** (local, macOS on Apple Silicon). sieve never uses the session's model in its place. With neither configured, the plugin loads but changes no context. See judge models. ## Why sieve In an agent loop the main model rereads its whole context at every step. What makes requests large is rarely the user's input. It is: - **Tool output**: build logs, test reports and command output run to thousands or tens of thousands of characters, and the next step usually needs a small part of it; - **Stale context**: tool results that a later read superseded, or that stopped mattering long ago, are sent again at every step; - **Skill catalogs**: dozens or hundreds of skill descriptions are injected at session start, most of them unrelated to the task. All of this is billed as input tokens, fills the context window and dilutes the model's attention. sieve adds a **judgment kernel** on DSH's public extension points that admits, forgets and progressively discloses these three kinds of content, so the main model sees a shorter, more focused context at every step. The hard part is deciding what can go. Fixed rules have to keep any output format they have not seen; asking the main model to decide costs its tokens and a full round of reasoning. sieve hands this step to a dedicated judge model that answers structured yes/no and single-choice questions with probabilities, and the kernel rewrites or keeps the original by threshold. In offline replay, the median latency of one Jev judgment was about 0.3 seconds. ## Core capabilities and use cases For AI coding agents running on DeepSeek Harness, especially tasks with verbose test logs, frequent tool calls, long sessions or large skill catalogs. | Optimization area | How sieve handles it | |---|---| | **Inp