thedotmack/claude-mem · error · Error

CLAUDE_CODE_PATH is set to

Error message

CLAUDE_CODE_PATH is set to ${describedPath} (${probe.version}) but that CLI is too old for claude-mem — it rejects flags every memory agent spawn requires (${probe.detail}). ${updateInstructions()}

What it means

After CLAUDE_CODE_PATH passes the existence check, findClaudeExecutable runs a version probe on the binary. If the probe classifies the CLI as 'incompatible' — it rejects flags that every claude-mem memory-agent spawn requires — the library throws with the probed version and the specific rejection detail, plus update instructions.

Solutions

  1. Update Claude Code CLI: `npm install -g @anthropic-ai/claude-code@latest` (or the native installer's update command)
  2. Check `claude --version` at the configured path and confirm it matches a current release; if not, fix CLAUDE_CODE_PATH to point at the updated binary
  3. Remove CLAUDE_CODE_PATH so auto-discovery finds the newest installed CLI instead of the pinned old one

Example fix

// before: shell
claude --version   # 0.2.x, too old for claude-mem flags

// after: shell
npm install -g @anthropic-ai/claude-code@latest
claude --version   # current, flags accepted
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'child_process';
const v = execFileSync(settings.CLAUDE_CODE_PATH, ['--version'], { encoding: 'utf8' }).trim();
console.log(`CLI at CLAUDE_CODE_PATH reports ${v}`); // compare against claude-mem's minimum

Type guard

null

Try / catch

try {
  await findClaudeExecutable();
} catch (e) {
  if (e.message.includes('too old for claude-mem')) {
    console.error('Update: npm install -g @anthropic-ai/claude-code@latest');
  } else throw e;
}

Prevention

When it happens

Trigger: probeCandidate(configuredPath) returns kind === 'incompatible' for the CLAUDE_CODE_PATH binary: the file exists and executes, prints a version, but rejects required spawn flags during the capability probe.

Common situations: Pointing CLAUDE_CODE_PATH at an old cached install, a vendored Claude CLI bundled with an older tool, or a distro package that lags behind; claude-mem upgraded to require newer CLI flags while the CLI was pinned.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/e1b7c8ce783af37f. Report an issue: GitHub.

Appendix: source

Thrown at src/shared/find-claude-executable.ts:380

    const describedPath = describeConfiguredPath(settings.CLAUDE_CODE_PATH, configuredPath);
    if (!_internals.existsSync(configuredPath)) {
      throw new Error(
        `CLAUDE_CODE_PATH is set to ${describedPath} but the file does not exist.`
      );
    }

    const probe = probeCandidate(configuredPath);
    if (probe.kind === 'capable') {
      logger.info(logComponent, `Using configured CLAUDE_CODE_PATH: ${configuredPath} (${probe.version})`);
      cachedResolution = {
        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 ${describedPath} (${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 ${describedPath} but it doesn't support headless mode. ` +
        `Install Claude Code CLI: npm install -g @anthropic-ai/claude-code`
      );
    }
    // existsSync passed above, so the file is really there — the probe failed.
    // Split the two ways that happens. A launch failure (ENOENT from a launcher
    // whose shebang interpreter is missing, or a native-installer stub pointing
    // at a deleted version directory) means the OS never ran the file; a
    // re-check of the path cannot fix it, so name the likely cause. A process
    // that ran but exited non-zero, timed out, or printed no version is a
    // different problem — do not claim it "could not be executed".
    if (probe.launchFailed) {

View on GitHub (pinned to d8bc9755e7)