Introduction¶
DeepSeek Harness (DSH) uses DeepSeek as the main loop by default. If you need to switch to Claude Code within the same workflow while preserving DSH’s interface and logging capabilities, an additional solution is required. The dsh-claude-code plugin is designed for this purpose. It does not replace the main loop itself; instead, it defines a claude-code engine that works with dsh-engine-switch to achieve seamless switching. When the main session selects Claude Code, the tools, sandbox, and persona all come from Claude Code; subagents continue to use DeepSeek.
Key Features¶
-
One-click integration with Claude Code
The plugin defines aclaude-codeengine that is used together withdsh-engine-switch. After the “Claude Code” option appears in the preset list, select it to switch; selecting any other option uses DeepSeek. -
Real-time trace visibility
Text, thinking, tool calls, and results stream into the DSH session in real time, with each step displayed live in the interface. -
Visible context usage
Claude Code’s token usage and model context window are written to the DSH session log (TokenUsage+request/context), and the DSH interface uses this to display the context usage ratio. -
Permission bridging
DSH’s sandbox mode and approval policies are mapped to Claude’s permission callbacks: write operations within the workspace are allowed, while operations outside the workspace trigger approval.AskUserQuestionis answered using DSH’s multiple-choice UI. -
Tools and sandbox
The preset acts only as a routing key and does not pass DSH’s persona or tools through. Both tools and sandbox behavior come directly from Claude Code. -
Precise resumption
By persisting the Claude session ID via a side channel, a resumed conversation reconnects to the same Claude session instead of starting a new one. -
Subagents continue using DeepSeek
Regardless of which engine the main session selects, subagents continue to use DeepSeek.
Installation¶
This plugin depends on dsh-engine-switch, so install that dependency first.
dsh plugin --profile web add github:Yuki-takuya-kun/dsh-engine-switch
dsh plugin --profile web add github:Yuki-takuya-kun/dsh-claude-code
Installation requirements:
* pnpm is included in your PATH.
* The claude CLI is installed locally (and logged in), or the ANTHROPIC_API_KEY environment variable is set.
Configuration and Enablement¶
Edit ~/.dsh/profiles/web/cordis.patch.yml to enable dsh-engine-switch and configure the claude-code engine:
- id: dsh-engine-switch
config:
enabled: true
# Optional: options for the claude-code engine
engines:
claude-code:
executable: claude
# env: { ANTHROPIC_API_KEY: sk-... } # Use when not logged in
Restart the web app. Select “Claude Code” in the preset list to switch modes; select any other option to continue using DeepSeek.
How It Works¶
This plugin registers the claude-code engine in apply() through ctx.engineSwitch.register(claudeCodeEngine).
During each run, the plugin calls the Claude Code SDK and converts the SDK-generated events into DSH session events (turn / step / assistant / tool, etc.), enabling real-time streaming output.
Permission control is bridged through the canUseTool callback: write operations within the workspace are allowed, while operations outside the workspace trigger approval. AskUserQuestion also reuses DSH’s multiple-choice UI.
Notes¶
- This plugin does not replace the main loop itself; it only defines an engine.
- It must be used together with
dsh-engine-switch. - For details on third-party components, see
THIRD_PARTY_NOTICES.md.