Introduction¶
Every session in DSH (DeepSeek Harness) includes descriptions of all tools within the context. When many tools are installed, the descriptions themselves consume tens of thousands of tokens. Meanwhile, the model must select tools from this list every turn; the longer the list, the higher the probability of making mistakes or taking detours.
The existing approach involves mode switching defined within presets. dsh-mode-switch handles this from a different angle: instead of modifying presets, it configures a separate “tier” for each session, allowing a session to only include the currently relevant tools. You can switch tiers, view the savings, and modify rules directly on the interface. The plugin is maintained by MOLMOORE and falls under the Workflow category; it currently has 0 stars on GitHub.
What is it¶
In one sentence: Adds a tool tier layer to DeepSeek Harness, allowing every session to carry tools according to its tier.
It does not declare presets nor modify the preset registry. The official modes remain unchanged; the tiers are an additional layer stacked on top. Scenarios where pre-declared tool sets cannot reach (tools built into presets, tools registered in agent scope, interface cards from other plugins) are outside the scope of this governance layer. The section “Applicable Scenarios and Notes” will explain this in detail later.
Installation and Activation¶
Requires DSH 0.2.1 or later. Installation command:
dsh plugin --profile desktop add github:MOLMOORE/dsh-mode-switch
Restart after installation. A capsule line will appear above the input box:
Tier Basic Tier · Standard Mode · 62 Tools · ≈14.9k tok schema
The numbers 62 and 14.9k are from the author’s machine; they will vary depending on which plugins are installed. This step only adds the plugin; specific behavior must be confirmed on the interface after restarting. The plugin’s package.json specifies an MIT license.
Core Features: Four Interface Actions¶
- Click the small capsule on the right to switch tiers. Only sessions that have not sent any messages yet can switch.
- Click the main capsule to expand details: the number of tools, tokens, and savings compared to the full tier for each tier, as well as how many tools the first request of this session actually carried.
- “Edit Tiers” in the top right: add tiers, rename, delete, and check which tools to keep for each tier. Save after changes, and new sessions will take effect.
- “AI Allocation” in the editor: gives the current machine’s tool names and descriptions to the default model, asking it to tier them by usage. The results are filled into the editor first for manual review before saving.
“AI Allocation” triggers the model (using the default route) once, taking tens of seconds to a minute or two; the cost is charged to the user’s account. The button will error if there is no available model, but manual checking still works.
How Rules are Calculated¶
The core rule is only one:
Visible Tools = Global Tools − Deny Rules of Current Tier
In deny, foo_* matches by prefix, while others match by full name. Tools built into presets (read/write files, todo, ask user) and tools registered in agent scope are not on the global list and cannot be trimmed by any tier.
Rules are stored in ~/.dsh/state/mode-switch/catalog.json and are automatically generated on first run. The panel modifies this file; editing the file directly is also fine, and a restart is not required. The structure is as follows:
{
"version": 1,
"modes": [
{ "id": "mode-basic", "name": "Basic Tier", "order": 10, "deny": ["mcp__*", "ego_*", "ppt_*", "office_*"] },
{ "id": "mode-full", "name": "Full Tier", "order": 40, "deny": [] }
]
}
An empty deny means all are included. If a tier is deleted, sessions pointing to it will fall back to the first tier based on order and will not become unrestricted.
When Does it Take Effect¶
| Timing | Behavior |
|---|---|
| New session, no messages sent yet | Can switch, selection is recorded but not yet effective |
| First message sent | Trimmed once according to the selected tier; default tier is used if none selected |
| After conversation starts | Cannot switch; server returns session-started |
| Sessions created before plugin installation | Not rewritten, displays Full Tier |
You cannot switch tiers during a conversation because DSH fixes the tool directory when assembling the first request; subsequently, ctx.tools.restrict() can only tighten restrictions, not loosen them. To switch tiers, open a new session.
The Default Four Tiers¶
| Tier | What is kept |
|---|---|
| Basic Tier | Core tools. MCP, Browser, PPT, Office, Lunheng, and others are removed |
| Office Tier | Office documents and PPT-related items are kept; modeling and browser are removed |
| Modeling Tier | SolidWorks MCP is kept; Office, PPT, and browser are removed |
| Full Tier | No trimming |
The Modeling Tier is written based on the author’s own machine: the author has the SolidWorks MCP installed, so a tier was specifically reserved for it. On machines without CAD installed, this tier is basically the same as the Office Tier, with no distinguishable difference. After installation, it is more reliable to look at your own tool list first, or click “AI Allocation” to redo it, rather than blindly copying the default values.
Effect of Carrying Fewer Tools¶
The following are actual test numbers from the author’s machine; the number of tools depends on which plugins are installed and serves only as a reference for scale.
- Saves tokens. On the author’s machine, the full set has 198 tools, approx 54.8k tokens; the Basic Tier has 62, approx 14.9k. The tool table is fixed during the first assembly, and every subsequent request carries the same set, saving tokens for every request in the entire session.
- Fewer distractions for the model. The longer the tool table, the more irrelevant descriptions read, making it easier to pick the wrong tool or get stuck circling around unused capabilities. Removing unused tools first makes the selection smaller and the answers shorter. This is a judgment based on usage; the author has not conducted quantitative experiments.
- Fewer actions on the interface. With fewer tools, the model will no longer repeatedly test choices like “Should I use the browser to check this?”
Typical Usage: Create Tiers by Project Type, Then Open New Sessions¶
Suitable for scenarios where the tool set is fixed for a long time and divided by scenario.
- In “Edit Tiers” in the top right, add a tier named “Debug Tier”, fill
mcp__*in the deny list, and placeorderbefore the Basic Tier. - Save, and the new session will take effect.
- Enter a new session and confirm that the capsule above the input box shows the newly created tier.
- If CAD components are installed locally, change it to check SolidWorks-related MCP in the panel, rather than directly applying the default “Modeling Tier”.
Direct configuration via file is also possible, for example, editing ~/.dsh/state/mode-switch/catalog.json and adding a section:
{ "id": "mode-debug", "name": "Debug Tier", "order": 5, "deny": ["mcp__*", "ppt_*"] }
No restart is needed after saving; new sessions will read it. When plugins are renamed or new tools are added, the rules must be updated accordingly; otherwise, trimming will be missed, as it relies on name matching rather than capability descriptions.
Applicable Scenarios and Notes¶
Suitable for these situations: DSH has a large number of tools and significant token usage; tool sets are divided by project type; you want team members to use the same set of tier conventions.
Three things need to be confirmed before use.
- The plugin runs with the permissions of the current DSH process. Before installing, you should read the source code and license to confirm it does not introduce additional sensitive permissions.
- Only global tools can be trimmed: tools built into presets and tools registered in agent scope cannot be trimmed. Official slots also do not have an interface to remove interface cards from other plugins, so those entries will remain on the interface as they are.
denyis a naming rule; its coverage depends on the stability of tool naming.
Plugin Exposed Interfaces¶
The plugin exposes a set of HTTP interfaces that plugin authors and debugging scripts can use to verify the actual effect of tiers:
| Method | Path | Description |
|---|---|---|
| GET | /api/mode-switch/status?sessionId= |
Data used for the capsule |
| GET | /api/mode-switch/detail?sessionId= |
Panel data: footprint of each tier, per-tool overhead, all tools |
| GET | /api/mode-switch/verify?sessionId= |
Request-level evidence: how many tools were actually carried for each request in the session log |
| POST | /api/mode-switch/select?sessionId=&toolset= |
Select tier, limited to sessions that have not started |
| POST | /api/mode-switch/modes |
Save the entire tier list |
| POST | /api/mode-switch/auto |
Invoke the model to propose a tier plan (does not write) |
For scenarios where you want to verify how many tokens were saved, using /api/mode-switch/verify to get request-level evidence is more direct. Details and test records are in the repository’s docs/LIMITATIONS.md.
Conclusion¶
dsh-mode-switch solves the issue of “a session shouldn’t carry all tools at once”: using tiers to separate tool declaration and scope, and switching tiers, editing, and allocating by model in one go on the interface, without modifying the preset registry. Directory page: https://www.skillhub.cn/plugins/MOLMOORE/dsh-mode-switch ; Source code: https://github.com/MOLMOORE/dsh-mode-switch .