Expand description
Context window management defaults
Constants§
- BETA_
CONTEXT_ 1M - Beta header for 1M token context window Include in requests to enable extended context for Sonnet 4/4.5
- CODE_
HEAD_ RATIO_ PERCENT - Head ratio percentage for code files (legacy, kept for compatibility)
- DEFAULT_
COMPACTION_ TRIGGER_ RATIO - Default auto-compaction trigger ratio - at 90% prompt pressure, compaction fires.
- DEFAULT_
THINKING_ BUDGET - Default thinking budget for production use (64K output models: Opus 4.5, Sonnet 4.5, Haiku 4.5) Extended thinking is now auto-enabled by default as of January 2026
- ENTERPRISE_
CONTEXT_ WINDOW - Claude.ai Enterprise context window (500K tokens)
- EXTENDED_
CONTEXT_ ELIGIBLE_ MODELS - Models eligible for 1M context window (beta) Requires usage tier 4 or custom rate limits
- EXTENDED_
CONTEXT_ WINDOW - Extended context window size (1M tokens) - beta feature Available for Claude Sonnet 4, Sonnet 4.5 in usage tier 4 Requires beta header: “context-1m-2025-08-07”
- LOG_
HEAD_ RATIO_ PERCENT - Head ratio percentage for log files (legacy, kept for compatibility)
- MAX_
THINKING_ BUDGET_ 32K - Maximum thinking budget for 32K output models (Opus 4)
- MAX_
THINKING_ BUDGET_ 64K - Maximum thinking budget for 64K output models (Opus 4.5, Sonnet 4.5, Haiku 4.5) Use MAX_THINKING_TOKENS=63999 environment variable to enable this
- MIN_
THINKING_ BUDGET - Minimum budget tokens for extended thinking (Anthropic requirement)
- RECOMMENDED_
THINKING_ BUDGET - Recommended budget tokens for complex reasoning tasks
- STANDARD_
CONTEXT_ WINDOW - Standard context window size (200K tokens) - default for most models
Functions§
- supports_
extended_ context - Check if a model is eligible for 1M context window