Introduction¶
After installing several skills, MCPs, and other plugins in DeepSeek Harness (DSH), the task itself might not be long, but every round of requests still repeatedly carries the system prompt, tool schemas, skill and MCP descriptions, and other runtime contexts injected by plugins. The longer the session, the more history messages occupy the window. It is often hard to judge where waste is occurring by just looking at “how much context is used,” and there is a lack of handles to switch specific segments or categories of capabilities on a per-session or per-project basis.
The dsh-context-control introduced below (Maintained by createjy, Category: Workflow) breaks the problem into two parts: “Request-Side” and “Session-Side”: first, see where tokens are spent, and then decide what is actually sent in this round. When necessary, lazy load skills/MCPs/plugins on a per-session basis, or compress history immediately or by threshold. The plugin does not modify DSH logs or the source code of other plugins; switches and rewrites only apply to the assembly result of the next request, and can be reverted at any time.
What is this¶
dsh-context-control is a context management plugin for DSH: see the composition of tokens, lazy load skills/MCPs/plugins on a per-session basis, and compress on demand. Official repository: createjy/dsh-context-control; Community directory page: skillhub plugin page.
Primarily targets: users running long DSH sessions with many extensions; teams that need to control context on a per-project or per-session basis; and plugin authors who want to understand where tokens go.
Core Features¶
Two Entry Points, Two Types of Problems¶
| Entry Point | Questions Answered | Capabilities |
|---|---|---|
| Left-side “Context Control” Configuration Console | What constitutes the entire request? | Break down tokens by System Prompt / Runtime Injection / Tool Definitions; toggle, edit, or restore segments individually; configure project and global rules |
| Context Capsule to the left of the Input Box | How much is this session currently occupying? What will be sent in the next round? | Current window, resend estimate, next round estimate; switch skills/MCPs/plugins levels per session; toggle prompt segments and tools; compress immediately or automatically |
At the top of the configuration console is a three-part scale (System Content / Runtime Injection / Tool Definitions), organized below by “Constituent / Project / Global”: Constituent is the actual content the current project will send; Project rules can be inherited by sub-projects; Global is the default shared by all projects.
The numbers in the capsule are consistent with DSH context statistics: Current Window is what the session has occupied; Next Send ≈ is what will be sent in the next round (system prompt, tool definitions, and per-round injections, minus hidden items for this session); Next Round Estimate ≈ is a rough estimate of the sum of the two.
See Clearly First: Separate Request-Side and Session-Side¶
- Request-Side (sent every round): System prompt sections, runtime injection, skill descriptions, tool definitions, and “per-round injections” such as the host’s runtime snapshot added each round, skill directory, plugin recall, time/timezone, etc.
- Session-Side (accumulated in the window): User messages, assistant messages, tool calls and tool results; the total “Session Accumulated” is consistent with DSH’s
tokenMeter.
Items on the Request-Side are grouped by source, each with an estimated token count, preview, and toggle; items marked with ≈ are estimates; the actual values for the Session-Side are based on the meter.
Segment Editing and Switching, Not Just Statistics¶
In the “Constituent” section of the configuration console, you can operate on four types of objects (scope includes Global / Project / This Session, see table below):
| Object | Capabilities |
|---|---|
| System Prompt sections (sections) | Toggle, edit text, restore |
| Runtime injection (contexts) | Toggle, edit text, restore (Global / Project) |
| Tool definitions (tools) | Toggle (schema text cannot be modified) |
| Skills / MCPs / Plugins | Three levels: Load / Intro / Hide |
Editing saves local rules; the next time you assemble, your text replaces the corresponding segment. Clicking “Restore” reverts to the original text generated by the host or plugin. Setting a capability to “Hide” will remove its tool definitions and related prompt segments along with it, rather than just hiding the name.
Skills / MCPs / Plugins: Three-Level Lazy Loading¶
| Level | What is sent this round | When model is called |
|---|---|---|
| Load | Body and tool definitions are both present | Normal call |
| Intro | Only a one-line description remains, body and tools are not sent | Auto-restores full content without confirmation |
| Hide | Not even the description is sent | Auto-restores full content without confirmation |
The three levels default to This Session. The model can also list unloaded items via context_control_open or match by name. Priority from low to high is: Global → Project Inheritance Chain → Project Override → This Session Override.
Session Compression and Always-Inject Requirement¶
- Immediate Compression: When the host provides a compression service, DSH selects compressible intervals and folds history; queues if the current round is still running.
- Automatic Compression: After the window usage reaches a set ratio (5%–95%), executed during idle times.
- No Compression Service: Can send compression-type steer commands; the model folds in-place without hard-modifying session logs.
At the bottom of the capsule, check “Always-Inject Requirement” (Optional) to attach a context-control:note segment to the end of the system prompt, sent every round; token estimation is consistent with @deepseek-ai/dsh-token-meter (approx. 4 chars/token).
AI Suggestions (Disabled by default)¶
Since 0.6.0, this can be triggered from the configuration console or the capsule: give the current session model the metadata of the currently scoped entry, providing suggestions with reason/confidence/risk. You must preview and check before applying “Apply Selected”. What is sent is the entry name, type, and token count; session body is not sent. Basic capabilities (file read/write, shell, compression, this plugin, etc.) are protected.
Installation and Activation¶
Requires DSH 0.2.2-rc.1 to 0.2.2-rc.3; package.json declares compatibility with >=0.2.2-rc.1 <0.3.0-0 and is tested on rc3. Also requires Node >=24.9.0.
Install directly from GitHub:
dsh plugin add github:creatjy/dsh-context-control
Or download the tarball from the Release and install locally, for example:
dsh plugin add ./dsh-context-control-0.6.11.tgz
Or via GitHub Packages (requires authenticating to https://npm.pkg.github.com first):
npm login --scope=@creatjy --auth-type=legacy --registry=https://npm.pkg.github.com
npm config set @creatjy:registry https://npm.pkg.github.com
dsh plugin add @creatjy/dsh-context-control
After installation, restart DSH and refresh the Web GUI. “Context Control” will appear in the left column, and a capsule similar to Context 12.7k ▾ will appear to the left of the input box.
Rules are written locally in <DSH_PROFILE_DIR>/dsh-context-control/modes.json; deleting that file restores defaults (all loaded, no project overrides). License: MIT.
Typical Usage¶
- Long sessions getting slower: Open the capsule, set unused MCPs/plugins to “Intro” or “Hide”, then click “Immediate Compression”.
- Some plugin injects too much: Configuration Console → “Constituent” → “Runtime Injection”, find the corresponding source and turn it off, or “Edit” to condense it into short sentences.
- System prompt is too long: In “System Prompt”, check estimated tokens by segment, rewrite rules to what the current project needs, or turn off unused tool description segments.
- Don’t want to adjust manually every time: Set default rules at the project level, and only override what is needed in the session.
Suitable Scenarios and Notes¶
Suitable for: DSH users who need to see token composition and control “what to send” on a per-session or per-project basis; environments with many plugins installed where tool schemas have a high proportion.
Notes during use:
- The plugin runs with the permissions of the current DSH process; it is advisable to review the repository source code and the MIT license before installing.
- Numbers marked with
≈are estimates, not a bill; even if you turn off all tools, the model genuinely does not have the corresponding tools; the interface will prompt but will not block. - Trimming is attached to the assembly and paths like
agent.ctx.tools.restrict; it only changes “whether to send,” not directly modifying other plugin source code or DSH logs. - The DSH plugin ecosystem follows “everything is a plugin”; skillhub.cn is a community directory and has no official affiliation with DeepSeek or Huaxuan.
Conclusion¶
The core value of dsh-context-control is: first separate the tokens of the request-side and session-side, and then, without modifying logs, decide on the loading method of system prompts, injections, tools, and extensions based on Global / Project / Session, and compress history when necessary. To install or see update notes, visit the GitHub repository or skillhub directory page.