snailium/dsh-command-context-trim

dsh-command-context-trim adds a model-free /trim command and a compaction-threshold tuner to DSH: instead of summarizing, /trim measures the current request under the target route and shadows the oldest tool-pairing-balanced span with one marker message across two synchronous appends and zero LLM calls, so a small-window local model can be fed when every summarize-based request would overflow.

dsh-command-context-trim gives a small-window local model every token it can actually use without a single model call. The model-free /trim command solves the case where switching a long session from a large-window cloud model to a smaller local model makes the next request exceed the new window, and where the usual /compact workaround fails because compaction summarizes with the very region being condensed: /trim instead measures the current request under the target route, picks the oldest tool-pairing-balanced span that frees exactly enough tokens, and shadows it with one short marker message. The plugin also exposes a compaction-threshold tuner that attacks the cause by raising where compaction fires, on a small local window the difference between using most of the context and less than half of it.

Workflow & Automation ★ 1
View on GitHub ↗

Install

dsh plugin --profile web add dsh-command-context-trim

Copied verbatim from the README's Install block. The README also documents a file:/path/to/... isolated-DSH_HOME form. npm package dsh-command-context-trim at 0.6.6 (registry check 2026-10-16; the registry repository field resolves back to this repo).

Compatibility

/trim needs no model at all: it measures the current request under the target route, picks the oldest tool-pairing-balanced span that frees exactly enough tokens, and shadows that span with one short marker message across two synchronous appends and zero LLM calls - so it works precisely when every summarize-based request (and DSH's own automatic context-overflow recovery, which also summarizes with the routed model) would overflow. The other half raises where compaction fires on a small local window, since DSH reserves a fixed 65536-token headroom.

Details

Alternatives

940842546/dsh-permissions · adithya-hmt/fullstack-expert · alib8b8/dsh-plugin-aflare

More plugins in Workflow & Automation

Browse more in Workflow & Automation

Guides for Workflow & Automation plugins