thedotmack/claude-mem · error · Error
CLAUDE_CODE_PATH is set to
Error message
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. What it means
CLAUDE_CODE_PATH exists, is not classified as incompatible or a desktop app, but probeCandidate failed its --version check (probe.detail carries the spawn/parse failure: non-zero exit, unparseable output, spawn error). The binary is present yet cannot prove it is a working Claude Code CLI, so it is rejected rather than trusted.
Solutions
- Run `<configured-path> --version` in your own shell and compare — if it fails there too, the binary itself is broken.
- Point at the real binary behind any shim (resolve the wrapper) or reinstall the CLI cleanly.
- Fix permissions (chmod +x) and architecture mismatches (reinstall for your platform).
- If detail mentions spawn errors, check for missing runtime dependencies (node, dynamic libs).
Defensive patterns
Strategy: validation
Validate before calling
import { execFileSync } from 'child_process';
try {
const out = execFileSync(configuredPath, ['--version'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
if (!/\d+\.\d+/.test(out)) throw new Error(`unparseable --version output: ${out.slice(0, 80)}`);
} catch (e) {
throw new Error(`configured CLI fails --version: ${e.message} — point CLAUDE_CODE_PATH at the real binary, not a shim`);
} Prevention
- Point CLAUDE_CODE_PATH at the real binary, not nvm/brew wrapper shims that need a shell environment.
- After cross-machine config sync, re-verify the binary's architecture and exec permissions.
- If you wrap the CLI in your own script, make sure it forwards --version and all flags faithfully.
When it happens
Trigger: A shell shim or wrapper as the path (nvm-style wrappers needing shell env, Homebrew indirection shims that misbehave under direct spawn); a binary for the wrong architecture; permission denied (no execute bit); corrupted install producing garbage on --version; required dynamic libraries missing.
Common situations: CLAUDE_CODE_PATH pointing at a wrapper script that only works in an interactive shell; macOS ARM binaries on x86 or vice versa; files copied without exec permissions; partially overwritten installs during upgrade.
Related errors
- CLAUDE_CODE_PATH is set to
- CLAUDE_CODE_PATH is set to
- Could not determine Codex CLI version. Continuing; plugin…
- Found desktop app at
- claude-mem: bun --version probe failed:
AI-assisted analysis of thedotmack/claude-mem@e2d1df569a (2026-08-20).
Data as JSON: /api/errors/a6dda4a6585cece6.
Report an issue: GitHub.
Appendix: source
Thrown at src/shared/find-claude-executable.ts:322
path: configuredPath,
version: probe.version,
expiresAtMs: Date.now() + RESOLUTION_CACHE_TTL_MS,
};
return configuredPath;
}
if (probe.kind === 'incompatible') {
throw new Error(
`CLAUDE_CODE_PATH is set to "${settings.CLAUDE_CODE_PATH}" (${probe.version}) but that CLI is too old for claude-mem — ` +
`it rejects flags every memory agent spawn requires (${probe.detail}). ${updateInstructions()}`
);
}
if (looksLikeDesktopAppPath(configuredPath)) {
throw new Error(
`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`
);
}
throw new Error(
`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.`
);
}
// --- 2. Probe every discovered candidate ---------------------------------
const capable: Array<{ path: string; version: string; key: [number, number, number]; order: number }> = [];
const incompatible: Array<{ path: string; version: string; detail: string }> = [];
const candidates = discoverCandidates();
for (let order = 0; order < candidates.length; order++) {
const candidate = candidates[order];
const probe = probeCandidate(candidate);
if (probe.kind === 'capable') {
capable.push({ path: candidate, version: probe.version, key: parseVersionKey(probe.version), order });
continue;
}View on GitHub (pinned to e2d1df569a)