MCPcopy
hub / github.com/codeaashu/claude-code / shouldAllowManagedHooksOnly

Function shouldAllowManagedHooksOnly

src/utils/hooks/hooksConfigSnapshot.ts:62–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60 * cannot disable managed hooks, so they effectively become managed-only)
61 */
62export function shouldAllowManagedHooksOnly(): boolean {
63 const policySettings = settingsModule.getSettingsForSource('policySettings')
64 if (policySettings?.allowManagedHooksOnly === true) {
65 return true
66 }
67 // If disableAllHooks is set but NOT from managed settings,
68 // treat as managed-only (non-managed hooks disabled, managed hooks still run)
69 if (
70 settingsModule.getSettings_DEPRECATED().disableAllHooks === true &&
71 policySettings?.disableAllHooks !== true
72 ) {
73 return true
74 }
75 return false
76}
77
78/**
79 * Check if all hooks (including managed) should be disabled.

Callers 7

getHooksConfigFunction · 0.85
executeHooksFunction · 0.85
executeStatusLineCommandFunction · 0.85
hasWorktreeCreateHookFunction · 0.85
processSessionStartHooksFunction · 0.85
processSetupHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected