UI Enhancements
dsh-claude-code
Yuki-takuya-kun/dsh-claude-code · ★ 0
Run Claude Code harness as the DeepSeek Harness main loop, streaming live trajectory into the DSH web UI.
Manifest details
安装
dsh plugin --profile web add github:Yuki-takuya-kun/dsh-claude-codeGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
✨ What it does
- 🎯 Plug Claude Code in: registers a
claude-codeengine (ClaudeCodeAgent+ preset), routed by dsh-engine-switch with zero config. - 📡 Live trajectory: text, thinking, tool calls and results stream into the DSH session in real time.
- 📊 Visible context usage: Claude Code's token usage and model context window are written into the DSH session log (
TokenUsage+request/context), so the UI shows the context-usage ratio just like DSH native. - 🔐 Permission bridge: DSH's sandbox mode + approval policy map onto Claude's permission callback (in-workspace edits allowed, outside prompts for approval);
AskUserQuestionis answered through DSH's choice UI. - 🧰 Tools and sandbox come from Claude Code: the preset is only a routing key — DSH's persona / tools are not forwarded.
- ⏯️ Precise resume: the Claude session id is side-persisted, so continuing a session reuses the same Claude session.
- 🌐 Subagents stay DeepSeek: regardless of what the main session picked.
🔌 In one line: this plugin does not replace the main loop itself — it only defines a
claude-codeengine, and hands "preset → engine" routing, switching and resume to dsh-engine-switch. The preset is only a routing key: pick it, and tools / sandbox / persona all come from Claude Code; DSH keeps the log and UI.
🚀 Install
Install dsh-engine-switch first (it provides the ctx.engineSwitch service this plugin depends on; peer deps aren't auto-installed):
dsh plugin --profile web add github:Yuki-takuya-kun/dsh-engine-switch \
&& dsh plugin --profile web add github:Yuki-takuya-kun/dsh-claude-code
Requirements: pnpm on PATH, and a working claude CLI (logged in) or ANTHROPIC_API_KEY.
⚙️ Enable
Edit ~/.dsh/profiles/web/cordis.patch.yml:
- id: dsh-engine-switch
config:
enabled: true
# optional: claude-code engine options:
engines:
claude-code:
executable: claude
# env: { ANTHROPIC_API_KEY: sk-... } # when not logged in
Restart the web app. A "Claude Code" preset appears: pick it → Claude Code, anything else → DeepSeek.
⚙️ Config
These are options for the claude-code engine, written under dsh-engine-switch's config.engines["claude-code"]:
| Key | Default | Meaning |
|---|---|---|
| executable | "claude" | Claude Code executable (path or PATH name) |
| persistSession | true | reuse the same Claude session across turns |
| includePartialMessages | true | token-level streaming |
| traceSubagents | true | trace Claude Code's internal subagents (Agent/Task tools) as standalone read-only DSH child sessions |
| env | {} | extra env (e.g. ANTHROPIC_API_KEY) |
| contextWindow | unset | manually set the model context window (tokens), fallback when auto-detection yields nothing |
🔍 How it works (optional)
- In
apply(), this plugin callsctx.engineSwitch.register(claudeCodeEngine)to register theclaude-codeengine (inject: ["engineSwitch"]). - Each turn runs Claude Code; SDK events are translated into DSH session events (turn / step / assistant / tool, …), streamed live.
- Permissions are bridged via the
canUseToolcallback: in-workspace writes auto-allow, outside prompts;AskUserQuestionuses DSH's choice UI.
📄 License
MIT. See THIRD_PARTY_NOTICES.md for third-party components.