{"record":{"id":"f24276ed9b47b859","repo":"thedotmack/claude-mem","slug":"claude-executable-not-found-please-either-1-add","errorCode":null,"errorMessage":"Claude executable not found. Please either:\n1. Add \"claude\" to your system PATH, or\n2. Set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json","messagePattern":"Claude executable not found\\. Please either:\n1\\. Add \"claude\" to your system PATH, or\n2\\. Set CLAUDE_CODE_PATH in ~/\\.claude-mem/settings\\.json","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/shared/find-claude-executable.ts","lineNumber":389,"sourceCode":"    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":371,"sourceCodeEnd":395,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/shared/find-claude-executable.ts#L371-L395","documentation":"Thrown by findClaudeExecutable when no Claude CLI was found at all: no CLAUDE_CODE_PATH set and discoverCandidates() returned an empty list (or all were skipped, leaving no incompatible entries either). This is the total absence case — neither capable nor incompatible candidates exist.","triggerScenarios":"No `claude` on PATH and CLAUDE_CODE_PATH unset; discoverCandidates() yields nothing on any known install location.","commonSituations":"Fresh machine without Claude Code installed; PATH not exposing the install; Claude installed under a non-standard location not searched by discoverCandidates.","solutions":["Install the CLI: `npm install -g @anthropic-ai/claude-code`.","Ensure the install directory is on PATH (`echo $PATH`, `which claude`).","If installed in a custom location, set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json to its absolute path."],"exampleFix":"// before: claude not installed / not on PATH\n// after\nnpm install -g @anthropic-ai/claude-code\n# or set in ~/.claude-mem/settings.json: \"CLAUDE_CODE_PATH\": \"/usr/local/bin/claude\"","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs';\nfunction claudeAvailable(): boolean {\n  try { return existsSync(require('child_process').execSync('which claude', { encoding: 'utf8' }).trim()); }\n  catch { return false; }\n}\nif (!claudeAvailable() && !settings.CLAUDE_CODE_PATH) {\n  throw new Error('Claude CLI not installed — run npm install -g @anthropic-ai/claude-code');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return findClaudeExecutable('SDK');\n} catch (err) {\n  if (err instanceof Error && /Claude executable not found/.test(err.message)) {\n    logger.error('SDK', err.message);\n    // halt startup with install guidance\n  }\n  throw err;\n}","preventionTips":["Install @anthropic-ai/claude-code as a prerequisite in setup scripts.","Ensure the install dir is on PATH in all environments (CI, shells, services).","Document CLAUDE_CODE_PATH as the escape hatch for custom locations."],"tags":["claude-cli","environment","path-resolution","missing-dependency"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}