wanwulizhi/dsh-claude-code-sdk ↗★ 0
dsh-claude-code-sdk
DSH tool plugin that delegates a self-contained coding task to the local Claude Code agent through the Claude Agent SDK, prepends the current DSH conversation history, and keeps the worker's intermediate tool calls out of the main context. 适合开发者,需本机已安装并登录Claude Code及Node.js环境。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:wanwulizhi/dsh-claude-code-sdk配置
默认值写在插件自带的 cordis.patch.yml。要覆盖就在 profile 的 cordis.patch.yml 里按 id 改:
- id: claude-code-sdk
config:
model: sonnet
permissionMode: acceptEdits
maxTurns: 100
timeoutMs: 600000
effort: high
cwd: '/path/to/project'
allowedTools: [Bash, PowerShell, Read, Write, Edit, Glob, Grep]
includeHistory: true
historyMaxMessages: 20
historyMaxChars: 12000
# 可选:指定某个 claude 可执行文件;留空则由 SDK 解析自带的 CLI
pathToClaudeCodeExecutable: '/path/to/claude'
字段一览
| 字段 | 默认值 | 说明 |
|---|---|---|
model | sonnet | 模型别名或完整 id。若 ~/.claude/settings.json 里配了模型映射,这里写的是映射前的别名 |
permissionMode | acceptEdits | 权限模式,详见「权限模型」 |
maxTurns | 100 | 单次委派的最大 agentic 轮数。到顶会报 Reached maximum number of turns |
timeoutMs | 600000 | 工具级超时(10 分钟),同时作为 DSH 的工具超时声明 |
cwd | 未设置 | 工作目录。建议显式指定,否则会落在 DSH 进程目录 |
allowedTools | 见下 | 预授权工具白名单。默认 Bash, PowerShell, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch |
pathToClaudeCodeExecutable | 未设置 | 留空时由 SDK 解析自己捆绑的 CLI(`claude-agent-sdk- |
| /claude.exe`) | ||
effort | high | 思考强度 |
maxThinkingTokens | 未设置 | 思考 token 上限,与 effort 二选一即可 |
includeHistory | true | 是否注入 DSH 对话历史 |
historyMaxMessages | 20 | 最多注入最近多少条消息 |
historyMaxChars | 12000 | 注入历史的字符预算 |
工具参数与配置同名时,工具参数优先(args.x ?? config.x)。注意空数组不会被默认值覆盖——[] 是有效值,?? 只对 null / undefined 生效,所以显式传 allowedTools: [] 就是"什么都不预授权"。