{"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":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":193,"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":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L175-L211","documentation":"In non-interactive or --json mode, validateExecutionMode() refuses to invent defaults for Claude. Because there is no prompt to ask about scope (user/project) or hooks mode, both --claude-scope and --claude-hooks must be supplied explicitly whenever 'claude' is among the selected harnesses. Omitting either aborts the run.","triggerScenarios":"Non-interactive run or run with --json where options.harnesses includes 'claude' but options.claudeScope or options.claudeHooks is falsy (flag absent).","commonSituations":"CI installs selecting claude with only --harness claude --yes; scripts migrated from interactive usage that never needed the flags before; JSON-mode automation adding claude to the harness list without updating flags.","solutions":["Add both --claude-scope <user|project> and --claude-hooks <value> to the command.","If claude is not actually wanted, remove --harness claude from the list.","In wrapper scripts, derive and pass the two flags whenever claude is selected."],"exampleFix":"// before\nnode scripts/install-guided.js --harness claude --yes\n// after\nnode scripts/install-guided.js --harness claude --claude-scope project --claude-hooks standard --yes","handlingStrategy":"validation","validationCode":"if (harnesses.includes('claude') && (!claudeScope || !claudeHooks)) { throw new Error('claude needs --claude-scope and --claude-hooks'); }","typeGuard":null,"tryCatchPattern":"try { main(); } catch (e) { if (/Claude requires explicit/.test(e.message)) { console.error('Supply --claude-scope <scope> --claude-hooks <mode>'); process.exit(2); } throw e; }","preventionTips":["Whenever the harness list contains claude, always emit both --claude-scope and --claude-hooks.","Centralize the non-interactive flag template in one wrapper script so flags are never dropped.","Test non-interactive invocations in CI before merging changes."],"tags":["cli","non-interactive","missing-argument"],"backgroundTag":"missing-required-option","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}