{"record":{"id":"062f5d85f8065b6d","repo":"thedotmack/claude-mem","slug":"claude-mem-could-not-read-user-settings-path-w","errorCode":null,"errorMessage":"claude-mem: could not read ${USER_SETTINGS_PATH} while checking vector-search opt-out:","messagePattern":"claude-mem: could not read (.+?) while checking vector-search opt-out:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/npx-cli/install/setup-runtime.ts","lineNumber":44,"sourceCode":"    : 'Install Bun manually: `curl -fsSL https://bun.sh/install | bash` (or `brew install oven-sh/bun/bun`), then re-run `npx claude-mem install`.';\n}\n\nexport function platformUvRemediation(): string {\n  return IS_WINDOWS\n    ? 'Install uv manually: `winget install astral-sh.uv` (or `powershell -c \"irm https://astral.sh/uv/install.ps1 | iex\"`), then re-run `npx claude-mem install`.'\n    : 'Install uv manually: `curl -LsSf https://astral.sh/uv/install.sh | sh` (or `brew install uv`), then re-run `npx claude-mem install`.';\n}\n\nfunction userHasOptedOutOfVectorSearch(): boolean {\n  // Read the settings file directly (the value is not in the typed defaults).\n  // Honors both a top-level key and an `env`-nested key.\n  let raw: unknown;\n  try {\n    if (!existsSync(USER_SETTINGS_PATH)) return false;\n    raw = parseJsonWithBom(readFileSync(USER_SETTINGS_PATH, 'utf-8'));\n  } catch (error) {\n    const err = error instanceof Error ? error : new Error(String(error));\n    console.warn(`claude-mem: could not read ${USER_SETTINGS_PATH} while checking vector-search opt-out:`, err);\n    return false;\n  }\n  if (!raw || typeof raw !== 'object') return false;\n  const record = raw as Record<string, unknown>;\n  const envBlock = (record.env && typeof record.env === 'object')\n    ? (record.env as Record<string, unknown>)\n    : {};\n  const value = record.CLAUDE_MEM_DISABLE_VECTOR_SEARCH ?? envBlock.CLAUDE_MEM_DISABLE_VECTOR_SEARCH;\n  return value === true || value === 'true' || value === '1';\n}\n\nconst BUN_COMMON_PATHS = IS_WINDOWS\n  ? [join(homedir(), '.bun', 'bin', 'bun.exe')]\n  : [join(homedir(), '.bun', 'bin', 'bun'), '/usr/local/bin/bun', '/opt/homebrew/bin/bun', '/home/linuxbrew/.linuxbrew/bin/bun'];\n\nconst UV_COMMON_PATHS = IS_WINDOWS\n  ? [join(homedir(), '.local', 'bin', 'uv.exe'), join(homedir(), '.cargo', 'bin', 'uv.exe')]\n  : [join(homedir(), '.local', 'bin', 'uv'), join(homedir(), '.cargo', 'bin', 'uv'), '/usr/local/bin/uv', '/opt/homebrew/bin/uv'];","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/npx-cli/install/setup-runtime.ts#L26-L62","documentation":"During install's runtime setup, userHasOptedOutOfVectorSearch() reads ~/.claude/settings.json directly (BOM-tolerant parse) looking for CLAUDE_MEM_DISABLE_VECTOR_SEARCH at the top level or under env. If the read or parse throws, it warns and returns false: you are treated as NOT opted out, so the installer provisions the vector-search stack (Chroma/uv) you explicitly disabled.","triggerScenarios":"`npx claude-mem install` with a malformed or unreadable ~/.claude/settings.json (truncated, trailing comma, wrong ownership) while CLAUDE_MEM_DISABLE_VECTOR_SEARCH=true was set to skip vector search.","commonSituations":"Hand-edited settings with invalid JSON; settings.json corrupted by another tool; the opt-out flag set but the file unreadable so the opt-out is silently ignored and uv/Chroma get installed.","solutions":["Repair settings.json until a plain JSON.parse succeeds, then re-run `npx claude-mem install`","Alternatively export CLAUDE_MEM_DISABLE_VECTOR_SEARCH=true in your shell so the opt-out does not depend on the settings file","If the vector stack was already installed against your intent, run `npx claude-mem uninstall` (it preserves ~/.claude-mem data) and reinstall after fixing settings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { readFileSync } from 'node:fs';\n// Before install: settings.json must parse or your vector-search opt-out is ignored\nconst settings = `${process.env.HOME}/.claude/settings.json`;\nJSON.parse(readFileSync(settings, 'utf8'));","typeGuard":"function isErrnoException(error: unknown): error is NodeJS.ErrnoException {\n  return error instanceof Error && typeof (error as NodeJS.ErrnoException).code === 'string';\n}","tryCatchPattern":null,"preventionTips":["Keep ~/.claude/settings.json strict JSON; validate it after any tool rewrites it","Set CLAUDE_MEM_DISABLE_VECTOR_SEARCH in the shell env as a second channel the opt-out can ride on","After install, verify uv/Chroma were not provisioned when you opted out"],"tags":["install","vector-search","settings","json-parse"],"backgroundTag":"malformed-json-config","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}