thedotmack/claude-mem · error · Error

Every Claude CLI found is too old for claude-mem (each…

Error message

Every Claude CLI found is too old for claude-mem (each rejects flags the memory agent passes on every spawn):
${lines}
${updateInstructions()}

What it means

When no CLAUDE_CODE_PATH is configured, findClaudeExecutable scans candidate CLI locations and probes each. If every candidate it found probes as 'incompatible' (too old, rejecting required flags), it throws this aggregated error listing each path, version, and rejection detail, plus update instructions.

Solutions

  1. Update every installed CLI: `npm install -g @anthropic-ai/claude-code@latest` (repeat per package manager / version manager in use)
  2. Check the per-path versions in the error list and remove/replace the stale installs (`npm uninstall -g @anthropic-ai/claude-code`, then reinstall)
  3. If a specific new binary is fine, set CLAUDE_CODE_PATH to it so the scan is bypassed

Example fix

// before: shell
claude --version        # 0.2.x
npm ls -g @anthropic-ai/claude-code  # old

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

Strategy: validation

Validate before calling

import { execFileSync } from 'child_process';
const v = (() => { try { return execFileSync('claude', ['--version'], { encoding: 'utf8' }).trim(); } catch { return 'not runnable'; } })();
console.log(`Default claude CLI: ${v}`); // ensure current before invoking claude-mem

Type guard

null

Try / catch

try {
  await findClaudeExecutable();
} catch (e) {
  if (e.message.startsWith('Every Claude CLI found is too old')) {
    console.error('Update all installed CLIs; see the per-path list in the error');
  } else throw e;
}

Prevention

When it happens

Trigger: incompatible.length > 0 after the candidate scan: at least one CLI was found at every searched location but all failed the capability probe; none were capable and none matched earlier error branches.

Common situations: Multiple stale CLIs installed via npm/native installer across PATH locations; an old version pinned by nvm/volta per-project; CI image with an outdated claude package.

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/0c2573ceb7af90b7. Report an issue: GitHub.

Appendix: source

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

    // INFO, not DEBUG: when observations silently stop, which binary the
    // worker picked is the first question — make it answerable from default logs.
    logger.info(logComponent, `Using Claude CLI v${winner.version} at ${winner.path}`, {
      candidatesProbed: candidates.length,
      skippedTooOld: incompatible.length,
    });
    cachedResolution = {
      path: winner.path,
      version: winner.version,
      expiresAtMs: Date.now() + RESOLUTION_CACHE_TTL_MS,
    };
    return winner.path;
  }

  if (incompatible.length > 0) {
    const lines = incompatible
      .map((entry) => `  - ${entry.path} (${entry.version}) — ${entry.detail}`)
      .join('\n');
    throw new Error(
      `Every Claude CLI found is too old for claude-mem (each rejects flags the memory agent passes on every spawn):\n` +
      `${lines}\n${updateInstructions()}`
    );
  }

  throw new Error(
    'Claude executable not found. Please either:\n' +
    '1. Add "claude" to your system PATH, or\n' +
    '2. Set CLAUDE_CODE_PATH in ~/.claude-mem/settings.json'
  );
}

View on GitHub (pinned to d8bc9755e7)