[BUG] --resume normalizes model ID, breaking custom API endpoints that require the original model name

Status Closed — not planned
Reported on v2.1.143
Maintainer reply None cached
Activity 5 comments · opened May 26, 2026 · closed Jul 3, 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 starting a fresh claude session with a custom model ID (e.g. aws/anthropic/bedrock-claude-opus-4-6), the first API request uses the full model path. However, when resuming the same session with claude --resume <id>, the model name is normalized to a short form
(claude-opus-4-6), which the upstream API rejects.

What Should Happen?

The resumed session should use the same model ID as the original session (aws/anthropic/bedrock-claude-opus-4-6).

Error Messages/Logs

Steps to Reproduce

  1. Configure Claude Code to use a custom API base URL and a fully-qualified model name:

ANTHROPIC_BASE_URL=<CUSTOM_INFERENCE_ENDPOINT>
ANTHROPIC_MODEL=aws/anthropic/bedrock-claude-opus-4-6

  1. Start a fresh session: claude
  2. Observe the API request body contains "model": "aws/anthropic/bedrock-claude-opus-4-6" → 200 OK
  3. Resume the session: claude --resume <session-id>
  4. Observe the API request body now contains "model": "claude-opus-4-6" → 401

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.143

Claude Code Version

2.1.150

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

5 Comments

learningendless · 4 months ago

yes, +1, me too;
Could you please fix this bug ASAP, thanks a lot.

learningendless · 4 months ago

The configuration in settings.json should have the highest priority. When resuming a session, it should default to using the model specified in settings.json, because users may switch to newer models — if the session still uses the old model stored in the session history, that violates user expectations. Furthermore, if the user explicitly specifies a --model parameter when resuming, that explicit parameter should take the highest priority. This is my understanding of the expected behavior, and I look forward to seeing this issue fixed soon.

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

yancl · 3 months ago

For anyone who needs a workaround, you can set the environment variable like this (assuming you are using Opus 4.8):
export ANTHROPIC_MODEL=aws/anthropic/bedrock-claude-opus-4-8

github-actions[bot] · 1 month ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.