MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / clearPluginHookCache

Function clearPluginHookCache

src/utils/plugins/loadPluginHooks.ts:159–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157})
158
159export function clearPluginHookCache(): void {
160 // Only invalidate the memoize — do NOT wipe STATE.registeredHooks here.
161 // Wiping here left plugin hooks dead between clearAllCaches() and the next
162 // loadPluginHooks() call, which for Stop hooks might never happen
163 // (gh-29767). The clear now lives inside loadPluginHooks() as an atomic
164 // clear-then-register, so old hooks stay valid until the fresh load swaps
165 // them out.
166 loadPluginHooks.cache?.clear?.()
167}
168
169/**
170 * Remove hooks from plugins no longer in the enabled set, without adding

Callers 2

clearAllPluginCachesFunction · 0.85
setupPluginHookHotReloadFunction · 0.85

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected