DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-token-slim

s

dsh-token-slim

Discovered

Token optimization plugin suite for DeepSeek Harness (DSH): noise-filter, context-audit, selective-context — grounded in a research report on Claude Code session techniques and LLM context-compression

dsh-token-slim

Token optimization plugin suite for DeepSeek Harness (DSH). Three composable Cordis plugins that apply the techniques researched in docs/RESEARCH.md to the extension points DSH already provides — without touching the shipped compaction engine.

+-----------------------+      +------------------------+      +--------------------------+
| noise-filter          |      | context-audit          |      | selective-context        |
| tools/post-execute    |      | tokenMeter + tools     |      | agent/pre-step           |
| compress noisy bash   |      | health report + advice |      | conservative retention   |
| outputs line-by-line  |      | + compaction savings   |      | (experimental, opt-in)   |
+-----------------------+      +------------------------+      +--------------------------+
PluginDSH extension pointResearch basisDefault
dsh-token-slim/noise-filtertools/post-execute"quiet flags / output limits" (Claude blog), rtk / squeezon
dsh-token-slim/context-audittokenMeter.measure + tools.register + session/event/context habit, token-cost awarenesson
dsh-token-slim/selective-contextagent/pre-stepSelective Context / memory-compaction papersoff (experimental)

Why

In agentic coding tools every token that enters the context is re-read on every later turn. The highest-leverage optimizations are therefore: (1) keep noisy command output out of the context, (2) know how much context you are burning and what to do about it, (3) when under pressure, keep only the high-value history. DSH already ships the compression engine (tokenMeter, compaction, toolResultPruner); this suite adds the content-aware and user-facing layers around it. See docs/RESEARCH.md for the full report.

Install

The plugins run inside a DSH deployment, which already provides @deepseek-ai/cordis and @deepseek-ai/schemastery as peers.

npm install dsh-token-slim        # into the deployment's node_modules

Then add rows to the deployment's cordis.yml (host or an agent preset):

- id: noise-filter
  name: dsh-token-slim/noise-filter

- id: context-audit
  name: dsh-token-slim/context-audit

- id: selective-context
  name: dsh-token-slim/selective-context
  disabled: true   # experimental — read the docs before enabling
  config:
    enabled: false

All three plugins publish no services, so they sit loose in a preset (or host) composition; see compositions/cordis.example.yml.

Note on realms: if you mount these rows inside a group with an isolate realm, they must stay in the same group as the host services they consume (tools, tokenMeter). In a plain preset without realms there is nothing to do.

Plugins

noise-filter

Rewrites successful bash tool results whose command matches a known noisy class (test runners, build tools, git, listing). Line-by-line:

  • keep — failures, errors, warnings, stack frames, summary lines;
  • drop — per-case passes, progress bars, spinners, separators;
  • ambiguous — head/tail retained, middle suppressed.

Every rewrite appends a marker line and leaves the exit code untouched. A result below minChars / minSavingsChars is never touched.

- id: noise-filter
  name: dsh-token-slim/noise-filter
  config:
    minChars: 2000            # only consider results above this size
    minSavingsChars: 500      # only rewrite when at least this much is saved
    headLines: 10             # ambiguous head/tail retention
    tailLines: 10
    enableClasses: [test, build, git, list]
    keepPatterns: []          # extra regex sources, appended to defaults
    noisePatterns: []
    marker: '[dsh-token-slim] suppressed {suppressed} of {total} lines ({before} -> {after} chars); errors preserved'

context-audit

Registers a model-visible tool token_audit. Reading tokenMeter.measure(session) it reports:

  • total / surface token counts and pressure percent against a configured limit;
  • the largest tool-result offenders (seq, tokens, % of surface);
  • cumulative compaction savings tracked from compaction/summary events;
  • actionable suggestions (compact, prune, clear, subagent, continue) each with an honest heuristic savings estimate.
- id: context-audit
  name: dsh-token-slim/context-audit
  config:
    contextLimitTokens: 200000
    topOffenders: 8
    toolName: token_audit
    trackCompaction: true

selective-context (experimental, off by default)

Hooks agent/pre-step and, only when the projected surface is above pressureThresholdTokens, drops tool-result messages that are all of: older than minAgeTurns, at least minTokens tokens, and ≥ noiseRatioThreshold noise-classified lines (any single high-value line keeps the whole message). At most maxDropPerStep messages are dropped per step. Enable only after validating on your own workloads.

- id: selective-context
  name: dsh-token-slim/selective-context
  config:
    enabled: true
    pressureThresholdTokens: 150000
    minTokens: 2000
    minAgeTurns: 3
    noiseRatioThreshold: 0.95
    maxDropPerStep: 2

Development

npm install --omit=peer
npm test                       # node --test on the pure modules

The pure decision cores (src/noise-filter/filter.js, src/context-audit/audit.js, src/selective-context/retention.js) are fully unit-tested and have no runtime dependencies; the Cordis entry files (src/*/plugin.js) only need a DSH deployment to run.

Documentation

License

MIT — see LICENSE.

Comments

Loading…

Similar plugins

dsh-context-saver

by DaVinci-2nd

DSH plugin: trims thinking content, repeated reads, terminal inputs, and middle turns from the model request, while the local session log stays complete.

Manifest valid

★ 0

MIT

JavaScript

Nov 3, 2026

dsh plugin --profile web add dsh-context-saver

by drscrewdriver

Improved fork of dsh-context-compression-selector with an orthogonal code-skeleton compression gate

Terminal & ClientsSessions & MessagesManifest valid

★ 11

↓ 8.3k/wk

MIT

TypeScript

Nov 20, 2026

dsh plugin --profile web add dsh-context-compression-improved

by AllShadowAnan

User-set absolute context ceiling for DeepSeek Harness: auto-compacts a session once it reaches a configured token limit. External plugin with a dedicated Settings page.

Terminal & ClientsSessions & MessagesManifest valid

★ 2

MIT

JavaScript

Oct 8, 2026

dsh plugin --profile web add dsh-context-compressor

by NightFrost42

Incremental context compaction plugin for long conversations in DeepSeek Harness, condensing earlier dialogue into structured checkpoint summaries, retaining user requirements and task progress, and a

Security & AuditSessions & MessagesManifest valid

★ 2

MIT

JavaScript

Nov 19, 2026

dsh plugin --profile web add dsh-compaction-weave

by Snow-ea

Deterministic, recoverable tool-result compression and cache-aware compaction for DeepSeek Harness.

Development & InfrastructureManifest valid

★ 4

↓ 1.2k/wk

MIT

TypeScript

Nov 14, 2026

dsh plugin --profile web add dsh-token-optimizer

by kpl0111

Token-efficient tool-result pruning for DeepSeek Harness: compact previews, targeted recall, and long-session context control.

Manifest valid

★ 0

↓ 24/wk

MIT

JavaScript

Aug 16, 2026

dsh plugin --profile web add dsh-context-guard