{"record":{"id":"872e8c8f6b4fa857","repo":"slopus/happy","slug":"warning-settings-is-used-internally-by-happ","errorCode":null,"errorMessage":"⚠️  Warning: --settings is used internally by Happy for session tracking.","messagePattern":"⚠️  Warning: --settings is used internally by Happy for session tracking\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/happy-cli/src/index.ts","lineNumber":683,"sourceCode":"          const eqIndex = envArg.indexOf('=')\n          const key = envArg.substring(0, eqIndex)\n          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","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/slopus/happy/blob/b824cd0a4681d41af631a8e422a813873e4455b0/packages/happy-cli/src/index.ts#L665-L701","documentation":"happy intercepts the `--settings` flag because it uses it internally for session hooks/tracking. When a user passes --settings (normally a Claude Code flag), happy warns that the flag is consumed and not forwarded to Claude. This first line is the headline of that multi-line warning.","triggerScenarios":"Running `happy claude ... --settings <file>` (or any happy launch command that parses claude args) — the flag is matched in the arg loop and never added to claudeArgs.","commonSituations":"Users copying a Claude Code invocation containing --settings into happy, or scripts that pass Claude settings overrides expecting them to reach the Claude CLI.","solutions":["Remove --settings from the invocation; edit ~/.claude/settings.json directly instead.","If you need per-invocation Claude settings, use environment variables or a wrapper that invokes the real claude CLI outside happy.","Ignore the warning if you weren't intentionally passing --settings — behavior is otherwise unaffected."],"exampleFix":"// before\nhappy claude --settings ./my-claude-settings.json -p \"do it\"\n// after\n# move contents of my-claude-settings.json into ~/.claude/settings.json\nhappy claude -p \"do it\"","handlingStrategy":"validation","validationCode":"// before launching via happy, check args for intercepted flags\nconst intercepted = ['--settings'];\nconst bad = process.argv.filter(a => intercepted.includes(a));\nif (bad.length) console.warn(`happy intercepts ${bad.join(' ')} — it will not reach Claude.`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass Claude-specific flags through happy without checking happy's arg docs.","Configure Claude via ~/.claude/settings.json, not per-invocation flags.","Grep wrapper scripts for --settings before running them under happy.","Read the warning output fully — happy explains the supported alternative."],"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"}