slopus/happy · warning

To configure Claude, edit ~/.claude/settings.json instead

Error message

   To configure Claude, edit ~/.claude/settings.json instead.

What it means

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.

Source

Thrown at packages/happy-cli/src/index.ts:685

          const value = envArg.substring(eqIndex + 1)
          options.claudeEnvVars = options.claudeEnvVars || {}
          options.claudeEnvVars[key] = value
        } else {
          console.error(chalk.red(`Invalid --claude-env format: ${envArg}. Expected KEY=VALUE`))
          process.exit(1)
        }
      } else if (arg === '--chrome') {
        chromeOverride = true
        // We'll add --chrome to claudeArgs after resolving settings default
      } else if (arg === '--no-chrome') {
        chromeOverride = false
        // Happy-specific flag to disable chrome even if default is on
      } else if (arg === '--settings') {
        // Intercept --settings flag - Happy uses this internally for session hooks
        const settingsValue = args[++i] // consume the value
        console.warn(chalk.yellow(`⚠️  Warning: --settings is used internally by Happy for session tracking.`))
        console.warn(chalk.yellow(`   Your settings file "${settingsValue}" will be ignored.`))
        console.warn(chalk.yellow(`   To configure Claude, edit ~/.claude/settings.json instead.`))
        // Don't pass through to claudeArgs
      } else {
        // Pass unknown arguments through to claude
        unknownArgs.push(arg)
        // Check if this arg expects a value (simplified check for common patterns)
        if (i + 1 < args.length && !args[i + 1].startsWith('-')) {
          unknownArgs.push(args[++i])
        }
      }
    }

    // Add unknown args to claudeArgs
    if (unknownArgs.length > 0) {
      options.claudeArgs = [...(options.claudeArgs || []), ...unknownArgs]
    }

    // Resolve Chrome mode: explicit flag > settings > false
    const settings = await readSettings()

View on GitHub (pinned to b824cd0a46)

Solutions

  1. Edit ~/.claude/settings.json to apply the desired Claude configuration globally.
  2. Remove --settings from the happy invocation.
  3. If project-scoped Claude settings are needed, run the raw claude CLI for that case or use Claude Code's supported project settings mechanism.

Example fix

// before
happy claude --settings ./project-settings.json
// after
# copy desired keys into ~/.claude/settings.json
happy claude
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
const p = require('os').homedir() + '/.claude/settings.json';
if (!fs.existsSync(p)) console.warn('~/.claude/settings.json does not exist — create it instead of using happy --settings.');

Prevention

When it happens

Trigger: Any `happy claude ... --settings <value>` invocation, as the trailing line of the three-line warning block.

Common situations: Teams sharing Claude settings per-project who try to point happy at a project settings file; happy only honors the global ~/.claude/settings.json.

Related errors


AI-assisted analysis of slopus/happy@b824cd0a46 (2026-08-31). Data as JSON: /api/errors/a33ee14ba5a93c99. Report an issue: GitHub.