{"record":{"id":"a33ee14ba5a93c99","repo":"slopus/happy","slug":"to-configure-claude-edit-claude-settings-js","errorCode":null,"errorMessage":"   To configure Claude, edit ~/.claude/settings.json instead.","messagePattern":"   To configure Claude, edit ~/\\.claude/settings\\.json instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/happy-cli/src/index.ts","lineNumber":685,"sourceCode":"          const value = envArg.substring(eqIndex + 1)\n          options.claudeEnvVars = options.claudeEnvVars || {}\n          options.claudeEnvVars[key] = value\n        } else {\n          console.error(chalk.red(`Invalid --claude-env format: ${envArg}. Expected KEY=VALUE`))\n          process.exit(1)\n        }\n      } else if (arg === '--chrome') {\n        chromeOverride = true\n        // We'll add --chrome to claudeArgs after resolving settings default\n      } else if (arg === '--no-chrome') {\n        chromeOverride = false\n        // Happy-specific flag to disable chrome even if default is on\n      } else if (arg === '--settings') {\n        // Intercept --settings flag - Happy uses this internally for session hooks\n        const settingsValue = args[++i] // consume the value\n        console.warn(chalk.yellow(`⚠️  Warning: --settings is used internally by Happy for session tracking.`))\n        console.warn(chalk.yellow(`   Your settings file \"${settingsValue}\" will be ignored.`))\n        console.warn(chalk.yellow(`   To configure Claude, edit ~/.claude/settings.json instead.`))\n        // Don't pass through to claudeArgs\n      } else {\n        // Pass unknown arguments through to claude\n        unknownArgs.push(arg)\n        // Check if this arg expects a value (simplified check for common patterns)\n        if (i + 1 < args.length && !args[i + 1].startsWith('-')) {\n          unknownArgs.push(args[++i])\n        }\n      }\n    }\n\n    // Add unknown args to claudeArgs\n    if (unknownArgs.length > 0) {\n      options.claudeArgs = [...(options.claudeArgs || []), ...unknownArgs]\n    }\n\n    // Resolve Chrome mode: explicit flag > settings > false\n    const settings = await readSettings()","sourceCodeStart":667,"sourceCodeEnd":703,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/index.ts#L667-L703","documentation":"Third line of the --settings interception warning, directing the user to configure Claude by editing ~/.claude/settings.json — the supported location — since happy discards per-invocation --settings values.","triggerScenarios":"Any `happy claude ... --settings <value>` invocation, as the trailing line of the three-line warning block.","commonSituations":"Teams sharing Claude settings per-project who try to point happy at a project settings file; happy only honors the global ~/.claude/settings.json.","solutions":["Edit ~/.claude/settings.json to apply the desired Claude configuration globally.","Remove --settings from the happy invocation.","If project-scoped Claude settings are needed, run the raw claude CLI for that case or use Claude Code's supported project settings mechanism."],"exampleFix":"// before\nhappy claude --settings ./project-settings.json\n// after\n# copy desired keys into ~/.claude/settings.json\nhappy claude","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst p = require('os').homedir() + '/.claude/settings.json';\nif (!fs.existsSync(p)) console.warn('~/.claude/settings.json does not exist — create it instead of using happy --settings.');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep all Claude configuration in ~/.claude/settings.json.","Create the file with `mkdir -p ~/.claude && echo '{}' > ~/.claude/settings.json` if missing.","Strip --settings from wrapper scripts that call happy.","Use Claude Code's native project settings for per-project config, not happy flags."],"tags":["cli-args","settings","claude","flag-intercepted"],"backgroundTag":"unsupported-flag-ignored","analyzedSha":"b824cd0a4681d41af631a8e422a813873e4455b0","analyzedAt":"2026-08-31T23:12:36.205Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}