{"record":{"id":"0c2573ceb7af90b7","repo":"thedotmack/claude-mem","slug":"every-claude-cli-found-is-too-old-for-claude-mem","errorCode":null,"errorMessage":"Every Claude CLI found is too old for claude-mem (each rejects flags the memory agent passes on every spawn):\n${lines}\n${updateInstructions()}","messagePattern":"Every Claude CLI found is too old for claude-mem \\(each rejects flags the memory agent passes on every spawn\\):\n(.+?)\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/find-claude-executable.ts","lineNumber":467,"sourceCode":"    // INFO, not DEBUG: when observations silently stop, which binary the\n    // worker picked is the first question — make it answerable from default logs.\n    logger.info(logComponent, `Using Claude CLI v${winner.version} at ${winner.path}`, {\n      candidatesProbed: candidates.length,\n      skippedTooOld: incompatible.length,\n    });\n    cachedResolution = {\n      path: winner.path,\n      version: winner.version,\n      expiresAtMs: Date.now() + RESOLUTION_CACHE_TTL_MS,\n    };\n    return winner.path;\n  }\n\n  if (incompatible.length > 0) {\n    const lines = incompatible\n      .map((entry) => `  - ${entry.path} (${entry.version}) — ${entry.detail}`)\n      .join('\\n');\n    throw new Error(\n      `Every Claude CLI found is too old for claude-mem (each rejects flags the memory agent passes on every spawn):\\n` +\n      `${lines}\\n${updateInstructions()}`\n    );\n  }\n\n  throw new Error(\n    'Claude executable not found. Please either:\\n' +\n    '1. Add \"claude\" to your system PATH, or\\n' +\n    '2. Set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json'\n  );\n}\n","sourceCodeStart":449,"sourceCodeEnd":479,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/shared/find-claude-executable.ts#L449-L479","documentation":"When no CLAUDE_CODE_PATH is configured, findClaudeExecutable scans candidate CLI locations and probes each. If every candidate it found probes as 'incompatible' (too old, rejecting required flags), it throws this aggregated error listing each path, version, and rejection detail, plus update instructions.","triggerScenarios":"incompatible.length > 0 after the candidate scan: at least one CLI was found at every searched location but all failed the capability probe; none were capable and none matched earlier error branches.","commonSituations":"Multiple stale CLIs installed via npm/native installer across PATH locations; an old version pinned by nvm/volta per-project; CI image with an outdated claude package.","solutions":["Update every installed CLI: `npm install -g @anthropic-ai/claude-code@latest` (repeat per package manager / version manager in use)","Check the per-path versions in the error list and remove/replace the stale installs (`npm uninstall -g @anthropic-ai/claude-code`, then reinstall)","If a specific new binary is fine, set CLAUDE_CODE_PATH to it so the scan is bypassed"],"exampleFix":"// before: shell\nclaude --version        # 0.2.x\nnpm ls -g @anthropic-ai/claude-code  # old\n\n// after: shell\nnpm install -g @anthropic-ai/claude-code@latest\nclaude --version        # current","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'child_process';\nconst v = (() => { try { return execFileSync('claude', ['--version'], { encoding: 'utf8' }).trim(); } catch { return 'not runnable'; } })();\nconsole.log(`Default claude CLI: ${v}`); // ensure current before invoking claude-mem","typeGuard":"null","tryCatchPattern":"try {\n  await findClaudeExecutable();\n} catch (e) {\n  if (e.message.startsWith('Every Claude CLI found is too old')) {\n    console.error('Update all installed CLIs; see the per-path list in the error');\n  } else throw e;\n}","preventionTips":["Keep a single up-to-date CLI install; remove stale duplicates","Update CLIs on the same schedule as claude-mem","In CI, bake a current CLI into the image and verify its version at startup"],"tags":["version-compatibility","cli","path"],"backgroundTag":"missing-dependency","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}