[BUG] Claude code seems to switch model?

Resolved 💬 2 comments Opened Jun 15, 2026 by CloudWaddie Closed Jun 18, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When I am using claude code, I am using an anthropic compatible api which is a litellm reverse proxy for amazon bedrock. As such, I am using amazon bedrock model ids. Here is my config:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://REDACTED.cloudwaddie.com/",
    "ANTHROPIC_API_KEY": "REDACTED",
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Users\\25FAZEDW\\AppData\\Local\\Programs\\Git\\bin\\bash.exe",
    "showThinkingSummaries": "true",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-6[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "us.anthropic.claude-opus-4-8[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
    "AWS_REGION": "us-east-1"
  },
  "model": "us.anthropic.claude-opus-4-8[1m]",
  "statusLine": {
    "type": "command",
    "command": "input=$(cat); model=$(echo \"$input\" | jq -r '.model.display_name'); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir'); session=$(echo \"$input\" | jq -r '.session_name // empty'); vim=$(echo \"$input\" | jq -r '.vim.mode // empty'); ctx=$(echo \"$input\" | jq -r '.context_window.used_percentage // empty'); parts=\"$model\"; [ -n \"$session\" ] && parts=\"$parts | [$session]\"; parts=\"$parts | $(basename \"$cwd\")\"; [ -n \"$ctx\" ] && parts=\"$parts | $(printf 'ctx:%.0f%%' \"$ctx\")\"; [ -n \"$vim\" ] && parts=\"$parts | -- $vim --\"; echo \"$parts\""
  },
  "enabledPlugins": {
    "frontend-design@claude-plugins-official": true,
    "gsap-skills@gsap-skills": true
  },
  "extraKnownMarketplaces": {
    "gsap-skills": {
      "source": {
        "source": "github",
        "repo": "greensock/gsap-skills"
      }
    }
  },
  "autoUpdatesChannel": "latest",
  "skipDangerousModePermissionPrompt": true,
  "theme": "dark"
}

It all works well until I close claude code, reopen and attempt to resume a session. I get:
● API Error: 400 ValidationException: The provided model identifier is invalid.
This isn't a one off. It happens everytime. Considering it works on any new session (apart from if I run claude --resume, then /new and chat) I think it is not using the correct model ID.

What Should Happen?

It should work.

Error Messages/Logs

● API Error: 400 ValidationException: The provided model identifier is invalid.

Steps to Reproduce

  1. Open claude and start a new session
  2. Close and reopen with either claude --resume or claude and then select the chat
  3. Send any message
  4. Fails.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.177 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

I am using git bash.

View original on GitHub ↗

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