UI Enhancements

dsh-claude-code

Yuki-takuya-kun/dsh-claude-code · ★ 0

Yuki-takuya-kun

Run Claude Code harness as the DeepSeek Harness main loop, streaming live trajectory into the DSH web UI.

License
MIT
Added
2026-08-16
Maintenance
active
Install kind
github
Manifest details
Manifest status
Declared
Manifest path
package.json#dsh
Manifest checked
2026-08-19
Lifecycle scripts
None found

Static manifest checks report declarations only; they are not compatibility or security review.

安装

dsh plugin --profile web add github:Yuki-takuya-kun/dsh-claude-code

GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试

For install and environment setup, plus plugin development tutorials, see DSH community docs ↗

README

Source README · body: en · Read Chinese README

Table of contents
  1. ✨ What it does
  2. 🚀 Install
  3. ⚙️ Enable
  4. ⚙️ Config
  5. 🔍 How it works (optional)
  6. 📄 License

✨ What it does

  • 🎯 Plug Claude Code in: registers a claude-code engine (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); AskUserQuestion is 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-code engine, 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 calls ctx.engineSwitch.register(claudeCodeEngine) to register the claude-code engine (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 canUseTool callback: in-workspace writes auto-allow, outside prompts; AskUserQuestion uses DSH's choice UI.

📄 License

MIT. See THIRD_PARTY_NOTICES.md for third-party components.