Introduction¶
In DeepSeek Harness (DSH), the main session is often responsible for breaking down goals and defining acceptance criteria. However, if specific code modifications and test executions are piled into the same conversation turn, the context becomes flooded with file diffs and build logs, which also hinders parallelization. A common workaround is to open a separate terminal to run Claude Code, but this requires manually bridging task descriptions, working directories, and result retrieval, which does not align well with DSH’s job and notification systems.
The following introduces the community plugin dsh-claude-delegate (Maintainer: project-hy, Category: Workflow). It drives the locally logged-in claude CLI via the official Claude Agent SDK to delegate self-contained coding subtasks with clear boundaries to Claude Code for execution in specified directories, and retrieves structured results back into DSH. The plugin does not extract or forward OAuth credentials.
What is this¶
dsh-claude-delegate is a DSH tool plugin (npm package name dsh-claude-delegate, version 0.8.1 in current documentation, license MIT). Upon installation, it registers the claude_code tool, an in-session Claude Code monitoring panel, and runtime skills claude-code-delegation and parallel-dev with DSH (registered with the plugin; no need to maintain separate skill copies in the user directory).
The DSH side defines task goals and acceptance criteria; Claude Code performs reading, modification, and verification within the provided cwd. Compared to “using a single model end-to-end within DSH to modify the repository,” this path delegates heavy coding to the local Claude Code subscription, while DSH retains orchestration and result retrieval.
Core Features¶
The following capabilities are derived from the plugin README and package description. Default configurations can be overridden per invocation.
| Capability | Description |
|---|---|
| Parameter Control | Model, thinking effort, permission mode, allowed tools, turns/budget/timeout, additional system prompts, custom subagents. |
| Background Async | run_in_background: true returns a jobId, compatible with native DSH job_output / job_list / job_kill; notifications are sent upon completion. |
| Session Resumption | Pass the session from the result back as resume to continue in the same Claude Code session. |
| Real-time Output for Long Commands | In-process MCP tool mcp__dsh__shell; long commands like builds/tests stream line-by-line to the monitoring panel (output does not go to job_output; conclusions must be provided in the response body). |
| Structured Output | Pass outputSchema (JSON Schema) to obtain structuredOutput. |
| Cost Tracking | Returns cost, tokens, and turns; supports maxBudgetUsd hard cap. |
| Monitoring Panel | “Claude Code” tab: task list, process view, real-time terminal block, one-click cancel. |
System Requirements (Excerpt): DSH >=0.1.0-rc.6 <0.3.0; Locally installed and logged-in Claude Code CLI (npm install -g @anthropic-ai/claude-code); Background mode depends on DSH job service; Long command channel requires POSIX bash (Windows recommends Git for Windows bash.exe).
Permission Notes: The default wiring uses permissionMode: acceptEdits (auto-approves file edits; command execution is still constrained by allowedTools). The plugin does not implement an approval bridge; unauthorized actions will fail directly.
Installation and Enablement¶
Installation via the DSH plugin command is recommended (the package includes the dsh.bundle wiring manifest):
dsh plugin --profile <profile> add dsh-claude-delegate
Equivalent manual method: npm install dsh-claude-delegate under ~/.dsh/profiles, and confirm the existence of the claude-code plugin entry in ~/.dsh/profiles/<profile>/cordis.patch.yml. DSH restart is required after installation.
Default wiring example (secure default values, modify proxy etc. as needed):
- insert:
- id: claude-code
name: dsh-claude-delegate
config:
model: sonnet
permissionMode: acceptEdits
maxTurns: 100
timeoutMs: 7200000
Configuring proxy is usually only required when the local machine’s outbound IP is identified as a datacenter IP and Anthropic returns a 403.
Typical Usage¶
Invoke the tool claude_code via DSH within the context of the working directory where delegation is needed.
Foreground Delegation (Task description should clearly state goals, files, constraints, and acceptance criteria; cwd is recommended to always use absolute paths):
{
"task": "Fix the issue where parse() in src/parser.ts crashes on empty input, and add corresponding unit tests",
"cwd": "/absolute/path/to/repo"
}
Background Delegation:
{
"task": "Migrate all of src/ to the new logger API and ensure npm run build passes",
"cwd": "/absolute/path/to/repo",
"run_in_background": true
}
After returning { "kind": "background", "jobId": "claude-code-1" }, you can use DSH job tools to read incremental output; you can also view it in the session Claude Code panel. To continue from the previous round:
{
"task": "The previous fix missed a boundary case, please supplement it and re-run the tests",
"resume": "<session id from the previous result>"
}
Use Cases and Notes¶
Suitable for: Scenarios where DSH handles planning and acceptance, delegating self-contained subtasks like “modify specific files + run tests/build” to local Claude Code; needing to run long tasks in the background and monitor real-time build output; needing JSON Schema structured result retrieval; wishing to perform multiple rounds of fixes in the same Claude Code session.
Please be aware before use:
- The plugin runs with the user privileges of the current DSH process. Claude Code can edit files and execute authorized commands within the specified
cwd. It is recommended to review the GitHub repository source code and the MIT license before installation. - The community directory SkillHub Plugin Page is an independent site and has no official affiliation with DeepSeek / High-Flyer. The DSH ecosystem philosophy is “Everything is a plugin,” and this plugin is one of the workflow-type community extensions.
- Monitoring panel job records are stored within the current DSH process (latest 20 per session) and are cleared after the process restarts; history can still be viewed in the conversation tool cards.
- Restarting DSH is required after modifying the plugin client part (no hard refresh for the desktop client).
Conclusion¶
dsh-claude-delegate aligns DSH orchestration with local Claude Code execution: the claude_code tool, background jobs, monitoring panel, and mcp__dsh__shell real-time channel. It is suitable for DSH users who require a delegated coding workflow.
- Directory Page: https://www.skillhub.cn/plugins/project-hy/dsh-claude-delegate
- Source Code, Full Parameters, Configuration, and Troubleshooting: https://github.com/project-hy/dsh-claude-delegate