Preface¶
DeepSeek Harness (DSH) supports creating sub-Agents to share workload. In real workflows, however, we often need to repeatedly invoke a fixed set of roles, such as a code reviewer, document writer, or web research assistant. The native creation method requires manual configuration each time and can easily lead to infinite nesting, resulting in wasted tokens.
The dsh-custom-subagents plugin provides a visual configuration interface that lets users save commonly used role definitions. The main Agent receives a delegate_agent tool and can invoke these predefined sub-Agents at any time.
Plugin Introduction¶
dsh-custom-subagents is a plugin for DSH that provides reusable sub-Agent definitions.
Core value:
* Define once, reuse repeatedly: Save roles such as “code reviewer” as definitions, and the main Agent can invoke them anytime.
* No code required: All operations are completed on the “Settings → Sub Agent” page, providing a what-you-see-is-what-you-get experience.
* Prevents infinite nesting: Provides a “disable nested delegation” switch and a hard depth limit (3 levels) to prevent uncontrolled token and time overhead.
Installation¶
Before installing, make sure DSH is already installed. It is recommended to install from the npm registry:
dsh plugin --profile web add dsh-custom-subagents
Platform notes:
* Windows: It is recommended to use a globally installed DSH (npm i -g @deepseek-ai/dsh) to avoid version mismatch issues.
* Port conflict: If Windows startup reports an EADDRINUSE error, change the port, for example dsh web --port 4000.
* Shell token: The plugin automatically resolves the shell tool token based on the host platform (pwsh on Windows, bash on Linux/macOS).
Configuration and Usage¶
After installation, DSH automatically obtains the delegate_agent tool. Open the Settings → Sub Agent page to configure it.
Create a New Sub Agent¶
- Click “New”.
- Fill in the form:
* Name: A unique identifier for the role, used by the main Agent to recognize it.
* Description: Written for the main Agent, describing when to use this role (for example, “use when code correctness needs to be checked”).
* System Prompt: Defines the role’s identity and working style.
* Model and Context: By default, it uses the parent model. The context can be set to “fresh” or “inherit conversation”.
* Tools: Check specific tools or select “Inherit parent Agent tools”.
Available Tool Capabilities¶
Supported tools include:
* read: Read files
* glob / grep: Find files and search content
* write / edit: Create and modify files
* Shell (bash / pwsh): Run commands
* web_search: Perform web searches
* skill: Use skills
Typical Usage¶
After configuration, directly instruct the main Agent in the conversation:
* “Have Explorer look at how the modules in src/ are organized.”
* “Use the ‘Code Reviewer’ to check the recently changed code in src/.”
Features¶
- What-you-see-is-what-you-get tool selection: Simply check tools; no configuration file is required.
- Clear security boundary: The tools available to a sub-Agent will never exceed the tools already available to the parent Agent. If the parent session lacks a tool selected in the definition, delegation will fail explicitly.
- Runtime configuration safety: Modifying or deleting definitions does not affect tasks that are already running.
- Prevents infinite nesting: The native DSH sub-Agent creation path has no default depth limit. This plugin provides two layers of protection:
- Disable nested delegation switch (default off): When enabled, a sub-Agent can no longer create any sub-Agent.
- Hard depth limit: The delegation chain is limited to a maximum of 3 levels; anything beyond that is rejected.
Notes¶
- Version compatibility: Validated on DSH
0.1.1-rc.2. The plugin peer dependency is declared as>=0.1.1-rc.2 <0.2.0-0 || >=0.1.2-0 <0.2.0-0. - Background execution: Background execution is not available; only standard mode is supported.
- Reference stability: Renaming or deleting a definition does not break references in history; it only affects future delegations.
- Preset definitions: Built-in preset sub-Agents such as Explorer cannot be deleted, only disabled.
Conclusion¶
dsh-custom-subagents solves the reuse and security management problems of DSH sub-Agents through a visual approach. It allows the main Agent to flexibly invoke specialized roles while ensuring system controllability through depth limits and tool inheritance mechanisms.
- Plugin directory: https://www.skillhub.cn/plugins/ktdhhc/dsh-custom-subagents
- GitHub repository: https://github.com/ktdhhc/dsh-custom-subagents