{"record":{"id":"69a59483d65d9ea9","repo":"thedotmack/claude-mem","slug":"skipping-candidate-failed-version-check","errorCode":null,"errorMessage":"Skipping \"${candidate}\" — failed --version check (${probe.detail})","messagePattern":"Skipping \"(.+?)\" — failed --version check \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/shared/find-claude-executable.ts","lineNumber":358,"sourceCode":"    }\n\n    if (probe.kind === 'incompatible') {\n      incompatible.push({ path: candidate, version: probe.version, detail: probe.detail });\n      logger.warn(\n        logComponent,\n        `Skipping \"${candidate}\" (${probe.version}) — too old for claude-mem: ${probe.detail}`\n      );\n      continue;\n    }\n\n    if (looksLikeDesktopAppPath(candidate)) {\n      logger.warn(\n        logComponent,\n        `Skipping desktop app at \"${candidate}\" — it doesn't support headless mode. ` +\n        `Install Claude Code CLI: npm install -g @anthropic-ai/claude-code`\n      );\n    } else {\n      logger.warn(logComponent, `Skipping \"${candidate}\" — failed --version check (${probe.detail})`);\n    }\n  }\n\n  if (capable.length > 0) {\n    capable.sort((a, b) => compareVersionKeysDesc(a.key, b.key) || a.order - b.order);\n    const winner = capable[0];\n    // INFO, not DEBUG: when observations silently stop, which binary the\n    // worker picked is the first question — make it answerable from default logs.\n    logger.info(logComponent, `Using Claude CLI v${winner.version} at ${winner.path}`, {\n      candidatesProbed: candidates.length,\n      skippedTooOld: incompatible.length,\n    });\n    cachedResolution = {\n      path: winner.path,\n      version: winner.version,\n      expiresAtMs: Date.now() + RESOLUTION_CACHE_TTL_MS,\n    };\n    return winner.path;","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/shared/find-claude-executable.ts#L340-L376","documentation":"The candidate's --version probe failed outright (probe.detail carries why: non-zero exit, timeout, or unparseable output) and the path does not look like the desktop app, so it is skipped with this warning. Discovery keeps going; if no candidate proves capable, executable resolution fails downstream.","triggerScenarios":"probeCandidate returns a failed probe for an ordinary path: broken shim, wrapper script that errors on --version, permission denied, corrupted binary, or dangling symlink.","commonSituations":"Half-completed npm installs after an interrupted upgrade; custom claude wrapper scripts that swallow --version; broken symlinks left after switching Node versions.","solutions":["Run `<candidate> --version` manually in a shell and fix whatever error it prints.","If the binary is corrupt, reinstall: npm install -g @anthropic-ai/claude-code.","Prune dead shims found by `which -a claude` and `ls -l` on each hit."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const probe = probeCandidate(candidate);\nif (probe.kind === 'error') {\n  // binary fails --version — exclude it from consideration up front\n  continue;\n}","typeGuard":"const isFailedProbe = (p: ProbeResult): boolean => p.kind !== 'capable' && p.kind !== 'incompatible';","tryCatchPattern":null,"preventionTips":["Smoke-test each claude binary on the machine with `--version` after install or Node switches.","Avoid wrapper scripts around claude that don't pass through --version.","Reinstall cleanly (npm install -g @anthropic-ai/claude-code) rather than patching broken shims."],"tags":["cli-discovery","version-probe","broken-install","claude-mem"],"backgroundTag":"version-check-failed","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}