Add environment variables for extended context model aliases (sonnet[1m], opus[1m])

Resolved 💬 10 comments Opened Feb 11, 2026 by bluedoors Closed Mar 24, 2026

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 - configures opus alias
  • ANTHROPIC_DEFAULT_SONNET_MODEL - configures sonnet alias
  • ANTHROPIC_DEFAULT_HAIKU_MODEL - configures haiku alias

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 - configures opus[1m] alias
  • ANTHROPIC_DEFAULT_SONNET_1M_MODEL - configures sonnet[1m] alias
  • ANTHROPIC_DEFAULT_HAIKU_1M_MODEL - configures haiku[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

  1. Consistency - Aligns with existing environment variable pattern
  2. Flexibility - Allows per-provider configuration of extended context models
  3. Usability - Makes it easy to switch between standard and extended context without remembering full model IDs
  4. 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

View original on GitHub ↗

This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗