thedotmack/claude-mem · error

Unknown Claude model: ${options.model}. Allowed: ${[...allow

Error message

Unknown Claude model: ${options.model}. Allowed: ${[...allowed].join(', ')}

What it means

Thrown by promptClaudeModel() in the installer when the user passes --model with a value that is not in the hardcoded allowed set (claude-haiku-4-5-20251001, claude-sonnet-5, claude-opus-4-8) AND the resolved auth method is not 'gateway'. Gateway auth is the only mode that permits arbitrary custom model identifiers; subscription and api-key modes are restricted to the curated allowlist because they target Anthropic's first-party model IDs.

Source

Thrown at src/npx-cli/commands/install.ts:1293

    [keyEnvName]: apiKey,
  });
  if (wrote) {
    log.info(`Saved provider=${selectedProvider} to ~/.claude-mem/settings.json`);
  }
  return selectedProvider;
}

async function promptClaudeModel(options: InstallOptions): Promise<void> {
  const allowed = new Set([
    'claude-haiku-4-5-20251001',
    'claude-sonnet-5',
    'claude-opus-4-8',
  ]);
  const allowCustomModel = resolveClaudeAuthMethod() === 'gateway';

  if (options.model && !allowCustomModel) {
    if (!allowed.has(options.model)) {
      throw new Error(
        `Unknown Claude model: ${options.model}. Allowed: ${[...allowed].join(', ')}`,
      );
    }
    const wrote = mergeSettings({ CLAUDE_MEM_MODEL: options.model });
    if (wrote) {
      log.info(`Saved Claude model=${options.model} to ~/.claude-mem/settings.json`);
    }
    return;
  }
  if (options.model && allowCustomModel) {
    const wrote = mergeSettings({ CLAUDE_MEM_MODEL: options.model });
    if (wrote) {
      log.info(`Saved gateway model=${options.model} to ~/.claude-mem/settings.json`);
    }
    return;
  }

  if (!isInteractive) return;

View on GitHub (pinned to d768ba3643)

Solutions

  1. Use one of the allowed model ids listed in the error message.
  2. If you need a custom model id, configure gateway auth (CLAUDE_MEM_AUTH_METHOD=gateway or equivalent) so allowCustomModel is true and the id is accepted.
  3. Update claude-mem so the allowlist includes the new model id, if it is a legitimate first-party model.

Example fix

// before — non-allowlisted model on subscription auth
claude-mem install --model claude-3-5-sonnet
// after — use an allowlisted id
claude-mem install --model claude-sonnet-5
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED = new Set(['claude-haiku-4-5-20251001','claude-sonnet-5','claude-opus-4-8']);
if (options.model && resolveClaudeAuthMethod() !== 'gateway' && !ALLOWED.has(options.model)) {
  throw new Error(`Model must be one of: ${[...ALLOWED].join(', ')}`);
}

Type guard

function isAllowedModel(m: string): boolean {
  return new Set(['claude-haiku-4-5-20251001','claude-sonnet-5','claude-opus-4-8']).has(m);
}

Prevention

When it happens

Trigger: Running `claude-mem install --model claude-3-5-sonnet` (a deprecated/non-allowlisted id) while CLAUDE_MEM_AUTH_METHOD resolves to 'subscription' or 'api-key'. Passing a model alias the allowlist doesn't contain. Typo in the model id. Passing a future model id before the allowlist is updated.

Common situations: User copies an old model id from docs. User wants a model not yet in the allowlist but isn't on gateway auth. CI invoking install with a pinned --model that has since been renamed in the allowlist.

Related errors


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