{"record":{"id":"5996479db8ffbe80","repo":"thedotmack/claude-mem","slug":"claude-code-path-is-set-to-settings-claude-code-599647","errorCode":null,"errorMessage":"CLAUDE_CODE_PATH is set to \"${settings.CLAUDE_CODE_PATH}\" (${probe.version}) but that CLI is too old for claude-mem — it rejects flags every memory agent spawn requires (${probe.detail}). ${updateInstructions()}","messagePattern":"CLAUDE_CODE_PATH is set to \"(.+?)\" \\((.+?)\\) but that CLI is too old for claude-mem — it rejects flags every memory agent spawn requires \\((.+?)\\)\\. (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/find-claude-executable.ts","lineNumber":311,"sourceCode":"    const configuredPath = expandTilde(settings.CLAUDE_CODE_PATH, _internals.homedir());\n    if (!_internals.existsSync(configuredPath)) {\n      throw new Error(\n        `CLAUDE_CODE_PATH is set to \"${settings.CLAUDE_CODE_PATH}\" but the file does not exist.`\n      );\n    }\n\n    const probe = probeCandidate(configuredPath);\n    if (probe.kind === 'capable') {\n      logger.info(logComponent, `Using configured CLAUDE_CODE_PATH: ${configuredPath} (${probe.version})`);\n      cachedResolution = {\n        path: configuredPath,\n        version: probe.version,\n        expiresAtMs: Date.now() + RESOLUTION_CACHE_TTL_MS,\n      };\n      return configuredPath;\n    }\n    if (probe.kind === 'incompatible') {\n      throw new Error(\n        `CLAUDE_CODE_PATH is set to \"${settings.CLAUDE_CODE_PATH}\" (${probe.version}) but that CLI is too old for claude-mem — ` +\n        `it rejects flags every memory agent spawn requires (${probe.detail}). ${updateInstructions()}`\n      );\n    }\n    if (looksLikeDesktopAppPath(configuredPath)) {\n      throw new Error(\n        `Found desktop app at \"${settings.CLAUDE_CODE_PATH}\" but it doesn't support headless mode. ` +\n        `Install Claude Code CLI: npm install -g @anthropic-ai/claude-code`\n      );\n    }\n    throw new Error(\n      `CLAUDE_CODE_PATH is set to \"${settings.CLAUDE_CODE_PATH}\" but it failed the --version check (${probe.detail}). ` +\n      `Ensure this is a working Claude Code CLI binary.`\n    );\n  }\n\n  // --- 2. Probe every discovered candidate ---------------------------------\n  const capable: Array<{ path: string; version: string; key: [number, number, number]; order: number }> = [];","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/shared/find-claude-executable.ts#L293-L329","documentation":"Thrown by findClaudeExecutable when CLAUDE_CODE_PATH points to a real binary whose probe returned 'incompatible' — the CLI version is too old and rejects flags the memory agent passes on every spawn (probe.detail names the offending flag). The message includes the detected version, the specific rejection, and update instructions. Fails loud because an old CLI breaks every spawn.","triggerScenarios":"CLAUDE_CODE_PATH resolves to a Claude Code CLI whose --version/probe shows it rejects required headless flags; probe.kind === 'incompatible'.","commonSituations":"Pinned an older @anthropic-ai/claude-code globally; CLAUDE_CODE_PATH points to a leftover older install while a newer one exists on PATH; downgrade during troubleshooting.","solutions":["Update the CLI: `npm install -g @anthropic-ai/claude-code` (or the install command in updateInstructions()).","If a newer CLI is already on PATH, remove the CLAUDE_CODE_PATH setting so auto-discovery finds it.","Re-point CLAUDE_CODE_PATH to the newer binary's absolute path.","Confirm with `claude --version` that the resolved binary meets the minimum."],"exampleFix":"// before: settings.json \"CLAUDE_CODE_PATH\": \"/opt/old/claude\" (v0.1.x)\n// after: npm install -g @anthropic-ai/claude-code && remove the setting","handlingStrategy":"validation","validationCode":"// Probe the configured CLI version before the worker depends on it\nconst p = expandTilde(settings.CLAUDE_CODE_PATH, homedir());\nconst probe = probeCandidate(p);\nif (probe.kind === 'incompatible') {\n  throw new Error(`Configured CLI too old (${probe.version}): ${probe.detail}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return findClaudeExecutable('SDK');\n} catch (err) {\n  if (err instanceof Error && /too old for claude-mem/.test(err.message)) {\n    logger.error('SDK', err.message);\n    // instruct user to npm install -g @anthropic-ai/claude-code\n  }\n  throw err;\n}","preventionTips":["Keep @anthropic-ai/claude-code updated to a version that supports required flags.","Don't pin to an old CLI in CLAUDE_CODE_PATH; let auto-discovery pick the newest.","Add a startup probe that warns when the configured CLI is below the minimum."],"tags":["config","claude-cli","version-compat","settings"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}