{"record":{"id":"a6dda4a6585cece6","repo":"thedotmack/claude-mem","slug":"claude-code-path-is-set-to-settings-claude-code-a6dda4","errorCode":null,"errorMessage":"CLAUDE_CODE_PATH is set to \"${settings.CLAUDE_CODE_PATH}\" but it failed the --version check (${probe.detail}). Ensure this is a working Claude Code CLI binary.","messagePattern":"CLAUDE_CODE_PATH is set to \"(.+?)\" but it failed the --version check \\((.+?)\\)\\. Ensure this is a working Claude Code CLI binary\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/find-claude-executable.ts","lineNumber":322,"sourceCode":"        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 }> = [];\n  const incompatible: Array<{ path: string; version: string; detail: string }> = [];\n\n  const candidates = discoverCandidates();\n  for (let order = 0; order < candidates.length; order++) {\n    const candidate = candidates[order];\n    const probe = probeCandidate(candidate);\n\n    if (probe.kind === 'capable') {\n      capable.push({ path: candidate, version: probe.version, key: parseVersionKey(probe.version), order });\n      continue;\n    }","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/shared/find-claude-executable.ts#L304-L340","documentation":"Thrown by findClaudeExecutable when CLAUDE_CODE_PATH exists, is neither 'capable', 'incompatible', nor a desktop-app path — the probe's --version check failed for some other reason (probe.detail holds the stderr/output). The binary is present but unrecognizable as a working Claude Code CLI.","triggerScenarios":"CLAUDE_CODE_PATH points to a file that exists but `claude --version` (the probe) failed or returned unparseable output; probe.kind is the fallback failure case.","commonSituations":"Path points to a non-executable, a shell script wrapper that errors, a broken/partial install, a binary for a different platform, or a file that exists but isn't the Claude CLI at all.","solutions":["Run `<path> --version` manually to reproduce and read probe.detail.","Ensure the file is executable and is the real Claude Code CLI binary.","Reinstall the CLI: `npm install -g @anthropic-ai/claude-code` and repoint the setting.","If unsure, remove CLAUDE_CODE_PATH to let PATH auto-discovery find a working binary."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Manually probe to get a clear failure before worker startup\nconst probe = probeCandidate(configuredPath);\nif (probe.kind !== 'capable' && probe.kind !== 'incompatible') {\n  throw new Error(`CLAUDE_CODE_PATH failed --version: ${probe.detail}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return findClaudeExecutable('SDK');\n} catch (err) {\n  if (err instanceof Error && /failed the --version check/.test(err.message)) {\n    logger.error('SDK', err.message);\n    // suggest reinstall or unset CLAUDE_CODE_PATH\n  }\n  throw err;\n}","preventionTips":["Run `<path> --version` to confirm the binary works before setting it.","Ensure the file is executable and is the genuine CLI binary.","Reinstall the CLI if the probe output is unparseable."],"tags":["config","claude-cli","path-resolution","probe-failure","settings"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}