{"record":{"id":"512f6c95c5e6ba93","repo":"thedotmack/claude-mem","slug":"unknown-claude-model-options-model-allowed","errorCode":null,"errorMessage":"Unknown Claude model: ${options.model}. Allowed: ${[...allowed].join(', ')}","messagePattern":"Unknown Claude model: (.+?)\\. Allowed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/npx-cli/commands/install.ts","lineNumber":1293,"sourceCode":"    [keyEnvName]: apiKey,\n  });\n  if (wrote) {\n    log.info(`Saved provider=${selectedProvider} to ~/.claude-mem/settings.json`);\n  }\n  return selectedProvider;\n}\n\nasync function promptClaudeModel(options: InstallOptions): Promise<void> {\n  const allowed = new Set([\n    'claude-haiku-4-5-20251001',\n    'claude-sonnet-5',\n    'claude-opus-4-8',\n  ]);\n  const allowCustomModel = resolveClaudeAuthMethod() === 'gateway';\n\n  if (options.model && !allowCustomModel) {\n    if (!allowed.has(options.model)) {\n      throw new Error(\n        `Unknown Claude model: ${options.model}. Allowed: ${[...allowed].join(', ')}`,\n      );\n    }\n    const wrote = mergeSettings({ CLAUDE_MEM_MODEL: options.model });\n    if (wrote) {\n      log.info(`Saved Claude model=${options.model} to ~/.claude-mem/settings.json`);\n    }\n    return;\n  }\n  if (options.model && allowCustomModel) {\n    const wrote = mergeSettings({ CLAUDE_MEM_MODEL: options.model });\n    if (wrote) {\n      log.info(`Saved gateway model=${options.model} to ~/.claude-mem/settings.json`);\n    }\n    return;\n  }\n\n  if (!isInteractive) return;","sourceCodeStart":1275,"sourceCodeEnd":1311,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/src/npx-cli/commands/install.ts#L1275-L1311","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Use one of the allowed model ids listed in the error message.","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.","Update claude-mem so the allowlist includes the new model id, if it is a legitimate first-party model."],"exampleFix":"// before — non-allowlisted model on subscription auth\nclaude-mem install --model claude-3-5-sonnet\n// after — use an allowlisted id\nclaude-mem install --model claude-sonnet-5","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set(['claude-haiku-4-5-20251001','claude-sonnet-5','claude-opus-4-8']);\nif (options.model && resolveClaudeAuthMethod() !== 'gateway' && !ALLOWED.has(options.model)) {\n  throw new Error(`Model must be one of: ${[...ALLOWED].join(', ')}`);\n}","typeGuard":"function isAllowedModel(m: string): boolean {\n  return new Set(['claude-haiku-4-5-20251001','claude-sonnet-5','claude-opus-4-8']).has(m);\n}","tryCatchPattern":null,"preventionTips":["Use only allowlisted model ids unless you are on gateway auth.","Switch to gateway auth (CLAUDE_MEM_AUTH_METHOD=gateway) before passing custom model ids.","Keep CI --model pins in sync with the allowlist after upgrades."],"tags":["config","validation","cli","model","auth"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}