[BUG] Claude Code intermittently ignores selected custom model (falls back to Anthropic model IDs)
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?
Claude Code shows a custom model selected via /model (e.g. bedrock/<deployment>), but some subsequent requests—often during tool usage or follow-up turns—do not use that selected model identifier and instead appear to use an Anthropic model ID (e.g. claude-…). This makes it impossible to reliably route/enforce policy based on the model field behind an Anthropic-compatible endpoint.
What Should Happen?
Once a custom model is selected for a session, all requests in that session (including tool-related requests, follow-ups, and retries/background requests) should consistently use the selected model identifier, or otherwise preserve the same provider/model routing intent.
Error Messages/Logs
Steps to Reproduce
- Configure Claude Code to use an Anthropic-compatible API endpoint.
- Run /model and select a custom model like bedrock/<deployment>.
- Start a chat and ask for a task that triggers tool usage (e.g. “Explore the repo to find X”).
- Observe that some subsequent step/request does not use the selected custom model identifier (falls back to an Anthropic model ID).
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.6
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗