npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-claude-code

v0.1.2

Published

DSH tool plugin: delegate a self-contained task to your local Claude Code subscription (via the official Claude Agent SDK).

Readme

dsh-plugin npm license

dsh-claude-code

一个 DeepSeek Harness 工具插件:把自包含的编码子任务委派给本地 Claude Code 订阅执行,结果回传给 DSH。DSH 是 leader,Claude Code 是 worker。

  • 走官方 Claude Agent SDK,驱动 claude CLI,不提取任何 OAuth token,合规使用订阅。
  • 内置 claude-code-delegation skill(Leader-Worker 委派 SOP),装好即出现在技能目录。
  • 支持 resume 跨轮记忆:把上次返回的 sessionId 传回,Claude Code 会记住之前的上下文,适合多轮迭代。

安装(用户侧)

# 方式一(最简单,自动接线):通过 dsh 插件命令安装
dsh plugin --profile web add dsh-claude-code

# 方式二:手动装进 profile
cd ~/.dsh/profiles
npm install dsh-claude-code
# 然后在 ~/.dsh/profiles/<你的profile>/cordis.patch.yml 里加上:
# - insert:
#     - id: claude-code
#       name: 'dsh-claude-code'

装完重启 dsh。插件自带 cordis.patch.yml(dsh.bundle manifest),dsh plugin add 会用它自动接线。

接线示例(带配置):

- insert:
    - id: claude-code
      name: 'dsh-claude-code'
      config:
        model: sonnet                # sonnet | opus | haiku | 完整 id
        permissionMode: acceptEdits  # default | acceptEdits | bypassPermissions | plan | dontAsk
        maxTurns: 100
        timeoutMs: 600000
        # 可选:claude 可执行文件路径(SDK 会自动从 PATH 探测,一般不用配)
        # pathToClaudeCodeExecutable: /path/to/claude

配置项

| 字段 | 默认 | 说明 | |---|---|---| | model | sonnet | Claude 模型别名或完整 id | | permissionMode | acceptEdits | Claude Code 权限模式。acceptEdits 自动放行文件编辑;bypassPermissions 完全免确认(需信任) | | maxTurns | 100 | 每次任务 Claude Code 最多跑多少轮 | | timeoutMs | 600000 | 单次调用的协作超时 | | cwd | DSH cwd | Claude Code 工作目录 | | allowedTools | 未设 | 允许的 Claude Code 内置工具名列表 | | pathToClaudeCodeExecutable | 自动 | claude 可执行文件路径 | | effort | high | 思考强度:low/medium/high/xhigh/max | | maxThinkingTokens | 未设 | 思考 token 预算上限 |

工具参数(模型可见)

| 参数 | 说明 | |---|---| | task(必填) | 自包含任务描述(目标、文件、约束、验收) | | cwd / model / permissionMode / maxTurns / allowedTools / effort / maxThinkingTokens | 覆盖插件配置 | | resume | 传上次返回的 sessionId,续接那个 Claude Code 会话(记住之前的上下文) |

返回:最终结果文本 + sessionId + token 用量 + 费用 + 用到的工具。

用法示例

// 第一轮
{ "task": "修复 src/parser.ts 里 parse() 对空输入的崩溃,并加一个单元测试", "cwd": "/path/to/repo" }
// → { "ok": true, "output": "…", "sessionId": "abc-123" }

// 第二轮(迭代同一任务,带记忆)
{ "task": "上一步的修复里你漏了边界情况 X,补上并重跑测试", "resume": "abc-123" }

合规说明

  • ✅ 走 Claude Code 官方 CLI / Agent SDK,符合 Anthropic 认证与订阅政策。
  • ❌ 本插件不是「把 Claude 当 DSH 的裸模型适配器」——那需要提取 Claude Code 的 OAuth token 直连 api.anthropic.com,已被 Anthropic 明令禁止、会导致封号。

开发

npm install --legacy-peer-deps
npm run build       # tsc → lib/
npm run typecheck

发布

npm login
npm publish         # publishConfig.access 已设 public

发布后建议:GitHub 建仓库并给仓库打 dsh-plugin topic,即可出现在 github.com/topics/dsh-plugin。

注意

  • 每次调用约 10 秒起步、按订阅计费(小任务实测约 0.1~0.2 美元),只适合"完整子任务"。
  • Claude Code 自己执行工具,DSH 的沙箱/权限不套在它的工具调用上——请把 cwd 与 permissionMode 收敛到信任范围。