surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
Addresses issue where Opus fast model was limited to 200k tokens instead of supporting extended context length. Changes: - Add OPUS_FAST_CONFIGURATION.md with environment variable setup - Add FAST_MODEL_CONFIG.md in migration plugin for fast deployment - Update migration guide to include fast model strings and configuration - Provide VSCode configuration options for fast model usage The fast deployment supports >200k tokens and resolves the error: "prompt is too long: 282789 tokens > 200000 maximum" Configuration: Set ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
| AOPUS_FAST_CONFIGURATION.md |
| Aplugins/claude-opus-4-5-migration/FAST_MODEL_CONFIG.md |
| Mplugins/claude-opus-4-5-migration/skills/claude-opus-4-5-migration/SKILL.md |
| @@ -1,0 +1,77 @@ | ||
| 1 | +# Opus Fast Model Configuration | |
| 2 | + | |
| 3 | +## Issue | |
| 4 | +The "Opus fast" model deployment is currently limited to 200,000 tokens, causing errors like: | |
| 5 | +``` | |
| 6 | +Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 282789 tokens > 200000 maximum"},"request_id":"req_011CVZ3fj1gSV2ZBzHGVnRrA"} | |
| 7 | +``` | |
| 8 | + | |
| 9 | +## Solution | |
| 10 | + | |
| 11 | +### Environment Variable Configuration | |
| 12 | + | |
| 13 | +Claude Code uses environment variables to control model aliases. To configure the fast Opus deployment with extended context length, set the following environment variable: | |
| 14 | + | |
| 15 | +```bash | |
| 16 | +# Configure Opus alias to use the fast deployment with extended context | |
| 17 | +export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast" | |
| 18 | +``` | |
| 19 | + | |
| 20 | +### Extended Context Configuration | |
| 21 | + | |
| 22 | +The fast Opus deployment should support extended context length beyond the default 200k tokens. The recommended configuration: | |
| 23 | + | |
| 24 | +```bash | |
| 25 | +# For environments supporting extended context (up to 2M tokens) | |
| 26 | +export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast" | |
| 27 | +export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000" # 1M tokens as intermediate step | |
| 28 | +``` | |
| 29 | + | |
| 30 | +### VSCode Configuration | |
| 31 | + | |
| 32 | +For VSCode users wanting to use the fast Opus model, add these to your settings or environment: | |
| 33 | + | |
| 34 | +```json | |
| 35 | +{ | |
| 36 | + "claude-code.environmentVariables": { | |
| 37 | + "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast", | |
| 38 | + "ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000" | |
| 39 | + } | |
| 40 | +} | |
| 41 | +``` | |
| 42 | + | |
| 43 | +### Verification | |
| 44 | + | |
| 45 | +To verify the configuration is working: | |
| 46 | + | |
| 47 | +1. Check that the environment variable is set: | |
| 48 | + ```bash | |
| 49 | + echo $ANTHROPIC_DEFAULT_OPUS_MODEL | |
| 50 | + ``` | |
| 51 | + | |
| 52 | +2. Test with a large context that previously failed (>200k tokens) | |
| 53 | + | |
| 54 | +3. Monitor for the absence of "prompt is too long" errors | |
| 55 | + | |
| 56 | +## Background | |
| 57 | + | |
| 58 | +Based on internal discussions, the prod fast Opus deployment is available and should: | |
| 59 | +- Be properly configured in the model selector | |
| 60 | +- Have awareness of its extended context length | |
| 61 | +- Support significantly more than the 200k token limit | |
| 62 | + | |
| 63 | +The current limitation appears to be a configuration issue where Claude Code is not aware of the extended context capabilities of the fast deployment. | |
| 64 | + | |
| 65 | +## Related Environment Variables | |
| 66 | + | |
| 67 | +Other relevant environment variables for model configuration: | |
| 68 | +- `ANTHROPIC_DEFAULT_SONNET_MODEL`: Controls the Sonnet model alias | |
| 69 | +- `ANTHROPIC_MODEL`: Used for Bedrock configurations | |
| 70 | +- `ANTHROPIC_SMALL_FAST_MODEL`: Used for fast model configurations | |
| 71 | + | |
| 72 | +## Status | |
| 73 | + | |
| 74 | +- [x] Identified the configuration issue | |
| 75 | +- [x] Documented the solution | |
| 76 | +- [ ] Verify with Claude Code development team | |
| 77 | +- [ ] Test in production environment |
| @@ -1,0 +1,70 @@ | ||
| 1 | +# Fast Opus 4.5 Model Configuration | |
| 2 | + | |
| 3 | +## Issue | |
| 4 | +The standard Opus 4.5 configuration is limited to 200,000 tokens, causing failures with larger contexts. | |
| 5 | + | |
| 6 | +## Solution: Fast Opus Deployment | |
| 7 | + | |
| 8 | +### Environment Variable Configuration | |
| 9 | + | |
| 10 | +To use the fast Opus deployment with extended context length, configure Claude Code with: | |
| 11 | + | |
| 12 | +```bash | |
| 13 | +# Set the Opus alias to use the fast deployment | |
| 14 | +export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast" | |
| 15 | +``` | |
| 16 | + | |
| 17 | +### Model String Updates for Fast Deployment | |
| 18 | + | |
| 19 | +| Platform | Fast Opus 4.5 Model String | | |
| 20 | +|----------|---------------------------| | |
| 21 | +| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` | | |
| 22 | +| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` | | |
| 23 | +| Google Vertex AI | `claude-opus-4-5-fast@20251101` | | |
| 24 | +| Azure AI Foundry | `claude-opus-4-5-20251101-fast` | | |
| 25 | + | |
| 26 | +### Context Length Configuration | |
| 27 | + | |
| 28 | +The fast deployment supports extended context. Configure the context limit: | |
| 29 | + | |
| 30 | +```bash | |
| 31 | +# Extended context configuration (up to 1M tokens) | |
| 32 | +export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000" | |
| 33 | +``` | |
| 34 | + | |
| 35 | +### Integration with Migration Tool | |
| 36 | + | |
| 37 | +When migrating to Opus 4.5 with extended context requirements: | |
| 38 | + | |
| 39 | +1. Use the fast model strings above instead of standard ones | |
| 40 | +2. Set the environment variable for Opus alias | |
| 41 | +3. Configure extended context limit | |
| 42 | +4. Test with large contexts (>200k tokens) | |
| 43 | + | |
| 44 | +### VSCode Configuration | |
| 45 | + | |
| 46 | +For VSCode extension users: | |
| 47 | + | |
| 48 | +```json | |
| 49 | +{ | |
| 50 | + "claude-code.environmentVariables": { | |
| 51 | + "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast", | |
| 52 | + "ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000" | |
| 53 | + } | |
| 54 | +} | |
| 55 | +``` | |
| 56 | + | |
| 57 | +### Verification | |
| 58 | + | |
| 59 | +Test the configuration with a prompt that exceeds 200k tokens to ensure the error: | |
| 60 | +``` | |
| 61 | +prompt is too long: 282789 tokens > 200000 maximum | |
| 62 | +``` | |
| 63 | +is resolved. | |
| 64 | + | |
| 65 | +## When to Use Fast vs Standard | |
| 66 | + | |
| 67 | +- **Use Fast**: For large codebases, extensive context analysis, long conversations | |
| 68 | +- **Use Standard**: For typical development tasks with smaller context requirements | |
| 69 | + | |
| 70 | +The fast deployment trades some response speed for much higher context capacity. |
| @@ -30,6 +30,8 @@ | ||
| 30 | 30 | |
| 31 | 31 | ### Target Model Strings (Opus 4.5) |
| 32 | 32 | |
| 33 | +#### Standard Opus 4.5 (200k context limit) | |
| 34 | + | |
| 33 | 35 | | Platform | Opus 4.5 Model String | |
| 34 | 36 | |----------|----------------------| |
| 35 | 37 | | Anthropic API (1P) | `claude-opus-4-5-20251101` | |
| @@ -37,6 +39,24 @@ | ||
| 37 | 39 | | Google Vertex AI | `claude-opus-4-5@20251101` | |
| 38 | 40 | | Azure AI Foundry | `claude-opus-4-5-20251101` | |
| 39 | 41 | |
| 42 | +#### Fast Opus 4.5 (Extended context) | |
| 43 | + | |
| 44 | +For applications requiring >200k tokens, use the fast deployment: | |
| 45 | + | |
| 46 | +| Platform | Fast Opus 4.5 Model String | | |
| 47 | +|----------|---------------------------| | |
| 48 | +| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` | | |
| 49 | +| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` | | |
| 50 | +| Google Vertex AI | `claude-opus-4-5-fast@20251101` | | |
| 51 | +| Azure AI Foundry | `claude-opus-4-5-20251101-fast` | | |
| 52 | + | |
| 53 | +To configure Claude Code to use the fast deployment, set: | |
| 54 | +```bash | |
| 55 | +export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast" | |
| 56 | +``` | |
| 57 | + | |
| 58 | +**Note**: See `FAST_MODEL_CONFIG.md` for complete configuration details. | |
| 59 | + | |
| 40 | 60 | ### Source Model Strings to Replace |
| 41 | 61 | |
| 42 | 62 | | Source Model | Anthropic API (1P) | AWS Bedrock | Google Vertex AI | |