Introduction¶
When DeepSeek Harness (dsh) initializes a new session, it usually sends the full toolset (including file editing, bash execution, subagents, etc.) to the model in the first turn. This full-schema approach can easily cause the model to execute operations too early during the exploration phase instead of focusing on analysis. dsh-minimal-anchor is a plugin designed to address this issue. It hooks into DSH’s prompt assembly flow, prunes the tool list only in the first turn, and injects a structured preamble to keep the model focused during exploration.
Plugin Overview¶
dsh-minimal-anchor is a DeepSeek Harness plugin maintained by developer rand0wn. Its core purpose is to protect the first turn from tool schema overload. It is open-sourced under the MIT license.
Core Features¶
- First-turn tool pruning: Limits the tool list to a whitelist only in the first turn of the session.
- Structured preamble injection: Adds a short exploration-oriented preamble to the first-turn prompt.
- No impact on later turns: Starting from the second turn, the plugin fully steps aside and restores the full toolset and normal prompt assembly flow.
Installation and Activation¶
Installing the plugin requires adding the package to the dependencies of a specified profile and explicitly declaring it in the bundles list for it to take effect.
- Install the plugin:
dsh plugin --profile <name> add dsh-minimal-anchor
- Declare activation:
After the plugin is installed as a dependency, it must be added to thedsh.profile.bundlesfield in the profile’spackage.json:
{
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-headless",
"dsh-minimal-anchor"
]
}
}
}
- Verify installation:
Usedsh --profile <name> --dump-configto check whether the output contains aminimal-anchorentry.
Typical Usage¶
This is a passive plugin that does not require any additional invocation command.
- Normal startup: Directly use regular commands such as
dsh webordsh --profile headless "..."to start it. - Automatic activation: The first turn of each new session automatically includes the pruned tool list and preamble; later turns remain unchanged.
Configuration¶
The configuration file is located at profiles/<name>/cordis.patch.yml. The following is a default configuration example:
- insert:
- id: minimal-anchor
name: 'dsh-minimal-anchor'
config:
whitelistedTools: [read, glob, grep]
enforcePreamble: true
customPreamble: 'Your own turn-1 framing text.'
| Field | Default | Description |
|---|---|---|
whitelistedTools |
[read, glob, grep] |
Tool names retained in the first turn. They must exactly match the names registered in the harness. |
enforcePreamble |
true |
Whether to enforce injection of the structured preamble. |
customPreamble |
(built-in exploration-oriented text) | Custom preamble content. It only takes effect when enforcePreamble is true. |
How It Works¶
The plugin is implemented by hooking into the system-prompt/assemble pipeline in the @deepseek-ai/dsh-system-prompt package.
* First assembly: It uses a WeakSet to record the scope. On the first assembly, it filters the tool list to the whitelist, inserts the preamble at the beginning, and then calls next() to continue to subsequent listeners.
* Subsequent assemblies: For later assemblies in the same scope, it directly calls next() without making any modifications, ensuring that the toolset is restored to its original state.
Notes and Troubleshooting¶
- Tool name matching: If the first-turn tool list is empty, it is usually because the names in
whitelistedToolsdo not match the actually registered tool names. Usedsh --profile <name> --dump-configto view the actual tool names. - Bundles must be declared: It is not enough to only install the dependency via
dsh plugin add; it must be added todsh.profile.bundlesto activate thedsh.bundlepatch. - Config type restriction: The exported
Configmust be aschemasteryschema (i.e.,z.object({...})) and cannot be a plain object. Otherwise, in fork scenarios, it will report the errorCannot read properties of undefined (reading 'validate'). - Ecosystem note: DSH uses a plugin-based architecture. This plugin is developed by the community and has no direct affiliation with the official DeepSeek.
Summary¶
dsh-minimal-anchor is suitable for DSH users who want to guide the model to explore rather than immediately execute operations in the early stages of a session. With a very lightweight intervention, it addresses the first-turn schema overload problem.
- Catalog page: dsh-minimal-anchor
- GitHub repository: rand0wn/dsh-minimal-anchor