401 error on session start: Claude Code tries default model before loading user settings
Description
On every new session start, a 401 error is thrown because Claude Code attempts an API call using its built-in default model before reading the user's configured model from ~/.claude/settings.json.
Configuration
~/.claude/settings.json:
{
"model": "claude-opus-4-6",
"effortLevel": "high"
}
The configured model (claude-opus-4-6) is in the team's allowed models list, yet Claude Code makes an initial call with a different model (appears to be claude-sonnet-4-5-20250929 or similar) before the settings are applied.
Error
401 {"error":{"message":"team not allowed to access model. This team can only
access models=['claude-3-5-haiku-20241022', 'claude-haiku-4-5-20251001',
'claude-3-7-sonnet-20250219', 'claude-sonnet-4-20250514',
'claude-sonnet-4-5-20250929', 'claude-opus-4-20250514',
'claude-opus-4-1-20250805', 'claude-opus-4-5-20251101', 'claude-opus-4-6',
'claude-sonnet-4-6', ...]. Tried to access claude-sonnet-4-5-2025092…",
"type":"team_model_access_denied"}}
Expected Behavior
Claude Code should load and apply the user's model setting from ~/.claude/settings.json before making any API calls, so that teams with model access restrictions don't see 401 errors on startup.
Workaround
Manually running /model claude-opus-4-6 after the error clears the issue for the rest of the session, but this must be done every time a new session starts.
Environment
- OS: macOS (Darwin 23.6.0)
- Claude Code CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗