Add environment variables for extended context model aliases (sonnet[1m], opus[1m])
Problem
Currently, Claude Code supports extended context models via the [1m] suffix (e.g., sonnet[1m], opus[1m]), but there are no dedicated environment variables to configure which underlying models these aliases point to.
The existing environment variables only cover the standard context versions:
ANTHROPIC_DEFAULT_OPUS_MODEL- configuresopusaliasANTHROPIC_DEFAULT_SONNET_MODEL- configuressonnetaliasANTHROPIC_DEFAULT_HAIKU_MODEL- configureshaikualias
This creates a limitation for AWS Bedrock users who need to map extended context aliases to specific Bedrock model IDs or inference profile ARNs.
Use Case
When using Claude Code with AWS Bedrock, users need to specify full model identifiers like:
- Standard:
global.anthropic.claude-opus-4-6-v1 - Extended context:
global.anthropic.claude-opus-4-6-v1[1m]
Currently, there's no way to configure the default model for opus[1m] or sonnet[1m] aliases to point to Bedrock-specific identifiers.
Proposed Solution
Add new environment variables to configure extended context model aliases:
ANTHROPIC_DEFAULT_OPUS_1M_MODEL- configuresopus[1m]aliasANTHROPIC_DEFAULT_SONNET_1M_MODEL- configuressonnet[1m]aliasANTHROPIC_DEFAULT_HAIKU_1M_MODEL- configureshaiku[1m]alias (if/when available)
Example configuration:
{
"env": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "global.anthropic.claude-opus-4-6-v1",
"ANTHROPIC_DEFAULT_OPUS_1M_MODEL": "global.anthropic.claude-opus-4-6-v1[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
"ANTHROPIC_DEFAULT_SONNET_1M_MODEL": "global.anthropic.claude-sonnet-4-5-20250929-v1:0[1m]"
}
}
This would allow users to run /model sonnet[1m] and have it automatically resolve to their configured Bedrock model ID.
Benefits
- Consistency - Aligns with existing environment variable pattern
- Flexibility - Allows per-provider configuration of extended context models
- Usability - Makes it easy to switch between standard and extended context without remembering full model IDs
- AWS Bedrock support - Properly supports Bedrock inference profiles and regional model IDs
Alternative Considered
Users can set the model by ID directly using /model global.anthropic.claude-opus-4-6-v1[1m], but this:
- Requires remembering and typing the full Bedrock model ID each time
- Doesn't allow separate configuration of standard vs extended context aliases
- Prevents using the convenient
/model opus[1m]shorthand notation - Makes it harder to switch between context sizes during sessions
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗