{"record":{"id":"9c7acb9c34f6af53","repo":"affaan-m/ECC","slug":"claude-requires-explicit-claude-scope-and-clau","errorCode":null,"errorMessage":"Claude requires explicit --claude-scope and --claude-hooks choices in this mode.","messagePattern":"Claude requires explicit --claude-scope and --claude-hooks choices in this mode\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":192,"sourceCode":"    claudeHooks,\n    profile,\n  };\n}\n\nfunction selectedHarnessIds(options) {\n  if (options.allHarnesses) return normalizeHarnessSelection(['all']);\n  if (options.harnesses.length === 0) return [];\n  return normalizeHarnessSelection(options.harnesses);\n}\n\nfunction validateExecutionMode(options, interactive) {\n  const harnesses = selectedHarnessIds(options);\n  if (!interactive && harnesses.length === 0) {\n    throw new Error('Non-interactive guided install requires at least one --harness.');\n  }\n  const requiresExplicit = !interactive || options.json;\n  if (requiresExplicit && harnesses.includes('claude') && (!options.claudeScope || !options.claudeHooks)) {\n    throw new Error('Claude requires explicit --claude-scope and --claude-hooks choices in this mode.');\n  }\n  if (requiresExplicit && harnesses.includes('kimi') && !options.profile) {\n    throw new Error('Kimi requires an explicit --profile choice in this mode.');\n  }\n  if ((!interactive || options.json) && !options.yes && !options.dryRun) {\n    throw new Error('Non-interactive and JSON mutations require --yes.');\n  }\n}\n\nfunction printPlan(plan, output) {\n  output.write('\\nECC guided install preview\\n\\n');\n  output.write('Harness       Channel           Destination\\n');\n  for (const entry of plan.harnesses) {\n    const harness = getHarnessCapability(entry.id);\n    output.write(`${harness.label.padEnd(13)} ${entry.channel.padEnd(17)} ${harness.destination}\\n`);\n  }\n  if (plan.request.harnesses.includes('kimi')) {\n    output.write('\\nKimi note: ECC hooks are not configured; model, provider, and authentication settings are unchanged.\\n');","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/install-guided.js#L174-L210","documentation":"In non-interactive mode (or any --json run), install-guided.js cannot prompt for the two Claude-specific choices, so selecting the claude harness requires explicit --claude-scope AND --claude-hooks on the command line. Missing either one throws.","triggerScenarios":"Running --harness claude --yes in CI without --claude-scope/--claude-hooks, or adding --json to a partially-specified Claude install.","commonSituations":"Forgetting that Claude needs two extra answers that other harnesses do not, or assuming the interactive defaults apply in non-interactive mode.","solutions":["Add --claude-scope <user|project> and --claude-hooks <standard|strict|off> to the command","Use --dry-run to preview the plan without requiring --claude-scope/--claude-hooks (dry-run is exempt from the --yes requirement but still needs the Claude choices)","Drop claude from --harness if you do not want to configure it"],"exampleFix":"// before\nnode scripts/install-guided.js --harness claude --yes\n// after\nnode scripts/install-guided.js --harness claude --claude-scope user --claude-hooks standard --yes","handlingStrategy":"validation","validationCode":"const interactive = process.stdin.isTTY === true;\nconst explicitMode = !interactive || argv.includes('--json');\nconst hasClaude = argv.includes('--harness'); // verify value separately\nconst needsClaudeExtras = explicitMode && selectsClaude(argv);\nif (needsClaudeExtras && (!argv.includes('--claude-scope') || !argv.includes('--claude-hooks'))) {\n  throw new Error('Claude needs --claude-scope and --claude-hooks in this mode');\n}","typeGuard":"function hasClaudeExtras(argv) {\n  return argv.includes('--claude-scope') && argv.includes('--claude-hooks');\n}","tryCatchPattern":"try { validateExecutionMode(options, interactive); }\ncatch (err) {\n  if (/Claude requires explicit/.test(err.message)) {\n    console.error(`${err.message} Add --claude-scope and --claude-hooks.`);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Treat Claude as needing two extra answers in any non-interactive run","Keep a canonical fully-specified Claude command in your runbook","Use --dry-run first to surface all missing-choice errors"],"tags":["cli","non-interactive","install-guided","claude"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}