Checked 2026-11-15 (Asia/Shanghai).
Environment: macOS arm64, Go 1.26.2, Claude Code CLI 2.1.323 installed at ~/.local/bin/claude.
| Check | Observed result |
|---|---|
go test -race -count=1 ./... |
45 top-level tests and 103 subtests passed, zero failures, no race report |
go vet ./... |
Passed |
| Native build | macOS arm64 executable built with -trimpath |
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build |
Statically linked Linux x86-64 ELF built; not executed on Linux |
| Built-binary smoke checks | --version (0.2.0), demo, check, all three example handlers, custom payload, events, absent Claude CLI (exit 3) and matcher mismatch (exit 3) |
Real probe against Claude Code 2.1.323 |
UNKNOWN, exit 3, 1.16 s. See below |
This machine's shell is itself nested inside a Claude Code session, so probe first returned UNKNOWN with "Nested Claude session detected" — the documented guard, not a hook result.
The run was then repeated with the guard variable unset (env -u CLAUDECODE) from a normal shell. In that invocation:
- Claude Code 2.1.323 accepted every flag the probe passes:
--settings,--setting-sources "",--strict-mcp-config,--mcp-config,--no-session-persistence,--disable-slash-commands,--permission-mode dontAsk,--max-turns 4,--max-budget-usd 0.25,--tools Bash,--allowedTools,--output-format json,-p. - The injected
SessionStartcanary callback was observed by the private recorder. This is the first real-Claude evidence this project has: hooks supplied through a temporary settings file with--setting-sources ""do run, and the recorder's token, directory and file-permission handling work under the real CLI. - The model request was refused by the configured gateway (
API status 429,terminal_reason: api_error). No tool call was attempted, soPreToolUseallow/deny andPostToolUsecallbacks were not observed and the report stayedUNKNOWN. - Reported cost was $0.00 for the failed run.
The v0.2 cli-result check is what makes that distinction explicit. Without it the report only said "events missing", which is equally compatible with a broken hook setup and with a rate-limited account.
- PreToolUse deny enforcement and PostToolUse callbacks through a real model turn.
- Behaviour of the canary under a working model, and therefore the
allow-effect/deny-effectPASS path. - Any installed user hook in its native registration context. The canary proves HookProbe's own injected hooks ran; it says nothing about hooks already in
~/.claude/settings.jsonor plugins. - Windows execution, and Linux runtime behaviour beyond a successful static build.
- All 13 supported events have fixtures, a valid default test payload and documented exit-code-2 semantics; events outside the set stay
UNKNOWN. - Exit code 2 is interpreted per event: deny on
PreToolUse, prompt block onUserPromptSubmit, stopping blocks onStop/SubagentStop, compaction block onPreCompact, and "not acted on" onNotification/Setup. - A top-level
decisionis only honored where the event honors it;continue: falseis reported as ignored on events that discard it. hookSpecificOutputfields are scoped per event, sopermissionDecisiononPostToolUse,updatedInputonPostToolUse, oradditionalContextonPostCompactare never reported as working decisions.- Matcher rules are tested against exact values,
|/,lists, anchored and unanchored regular expressions, MCP names, and patterns the RE2 engine cannot represent. - An uncompilable matcher fails
check, is refused bytest, and can never be reported as a valid hook. - A matcher that does not select the payload produces
UNKNOWNwith the handler still executed, so handler evidence is kept while registration is not implied. - Matchers on events without matcher support are reported as ignored, matching the documented behaviour.
--payload -reads the event document from stdin; a pipe test confirms it reaches the handler unchanged.- The scripted Claude transport reports an error envelope without copying the CLI conversation, and the JSON report is checked for absent prompt/auth text.
Recorded as delivered: 29 top-level tests, go vet, macOS build, static Linux build, and 10 built-binary smoke checks. Claude Code was not installed on the machine at that time, so hookprobe probe returned UNKNOWN without starting a session. Read-only review found protocol/configuration and truncation issues; regression tests were added and the blockers were fixed before packaging. That release also stated plainly that no GitHub repository had been published from the local build.
Even a future PASS from probe covers only the disposable injected canary. Native registration of arbitrary pre-existing user hooks, installed-plugin discovery and effective managed-policy merging remain outside scope. Command hooks run as the current user: test is not a sandbox, and probe is not an OS sandbox either.