C:/Program Files/Git/resume causes gateway error when modelOverrides are configured — re-selecting model fixes it
Environment
- Claude Code version: latest
- Platform: Windows 11 Enterprise + macOS
- Backend: Corporate LMG gateway (Bedrock IL2) via
ANTHROPIC_BASE_URL modelOverridesconfigured insettings.jsonmapping canonical ids to deployment-specific ids
Describe the bug
When using /resume to restore a previous session, Claude Code emits a gateway error immediately on startup. The error appears to be the model being resolved before modelOverrides and env vars are fully applied, causing a canonical or bare alias id to be sent to the gateway instead of the mapped deployment id.
Manually re-selecting the same model (e.g. /model sonnet) after /resume immediately fixes the issue — the override map resolves correctly and subsequent requests succeed.
Reproduction steps
- Configure
modelOverridesinsettings.jsonmapping canonical ids to backend-specific deployment ids (e.g."claude-sonnet-4-6": "claude-4-6-sonnet-aws-comm-il2[1m]") - Set
ANTHROPIC_BASE_URLto a non-Anthropic gateway - Start a session, have a conversation, exit
- Run
/resumeto restore the session - Observe gateway error on the first request
Expected behavior
/resume restores the session with model overrides fully applied, first request succeeds.
Actual behavior
Gateway error (400 or connection failure) on first request after /resume. Re-selecting the model with /model <name> immediately fixes it.
Workaround
Run /model sonnet (or your default) immediately after every /resume.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗