{"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/e2d1df569a8f04075d40e92461128ece7cf04c82/src/shared/find-claude-executable.ts#L293-L329","documentation":"The configured CLAUDE_CODE_PATH binary exists and probes as 'incompatible': its version parses but it is too old and rejects flags that every claude-mem memory-agent spawn requires (probe.detail names the failing flags). The message includes the detected version and update instructions, because the fix is necessarily upgrading that specific binary — no fallback to other CLIs happens when an explicit path is set.","triggerScenarios":"CLAUDE_CODE_PATH pinned to an old npm-installed claude-code while claude-mem's SDK options grew new required flags; a system package (brew/apt) lagging behind; a version-pinned corporate install.","commonSituations":"claude-mem upgraded to a release needing newer CLI flags than the pinned one; users who set CLAUDE_CODE_PATH months ago and forgot; CI images caching an old CLI.","solutions":["Upgrade the binary at that exact path: npm install -g @anthropic-ai/claude-code@latest (or the package manager that owns it).","Confirm with `<path> --version` that it now meets the minimum, then re-run.","Alternatively repoint CLAUDE_CODE_PATH at a newer installed CLI, or unset it so discovery picks the best candidate."],"exampleFix":"# before\nCLAUDE_CODE_PATH=/usr/local/bin/claude  # v0.x, rejects required flags\n\n# after\nnpm install -g @anthropic-ai/claude-code@latest\n# /usr/local/bin/claude --version now reports a capable version","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'child_process';\nconst v = execFileSync(claudePath, ['--version'], { encoding: 'utf8' }).trim();\nconst [major, minor] = v.replace(/^v/, '').split('.').map(Number);\nif (major < MIN_MAJOR || (major === MIN_MAJOR && minor < MIN_MINOR)) {\n  throw new Error(`CLI ${v} at ${claudePath} is below claude-mem minimum ${MIN_MAJOR}.${MIN_MINOR}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When pinning CLAUDE_CODE_PATH, record the minimum CLI version next to the pin in docs.","Re-verify `<path> --version` after every claude-mem upgrade, since required flags can grow.","Let the auto-discovery path run occasionally to see if a newer candidate exists."],"tags":["version-compatibility","executable-resolution","cli","setup"],"backgroundTag":"cli-version-too-old","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}