Feature Request: Automatic model fallback when quota is exhausted
Feature Request: Automatic Model Fallback on Quota Exhaustion
Background
Claude Code currently offers an opusplan model setting (an existing feature) that intelligently uses:
- Opus for the planning phase (complex reasoning and architecture decisions)
- Sonnet for the execution phase (code generation and implementation)
This is great for optimizing both quality and cost!
Problem
However, if the Opus quota is exhausted during the planning phase itself, the session fails rather than automatically falling back to Sonnet for planning as well.
This creates challenges in enterprise/multi-user environments where Opus quota needs to be managed carefully across multiple users.
Current Behavior
opusplanuses Opus for planning, Sonnet for execution- If Opus quota runs out during planning → session fails ❌
- User must manually switch to Sonnet using
/model sonnet
Desired Behavior
Extend the existing model configuration to support automatic fallback when quota is exhausted:
{
"model": "opusplan",
"modelFallback": "sonnet"
}
Or more generally for any model:
{
"model": "opus",
"modelFallback": {
"onQuotaExhausted": "sonnet",
"onRateLimit": "sonnet"
}
}
When Opus quota is exhausted:
- Gracefully switch to the fallback model (Sonnet) ✅
- Show a notification to the user about the fallback
- Continue the session without interruption
Use Cases
- Enterprise settings: IT administrators can configure system-wide settings that ensure continuous operation even when Opus quota runs out
- Multi-user environments: Teams sharing quota can have graceful degradation
- Cost management: Automatically manage costs by falling back to less expensive models
- Unattended operations: Long-running tasks won't fail mid-session
Benefits
- Improved user experience (no session interruptions)
- Better quota management for teams
- Cost optimization
- Aligns with the existing
opusplanphilosophy of intelligent model selection
Alternatives Considered
- Setting
ANTHROPIC_SMALL_FAST_MODELenvironment variable, but this doesn't provide automatic fallback on quota exhaustion - Manually switching with
/model sonnetduring sessions (not practical for unattended operations)
---
Thank you for considering this enhancement to the existing opusplan feature!
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗