{"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":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/find-claude-executable.ts","lineNumber":473,"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":455,"sourceCodeEnd":479,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/shared/find-claude-executable.ts#L455-L479","documentation":"The terminal failure of findClaudeExecutable: no candidate Claude CLI was found at all (nothing on PATH, no known install locations, no usable CLAUDE_CODE_PATH). It tells the user the two ways to make the CLI discoverable: add `claude` to PATH or set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json.","triggerScenarios":"Candidate scan yields no existing binaries (or all candidates failed earlier branches), CLAUDE_CODE_PATH is unset/empty, and existsSync fails for every known install path.","commonSituations":"Fresh machine where Claude Code CLI was never installed; CLI installed via a method the scanner doesn't cover; running inside a container/CI without the CLI; PATH stripped under systemd/cron so `claude` isn't visible.","solutions":["Install the CLI: `npm install -g @anthropic-ai/claude-code`","Verify `claude --version` resolves in the same shell/environment claude-mem runs in (check PATH there); if not, add the install bin dir to PATH","Alternatively set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json to the absolute path of a working claude binary"],"exampleFix":"// before: shell\nwhich claude   # not found\n\n// after: shell\nnpm install -g @anthropic-ai/claude-code\nwhich claude   # /usr/local/bin/claude","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'child_process';\nlet onPath = false;\ntry { execFileSync('claude', ['--version'], { stdio: 'ignore' }); onPath = true; } catch {}\nif (!onPath) console.warn('claude CLI not found; install with: npm install -g @anthropic-ai/claude-code');","typeGuard":"null","tryCatchPattern":"try {\n  await findClaudeExecutable();\n} catch (e) {\n  if (e.message.startsWith('Claude executable not found')) {\n    console.error('Install the CLI or set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json');\n  } else throw e;\n}","preventionTips":["Install the CLI before installing claude-mem","In systemd/cron/CI, set PATH explicitly so npm global bins are visible","Or set CLAUDE_CODE_PATH to an absolute path, immune to PATH differences"],"tags":["cli","path","installation"],"backgroundTag":"command-not-found","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"}