Skip user hooks during Claude capability probes#4466
Conversation
The periodic capability probe loads user, project, and local setting sources for slash-command discovery, which also ran the user's SessionStart hooks every few minutes. Pass disableAllHooks through the flag settings layer so probes stay quiet while command discovery keeps working. Fixes pingdotgg#3050
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved This is a targeted bug fix that prevents user hooks from running repeatedly during Claude capability probes (health checks). The change is minimal, well-documented, and includes test coverage. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Pass
settings: { disableAllHooks: true }to the periodic Claude capability probe, with regression assertions in both probe tests.Why
The probe keeps user, project, and local setting sources so slash command discovery works, but loading those sources also runs the user's SessionStart hooks every few minutes. Hooks that log or send telemetry fire on every health check and pollute their data with probe sessions. Disabling hooks through the flag settings layer keeps command discovery intact while making the probe silent.
Fixes #3050
Testing
vp test run apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.tspasses (2/2), including a new assertion on the built query options and one on the serialized--settingsflag at the SDK boundarypnpm typecheckin apps/server cleanvp linton changed files cleanChecklist
Note
Low Risk
Narrow change to probe-only SDK options with regression tests; no impact on normal Claude sessions or auth flows.
Overview
The periodic Claude capability probe now passes
settings: { disableAllHooks: true }in its SDK query options so SessionStart and other user hooks do not run on every few-minute health check.The probe still loads user, project, and local setting sources for slash-command discovery; only hook execution is turned off via the settings flag (serialized as
--settingsat the SDK boundary). Tests cover the built options object and the parsed CLI flag.Reviewed by Cursor Bugbot for commit 808ff80. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Skip user hooks during Claude capability probes by passing
disableAllHooks: trueAdds
settings: { disableAllHooks: true }to the options returned bybuildClaudeCapabilitiesProbeQueryOptionsin ClaudeProvider.ts, ensuring user-defined hooks do not run during capability detection. Tests in ClaudeCapabilitiesProbe.test.ts verify the--settingsflag is present and thatdisableAllHooksis set totrue.Macroscope summarized 808ff80.