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

  1. First-turn tool pruning: Limits the tool list to a whitelist only in the first turn of the session.
  2. Structured preamble injection: Adds a short exploration-oriented preamble to the first-turn prompt.
  3. 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.

  1. Install the plugin:
    dsh plugin --profile <name> add dsh-minimal-anchor
  1. Declare activation:
    After the plugin is installed as a dependency, it must be added to the dsh.profile.bundles field in the profile’s package.json:
    {
      "dsh": {
        "profile": {
          "bundles": [
            "@deepseek-ai/dsh-base",
            "@deepseek-ai/dsh-headless",
            "dsh-minimal-anchor"
          ]
        }
      }
    }
  1. Verify installation:
    Use dsh --profile <name> --dump-config to check whether the output contains a minimal-anchor entry.

Typical Usage

This is a passive plugin that does not require any additional invocation command.

  • Normal startup: Directly use regular commands such as dsh web or dsh --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

  1. Tool name matching: If the first-turn tool list is empty, it is usually because the names in whitelistedTools do not match the actually registered tool names. Use dsh --profile <name> --dump-config to view the actual tool names.
  2. Bundles must be declared: It is not enough to only install the dependency via dsh plugin add; it must be added to dsh.profile.bundles to activate the dsh.bundle patch.
  3. Config type restriction: The exported Config must be a schemastery schema (i.e., z.object({...})) and cannot be a plain object. Otherwise, in fork scenarios, it will report the error Cannot read properties of undefined (reading 'validate').
  4. 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.