Install dsh-tool-result-trimmer for DeepSeek Harness to auto-trim oversized tool outputs
Add the Cordis plugin to DSH, configure YAML thresholds and semantic reducers so large tool outputs are eagerly trimmed before entering the session log
- Who
- Developers already using DeepSeek Harness (DSH) who face bloated tool outputs polluting context
- You get
- After installing and configuring the plugin, oversized tool outputs are trimmed before session storage, preserving head arguments and tail errors, reducing token waste and UI freezing
- You need
- npm
Constraints
Prerequisites: DSH CLI installed and `dsh plugin` available; know where your `cordis.patch.yml` or agent preset lives. Low operational risk, but misconfiguration may unexpectedly trim output; verify in a non-production environment first. Cost: plugin is MIT-licensed and free; npm install incurs no extra fee.
What they did
The author developed and published dsh-tool-result-trimmer, a zero-dependency Cordis plugin for DeepSeek Harness. It hooks into DSH's official `tools/post-execute` waterfall pipeline to eagerly trim oversized tool outputs before they are committed to session storage or LLM context. By default it preserves 1,500 head characters and 5,000 tail characters, and includes command-aware semantic reducers (Git, package manager, test, build, lint) that compress redundant output under strict fail-open semantics. It also supports ANSI escape stripping, line-aware snapping, JSON preservation, and optional disk spillover.
How it went
The author reports that the eager pipeline approach avoids UI freezing and session log bloat caused by passive compaction. Semantic reducers can collapse clean test suites to a one-line summary while preserving full stacks on failure, and strip package-manager noise like spinners and funding banners. These claims are author-reported and not verified by this site.
Steps
Install the plugin
Install via the DSH plugin CLI (recommended), or add to project dependencies with npm/pnpm. The plugin becomes available to DSH after installation.
Execution prompt · Source text。Run in DSH CLI terminal
dsh plugin --profile web add dsh-tool-result-trimmer
Configure trimming parameters
Add the plugin to `cordis.patch.yml` or your agent preset. Key fields: `thresholdChars` (default 10000), `headChars` (default 1500), `tailChars` (default 5000). Per-tool overrides supported (e.g., bash, git). Semantic reducers are enabled by default and can be toggled individually for git, packageManager, test, build, lint.
Prompt you can copy
Reference prompt · Editorial suggestion。Confirm the destination, input variables and output format before use.
This block is the prompt. Ads are never placed here.
dsh plugin --profile web add dsh-tool-result-trimmer
Run the install command in terminal, then edit cordis.patch.yml with the provided configuration
Source
安装 tool-result-trimmer,裁剪工具回传体积 · Jaylor-Wang · GitHub · 2026-10-31T08:55:14Z
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.