thedotmack/claude-mem · error · Error

CLAUDE_CODE_PATH is set to "${settings.CLAUDE_CODE_PATH}" ($

Error message

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()}

What it means

Thrown by findClaudeExecutable when CLAUDE_CODE_PATH points to a real binary whose probe returned 'incompatible' — the CLI version is too old and rejects flags the memory agent passes on every spawn (probe.detail names the offending flag). The message includes the detected version, the specific rejection, and update instructions. Fails loud because an old CLI breaks every spawn.

Source

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

    const configuredPath = expandTilde(settings.CLAUDE_CODE_PATH, _internals.homedir());
    if (!_internals.existsSync(configuredPath)) {
      throw new Error(
        `CLAUDE_CODE_PATH is set to "${settings.CLAUDE_CODE_PATH}" 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 "${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 }> = [];

View on GitHub (pinned to d768ba3643)

Solutions

  1. Update the CLI: `npm install -g @anthropic-ai/claude-code` (or the install command in updateInstructions()).
  2. If a newer CLI is already on PATH, remove the CLAUDE_CODE_PATH setting so auto-discovery finds it.
  3. Re-point CLAUDE_CODE_PATH to the newer binary's absolute path.
  4. Confirm with `claude --version` that the resolved binary meets the minimum.

Example fix

// before: settings.json "CLAUDE_CODE_PATH": "/opt/old/claude" (v0.1.x)
// after: npm install -g @anthropic-ai/claude-code && remove the setting
Defensive patterns

Strategy: validation

Validate before calling

// Probe the configured CLI version before the worker depends on it
const p = expandTilde(settings.CLAUDE_CODE_PATH, homedir());
const probe = probeCandidate(p);
if (probe.kind === 'incompatible') {
  throw new Error(`Configured CLI too old (${probe.version}): ${probe.detail}`);
}

Try / catch

try {
  return findClaudeExecutable('SDK');
} catch (err) {
  if (err instanceof Error && /too old for claude-mem/.test(err.message)) {
    logger.error('SDK', err.message);
    // instruct user to npm install -g @anthropic-ai/claude-code
  }
  throw err;
}

Prevention

When it happens

Trigger: CLAUDE_CODE_PATH resolves to a Claude Code CLI whose --version/probe shows it rejects required headless flags; probe.kind === 'incompatible'.

Common situations: Pinned an older @anthropic-ai/claude-code globally; CLAUDE_CODE_PATH points to a leftover older install while a newer one exists on PATH; downgrade during troubleshooting.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d768ba3643 (2026-08-12). Data as JSON: /api/errors/5996479db8ffbe80. Report an issue: GitHub.