DeepSeek Harness plugin

dsh-plugin-anti-rot

dsh plugin: compresses verbose tool error payloads (drops stack frames, caps message lines) on the tools/post-execute waterfall before they reach model context.

Jump to install

Source facts

Repository
orangelightening/dsh-plugin-anti-rot
Latest update
Aug 18, 2026
Category
Tools & Capabilities
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/orangelightening/dsh-plugin-anti-rot
Plugin: dsh-plugin-anti-rot
Author: orangelightening

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-plugin-anti-rot

A DeepSeek Harness plugin developed to remove a common source of context rot in long-running agent sessions: verbose tool error payloads piling up in the context window. When a child process dies mid-traceback, its raw stack dump would otherwise spend the whole error — often dozens of noise lines — against the session's context budget, and repeated failures compound over hours of work. This plugin compresses those payloads before they reach model context and the session log. A failed call's text is reduced to its first maxLines message lines, indented at … stack-frame lines are dropped, and an elision marker names what was removed:

Error: boom
[…anti-rot: dropped 8 stack-frame lines, omitted 0 of 8 message lines…]

How it works

The plugin hooks the tools/post-execute waterfall and rewrites error text in place. It recognizes two failure signals and nothing else:

  • an isError result (infrastructure failures — spawn errors, aborts), or
  • a trailing non-zero [exit code: N] marker per the shell tools' shared

rendering contract (failing commands are model-interpreted SUCCESS results, so the marker is the only failing-command signal).

A clean exit leaves the result untouched. The exit marker is always re-appended as the final line of a compressed payload, because the model is instructed to check it and the terminal UI parses it from the end of the text.

Bounding oversized successful text is a different concern, owned by @deepseek-ai/dsh-spill-policy; both plugins delegate through next() and compose.

Install

From a checkout of this repository:

pnpm dsh plugin --profile web add /path/to/dsh-plugin-anti-rot

Or run it transiently with an overlay:

pnpm dsh web --patch /path/to/dsh-plugin-anti-rot/overlay.yml

Configuration

FieldTypeDescription
maxLinesnumberMaximum message lines kept in a compressed error payload. Must be a positive integer; load fails loudly otherwise.

Example entry in cordis.patch.yml:

- insert:
    - id: anti-rot
      name: dsh-plugin-anti-rot
      config:
        maxLines: 15

Development

npm install
npm run build                                        # tsc → lib/
node --import tsx/esm tests/anti-rot.smoke.ts        # keyless smoke tests
npx tsc -p tsconfig.json                             # strict typecheck

License

[MIT](./LICENSE) © Orangelightening