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-hooks-pack

v0.1.0

Published

One-click Claude Code & Codex hooks for DeepSeek Harness: auto-discovers your existing hooks config and runs it on the harness interception points via the official bridge plugins

Readme

dsh-hooks-pack

DeepSeek Harness 的一键 Claude Code / Codex hooks 整合包。

已经有 Claude Code 或 Codex 的 hooks.json?装上这个包,那些 hooks 直接在 DSH 里生效 —— 不用写代码、不用改配置。还没有 hooks?复制自带的示例包,一分钟获得「危险命令拦截 + 全量工具调用审计日志」。

重活由官方桥插件完成(@deepseek-ai/dsh-hooks-claude-code、@deepseek-ai/dsh-hooks-codex、共享协议 @deepseek-ai/dsh-hook-protocol),本包补上手动安装缺的三块:

  1. 自动发现 —— 自动探测标准位置下的现有 hooks 配置。
  2. 一行装配 —— 单个 bundle 行把两种方言挂到宿主平面。
  3. 空闲安全 —— 任何配置都不存在时不注册任何东西;安装本身绝不改变 agent 行为。

安装

在插件市场界面搜索 dsh-hooks-pack → 安装。

或用命令行:

dsh plugin --profile web add github:REPLACE_ME/dsh-hooks-pack
# npm 发布后也可以:
dsh plugin --profile web add dsh-hooks-pack

安装后重启 profile(或刷新 Web 界面)。

会发现什么

| 方言 | 探测位置(命中即停) | |---|---| | Claude Code | $CLAUDE_CONFIG_DIR/hooks.json → ~/.claude/hooks.json → ~/.claude/settings.json(仅当含 hooks 键) | | Codex | $CODEX_HOME/hooks.json → ~/.codex/hooks.json |

显式路径优先于自动发现:

# 你 profile 的 cordis.patch.yml
- id: hooks-pack
  name: dsh-hooks-pack
  config:
    claude:
      configPath: D:/my-hooks/claude-hooks.json
    codex:
      configPath: D:/my-hooks/codex-hooks.json

支持的钩子点

经官方桥(仅 command 类型 hook):

  • Claude Code 方言:SessionStart、UserPromptSubmit、PreToolUse、PostToolUse、Stop、SubagentStart、SubagentStop
  • Codex 方言:PreToolUse、PostToolUse、SessionStart、UserPromptSubmit、Stop

deny / ask 决策、阻断反馈、additionalContext 上下文注入均可用;每个事件的 stdin 载荷与 stdout 决议格式见各桥 README。

Hook 输出格式

决策必须使用 Claude Code 的结构化格式 —— 顶层的 permissionDecision 会被忽略:

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "deny",
    "permissionDecisionReason": "blocked by policy X"
  }
}

hookEventName 必须与触发事件同名(PreToolUse、SessionStart…),否则事件级字段被丢弃。退出码 2 同样会阻断,以 stderr 作为原因。

示例包

examples/claude-hooks.example.json 自带两个开箱即用的 hook:

  • guard-dangerous(shell 工具的 PreToolUse):拦截 rm -rf、force push、Remove-Item -Recurse -Force、格式化磁盘、fork 炸弹等
  • audit-log(所有工具的 PostToolUse):把每次工具调用追加到 ~/.dsh-hooks-audit.jsonl

启用方法:

# 1. 把 examples 复制到一个稳定位置
xcopy /E /I <profile-node-modules>\dsh-hooks-pack\examples %USERPROFILE%\dsh-hooks-examples\
# 2. 复制示例配置为你的 hooks 文件
copy %USERPROFILE%\dsh-hooks-examples\claude-hooks.example.json %USERPROFILE%\.claude\hooks.json
# 3. 编辑该文件,把 <ABS-PATH> 替换为 %USERPROFILE%\dsh-hooks-examples

配置项

| 键 | 类型 | 默认 | 说明 | |---|---|---|---| | autoDiscover | boolean | true | 无显式路径时探测标准位置 | | claude.configPath | string | 自动发现 | 显式指定 Claude Code 配置文件 | | claude.pluginRoot | string | — | 替换命令中的 ${CLAUDE_PLUGIN_ROOT} | | claude.projectDir | string | 会话 cwd | 替换 ${CLAUDE_PROJECT_DIR} 并导出该环境变量 | | claude.defaultTimeoutMs | number | 600000 | hook 未设置超时时的默认值 | | codex.configPath | string | 自动发现 | 显式指定 Codex 配置文件 | | codex.model | string | — | Codex 载荷中的 model 字段 |

已知限制

继承自官方桥:仅运行 shell 型 command hook(http / mcp_tool / prompt 型会告警跳过);配置在进程加载时读取一次,暂不支持按会话发现项目级 hooks.json;部分 Claude Code 新事件未映射。完整清单见各桥 README。

兼容性

在 DeepSeek Harness 0.1.0-rc.7 + 桥包 0.1.0-rc.7 上测试通过。依赖范围同时接受 0.1.1-rc.1 以支持更新的部署。

许可

MIT