Skip to content

1.1.0

Choose a tag to compare

@nrzz nrzz released this 28 Oct 09:32
· 3 commits to main since this release
b380abb
  • claude-hook-bench run --http runs http hooks, which were listed and checked but not run: it posts the event's JSON to each hook's url and judges the response as Claude Code does. A 2xx with an empty body is success with no output; a 2xx with a JSON object goes through the same parsing, validation and verdict as a command hook's stdout; a 2xx with any other body, a non-2xx status and a connection failure are non-blocking errors. Header values fill $VAR and ${VAR} only for the variables the hook lists in allowedEnvVars, and the hook's timeout applies.
  • It is off by default, because it opens a connection. Without --http an http hook is listed and checked, as before. src/http.mjs is the only file that may open a connection, and only to the hook's own url; the README, CONTRIBUTING.md and SECURITY.md say so where they used to say the bench makes no network request.
  • With onFailure: "block", a 2xx whose body is neither empty nor a JSON object blocks, as invalid output, which is what the hooks reference says.
  • "Not verified" says that the response rules follow the hooks reference, not a recording from the binary; that an administrator's allowedHttpHookUrls and httpHookAllowedEnvVars are not applied; and that a redirect is not followed here.
  • Contributed by @yoreva-01 in #2, for the good first issue #1. The pull request's tests ran on Windows, macOS and Linux with Node 18 to 24, and the real-binary checks against Claude Code 2.1.312 on Ubuntu and macOS, before the merge.

The next good first issue is #3: a list finding for an http hook whose header uses an environment variable that allowedEnvVars does not list, so the empty header is found before the hook runs.

See the README to set it up, and CHANGELOG.md for every version.