[BUG]

Resolved 💬 5 comments Opened Jun 14, 2025 by njrun1804 Closed Jun 14, 2025

Environment

  • Platform (select one):
  • Anthropic API
  • AWS Bedrock
  • Google Vertex AI
  • Other:
  • Claude CLI version: 1.0.24 (Claude Code)
  • Operating System: macOS Darwin 24.5.0
  • Terminal: zsh

Bug Description

Claude CLI fails with "Invalid model name" error when using the "opus" model alias, despite the documentation stating it's a supported alias.

Steps to Reproduce

  1. Set environment variable: export CLAUDE_DEFAULT_MODEL="opus"
  2. Run claude
  3. Type any message (e.g., "hi")
  4. Receive error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"system: Invalid model name"}}

Expected Behavior

According to claude --help, the "opus" alias should work:
--model <model> Model for the current session. Provide an alias for the latest model (e.g. 'sonnet' or 'opus') or a model's full name
The CLI should translate "opus" to "claude-opus-4-20250514" before making API calls.

Actual Behavior

The CLI passes "opus" directly to the API without translation, causing a 400 error. The error occurs immediately upon sending any message.

Additional Context

  • Workaround: Using "sonnet" alias or full model IDs works correctly
  • This affects all new CLI sessions when CLAUDE_DEFAULT_MODEL="opus" is set
  • The bug persists across shell restarts due to the environment variable
  • Confirmed that removing all Claude settings and reinstalling didn't fix the issue

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗