{"record":{"id":"5f8e826e1ecc2008","repo":"affaan-m/ECC","slug":"invalid-claude-hooks-preference-claudehooks","errorCode":null,"errorMessage":"Invalid Claude hooks preference: ${claudeHooks}","messagePattern":"Invalid Claude hooks preference: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/multi-harness-setup.js","lineNumber":42,"sourceCode":"  }\n\n  const includesClaude = harnesses.includes('claude');\n  const includesKimi = harnesses.includes('kimi');\n  if (!includesClaude && (input.claudeScope !== undefined || input.claudeHooks !== undefined)) {\n    throw new Error('Claude scope and hook options require Claude to be selected.');\n  }\n  if (!includesKimi && input.profile !== undefined) {\n    throw new Error('The managed install profile requires Kimi to be selected.');\n  }\n\n  const claudeScope = includesClaude ? (input.claudeScope || 'user') : undefined;\n  const claudeHooks = includesClaude ? (input.claudeHooks || 'standard') : undefined;\n  const profile = includesKimi ? (input.profile || 'core') : undefined;\n  if (claudeScope && !VALID_CLAUDE_SCOPES.has(claudeScope)) {\n    throw new Error(`Invalid Claude scope: ${claudeScope}`);\n  }\n  if (claudeHooks && !VALID_CLAUDE_HOOKS.has(claudeHooks)) {\n    throw new Error(`Invalid Claude hooks preference: ${claudeHooks}`);\n  }\n  if (profile && !VALID_PROFILES.has(profile)) {\n    throw new Error(`Invalid Kimi install profile: ${profile}`);\n  }\n\n  return {\n    harnesses,\n    ...(claudeHooks ? { claudeHooks } : {}),\n    ...(claudeScope ? { claudeScope } : {}),\n    dryRun: Boolean(input.dryRun),\n    json: Boolean(input.json),\n    ...(profile ? { profile } : {}),\n    yes: Boolean(input.yes),\n  };\n}\n\nfunction canonicalPath(filePath) {\n  return realpathNearestExisting(filePath);","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/multi-harness-setup.js#L24-L60","documentation":"When Claude is selected, claudeHooks must be one of off, minimal, standard, or strict (VALID_CLAUDE_HOOKS). These pick which bundled hook profile gets installed alongside the plugin. Any other value is rejected to prevent installing an unknown hook set. The check only fires when Claude is selected; otherwise claudeHooks is undefined.","triggerScenarios":"Calling normalizeGuidedInstallRequest with harnesses including 'claude' and a claudeHooks value outside {off, minimal, standard, strict}. Examples: 'none', 'all', 'default', 'aggressive', an empty string.","commonSituations":"Typing the hook level; assuming 'none' is valid (it is 'off'); passing 'default' (it is 'standard'); stale naming from a prior version; a UI dropdown listing the wrong values; copy-paste from docs that used a different term.","solutions":["Use one of the four valid values: 'off' (no hooks), 'minimal', 'standard' (default), or 'strict'.","Omit claudeHooks to accept the default ('standard').","Check for the common synonyms that are NOT accepted: 'none' -> 'off', 'default' -> 'standard', 'all'/'max' -> 'strict'.","Verify spelling and case — values are matched exactly against the lowercase set."],"exampleFix":"// before\nnormalizeGuidedInstallRequest({ harnesses: ['claude'], claudeHooks: 'none' }); // throws\n// after\nnormalizeGuidedInstallRequest({ harnesses: ['claude'], claudeHooks: 'off' });\n// or omit for the default\nnormalizeGuidedInstallRequest({ harnesses: ['claude'] }); // claudeHooks = 'standard'","handlingStrategy":"validation","validationCode":"const { VALID_CLAUDE_HOOKS } = require('./scripts/lib/multi-harness-setup');\nfunction assertClaudeHooks(value) {\n  if (value !== undefined && !VALID_CLAUDE_HOOKS.has(value)) {\n    throw new Error(`Invalid Claude hooks preference: ${value}`);\n  }\n  return value;\n}","typeGuard":"function isValidClaudeHooks(v) {\n  return v === undefined || new Set(['off','minimal','standard','strict']).has(v);\n}","tryCatchPattern":"try { normalizeGuidedInstallRequest(input); }\ncatch (error) {\n  if (/Invalid Claude hooks preference/i.test(error.message)) {\n    console.error('claudeHooks must be one of: off, minimal, standard, strict.');\n    return;\n  }\n  throw error;\n}","preventionTips":["Use only off, minimal, standard, or strict for claudeHooks.","Omit claudeHooks to accept the default ('standard').","Remember the synonyms: 'none' -> 'off', 'default' -> 'standard', 'max' -> 'strict'.","Drive dropdowns from VALID_CLAUDE_HOOKS."],"tags":["multi-harness-setup","validation","configuration","installer","claude","hooks"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}