{"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/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/shared/find-claude-executable.ts#L299-L335","documentation":"Thrown by findClaudeExecutable when CLAUDE_CODE_PATH exists, is not 'capable' or 'incompatible', and looksLikeDesktopAppPath() returns true — i.e., the path is the Claude desktop app which cannot run in headless mode. The message directs installing the CLI instead.","triggerScenarios":"CLAUDE_CODE_PATH (or the failed probe) points at the Claude desktop application bundle/binary (looksLikeDesktopAppPath matches) which doesn't support the headless flags the SDK needs.","commonSituations":"User pointed CLAUDE_CODE_PATH at '/Applications/Claude.app/...' (macOS) or a Windows desktop app path instead of the CLI; auto-discovery would normally skip these but an explicit setting overrides.","solutions":["Install the CLI: `npm install -g @anthropic-ai/claude-code`.","Remove CLAUDE_CODE_PATH from settings so the desktop app path is no longer used.","Point CLAUDE_CODE_PATH to the CLI binary (e.g., output of `which claude`), not the .app bundle."],"exampleFix":"// before: settings.json \"CLAUDE_CODE_PATH\": \"/Applications/Claude.app/Contents/MacOS/claude\"\n// after: npm install -g @anthropic-ai/claude-code; remove the setting","handlingStrategy":"validation","validationCode":"if (looksLikeDesktopAppPath(configuredPath)) {\n  throw new Error('CLAUDE_CODE_PATH points to the desktop app — install the CLI instead');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return findClaudeExecutable('SDK');\n} catch (err) {\n  if (err instanceof Error && /desktop app/.test(err.message)) {\n    logger.error('SDK', err.message);\n  }\n  throw err;\n}","preventionTips":["Never point CLAUDE_CODE_PATH at the Claude desktop .app bundle.","Install the CLI via npm and prefer `which claude` output for the setting.","If unsure, unset CLAUDE_CODE_PATH to use PATH discovery."],"tags":["config","claude-cli","desktop-app","headless","settings"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}