{"record":{"id":"93918d518a1cfb16","repo":"thedotmack/claude-mem","slug":"found-desktop-app-at-describedpath-but-it-doesn-t-support","errorCode":null,"errorMessage":"Found desktop app at ${describedPath} 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":386,"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 ${describedPath} (${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 ${describedPath} but it doesn't support headless mode. ` +\n        `Install Claude Code CLI: npm install -g @anthropic-ai/claude-code`\n      );\n    }\n    // existsSync passed above, so the file is really there — the probe failed.\n    // Split the two ways that happens. A launch failure (ENOENT from a launcher\n    // whose shebang interpreter is missing, or a native-installer stub pointing\n    // at a deleted version directory) means the OS never ran the file; a\n    // re-check of the path cannot fix it, so name the likely cause. A process\n    // that ran but exited non-zero, timed out, or printed no version is a\n    // different problem — do not claim it \"could not be executed\".\n    if (probe.launchFailed) {\n      throw new Error(\n        `CLAUDE_CODE_PATH is set to ${describedPath} — the file exists but could not be executed (${probe.detail}). ` +\n        `A launcher script whose interpreter (shebang) is missing, or a native-installer stub pointing at a deleted version directory, fails this way. ` +\n        `Reinstall the Claude Code CLI or point CLAUDE_CODE_PATH at a working binary.`\n      );\n    }","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/shared/find-claude-executable.ts#L368-L404","documentation":"If the configured binary exists and probes, but its path looks like the Claude Desktop application bundle (looksLikeDesktopAppPath), the library throws: the desktop app cannot run headless the way the memory agents require, so it instructs the user to install the real Claude Code CLI.","triggerScenarios":"probeCandidate returns 'capable' but looksLikeDesktopAppPath(configuredPath) is true — CLAUDE_CODE_PATH points inside the Claude Desktop app bundle (e.g. .../Claude.app/Contents/MacOS/Claude or the Windows desktop executable).","commonSituations":"User picks the Desktop app binary in a file picker or guesses the path on macOS/Windows; automation scripts resolve `Claude` from /Applications instead of the CLI from npm.","solutions":["Install the headless CLI: `npm install -g @anthropic-ai/claude-code`","Point CLAUDE_CODE_PATH in ~/.claude-mem/settings.json at the CLI binary (e.g. ~/.local/bin/claude or the npm global bin), not the Desktop app bundle","Remove CLAUDE_CODE_PATH and let auto-discovery find the CLI on PATH"],"exampleFix":"// before (~/.claude-mem/settings.json)\n{ \"CLAUDE_CODE_PATH\": \"/Applications/Claude.app/Contents/MacOS/Claude\" }\n\n// after\n{ \"CLAUDE_CODE_PATH\": \"~/.local/bin/claude\" }  // after npm install -g @anthropic-ai/claude-code","handlingStrategy":"validation","validationCode":"const p = settings.CLAUDE_CODE_PATH ?? '';\nif (/(Claude\\.app|Claude\\.exe|electron)/i.test(p)) {\n  console.warn('CLAUDE_CODE_PATH points at the Desktop app; install the CLI instead: npm install -g @anthropic-ai/claude-code');\n}","typeGuard":"function isDesktopAppBundle(p: string): boolean {\n  return /Claude\\.app\\/Contents|Claude\\.exe$/i.test(p);\n}","tryCatchPattern":"try {\n  await findClaudeExecutable();\n} catch (e) {\n  if (e.message.includes(\"doesn't support headless mode\")) {\n    console.error('Install the CLI: npm install -g @anthropic-ai/claude-code');\n  } else throw e;\n}","preventionTips":["Never point CLAUDE_CODE_PATH at /Applications or Program Files Desktop app bundles","Resolve the path with `which claude`, not Spotlight/file pickers","Remember Desktop app != headless CLI; they are different binaries"],"tags":["configuration","wrong-binary","cli"],"backgroundTag":"invalid-config-value","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"}