{"record":{"id":"c8a8645ced2e48d4","repo":"thedotmack/claude-mem","slug":"found-desktop-app-at-settings-claude-code-path","errorCode":null,"errorMessage":"Found desktop app at \"${settings.CLAUDE_CODE_PATH}\" but it doesn't support headless mode. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code","messagePattern":"Found desktop app at \"(.+?)\" but it doesn't support headless mode\\. Install Claude Code CLI: npm install -g @anthropic-ai/claude-code","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/find-claude-executable.ts","lineNumber":317,"sourceCode":"\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 }> = [];\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);","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/shared/find-claude-executable.ts#L299-L335","documentation":"The configured CLAUDE_CODE_PATH exists but looksLikeDesktopAppPath matches it (it is the Claude desktop app binary, not the CLI) and the probe was not capable — desktop app builds do not support the headless mode claude-mem spawns require. The message tells you to install the real CLI instead, since the desktop app cannot be made headless-capable.","triggerScenarios":"CLAUDE_CODE_PATH pointing into the desktop app's install directory (e.g. an app bundle or AppData path) that ships a claude-like binary; users auto-completing to the wrong binary when configuring settings.json.","commonSituations":"Claude Desktop installed alongside the CLI and the wrong path captured in settings; OS-level path suggestions offering the app binary; migrating configs between machines where only the desktop app exists.","solutions":["Install the CLI: npm install -g @anthropic-ai/claude-code.","Update CLAUDE_CODE_PATH to the CLI binary (or remove the setting so PATH discovery finds it).","Keep the desktop app if you use it — it just cannot serve as claude-mem's agent runtime."],"exampleFix":"// settings.json before\n{ \"CLAUDE_CODE_PATH\": \"/Applications/Claude.app/Contents/MacOS/Claude\" }\n\n// after\n{ \"CLAUDE_CODE_PATH\": \"~/.npm-global/bin/claude\" }","handlingStrategy":"validation","validationCode":"function looksLikeDesktopAppPath(p: string): boolean {\n  return /[Cc]laude\\.app|Claude\\.exe|AppData.{0,40}Claude/i.test(p);\n}\nif (looksLikeDesktopAppPath(settings.CLAUDE_CODE_PATH ?? '')) {\n  throw new Error('CLAUDE_CODE_PATH points at the desktop app — install the CLI instead: npm install -g @anthropic-ai/claude-code');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never configure the desktop app bundle path; headless spawns require the CLI binary.","When autocomplete offers a claude binary, verify it is the npm-installed CLI, not the app.","Keep the CLI installed even if you primarily use the desktop app — claude-mem depends on it."],"tags":["executable-resolution","desktop-app","headless-mode","setup"],"backgroundTag":"headless-mode-unsupported","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"}