◉CLAUDE LABJP
●2.1.289 — Claude Code 2.1.289 (Oct 3) fixes deny/ask rules on nested parts of compound shell commands, a terminal freeze, and Read deny through symlinks●10/07 — 1 day left until the old spellings of Claude Desktop / Cowork managed-config keys stop being accepted. After the cutoff they fail closed●ACCOUNTS — A request to switch between multiple accounts in Claude Desktop has gathered over 200 comments on GitHub. How far today's workarounds go is the real question●NEW — When Claude Code committed despite a no-commit instruction, I separated the cause with a deny rule and a PreToolUse hook●COMPARE — A Zenn post compares Opus 5.5 and Sonnet 5.5 with numbers. The real question is where to draw the line per job●SONNET5.5 — Code written for Sonnet 5 can break on 5.5 in five ways. Thinking settings and forced tool_choice are the places to check first●2.1.289 — Claude Code 2.1.289 (Oct 3) fixes deny/ask rules on nested parts of compound shell commands, a terminal freeze, and Read deny through symlinks●10/07 — 1 day left until the old spellings of Claude Desktop / Cowork managed-config keys stop being accepted. After the cutoff they fail closed●ACCOUNTS — A request to switch between multiple accounts in Claude Desktop has gathered over 200 comments on GitHub. How far today's workarounds go is the real question●NEW — When Claude Code committed despite a no-commit instruction, I separated the cause with a deny rule and a PreToolUse hook●COMPARE — A Zenn post compares Opus 5.5 and Sonnet 5.5 with numbers. The real question is where to draw the line per job●SONNET5.5 — Code written for Sonnet 5 can break on 5.5 in five ways. Thinking settings and forced tool_choice are the places to check first
Articles/Claude.ai
◉ Claude.ai/2026-04-03Intermediate

Migrating from the Claude 1M Context Window Beta: Everything You Need to Do Before April 30, 2026

Anthropic is retiring the 1M token context window beta for Claude Sonnet 4.5 and Sonnet 4 on April 30, 2026. Learn how to migrate to Claude Sonnet 4.6 before the context-1m-2025-08-07 header stops working.

1M tokenscontext windowmigration guideClaude Sonnet 4.6deprecation4context-1m-2025-08-07Claude API124

On March 30, 2026, Anthropic announced that the 1M token context window beta for Claude Sonnet 4.5 and Claude Sonnet 4 will be retired on April 30, 2026. If your application currently uses the context-1m-2025-08-07 beta header to handle long-context requests, you need to act before that date to avoid unexpected errors in production.

What's Being Retired

When Anthropic introduced long-context support for Claude Sonnet 4 and Sonnet 4.5, it was released as a beta feature that required a special header in every API request:

anthropic-beta: context-1m-2025-08-07

This header signaled to the API that your request might exceed the standard 200K token context window, allowing inputs up to 1 million tokens.

After April 30, 2026, this changes. The beta header will be silently ignored, and any request exceeding 200K tokens sent to Claude Sonnet 4.5 or Sonnet 4 will return a context window exceeded error — even if the header is present.

Which Models Are Affected

Models affected (action required):

  • claude-sonnet-4-5-20250929 (Claude Sonnet 4.5)
  • claude-sonnet-4-20250522 (Claude Sonnet 4)

Models not affected (1M tokens supported natively):

  • claude-sonnet-4-6-20260217 (Claude Sonnet 4.6) — no beta header needed
  • claude-opus-4-6-20260205 (Claude Opus 4.6) — no beta header needed

Claude Sonnet 4.6 and Claude Opus 4.6 both support 1M token context windows as a standard feature. There's no beta header to include, no special opt-in — it just works. Requests exceeding 200K tokens are automatically handled with long-context pricing applied.

Before and After: Code Migration Examples

Python SDK

import anthropic
 
client = anthropic.Anthropic()
 
# ❌ Old approach — will stop working after April 30, 2026
response = client.messages.create(
    model="claude-sonnet-4-5-20250929",   # Sonnet 4.5
    max_tokens=8192,
    extra_headers={
        "anthropic-beta": "context-1m-2025-08-07"  # This header will be ignored
    },
    messages=[
        {"role": "user", "content": very_long_document}  # 200K+ tokens
    ]
)
 
# ✅ New approach — Claude Sonnet 4.6 with native 1M context
response = client.messages.create(
    model="claude-sonnet-4-6-20260217",   # Upgrade to Sonnet 4.6
    max_tokens=8192,
    # No extra_headers needed — 1M context is built-in
    messages=[
        {"role": "user", "content": very_long_document}  # Still supports up to 1M tokens
    ]
)
 
# Example response output:
# response.model → "claude-sonnet-4-6-20260217"
# response.usage.input_tokens → actual token count of your input

TypeScript / Node.js SDK

import Anthropic from "@anthropic-ai/sdk";
 
const client = new Anthropic();
 
// ✅ Migrated TypeScript code
const response = await client.messages.create({
  model: "claude-sonnet-4-6-20260217",  // Changed from Sonnet 4.5
  max_tokens: 8192,
  // Removed: headers: { "anthropic-beta": "context-1m-2025-08-07" }
  messages: [
    {
      role: "user",
      content: veryLongDocument,  // Up to 1M tokens supported natively
    },
  ],
});
 
const text = response.content[0].type === "text" ? response.content[0].text : "";
console.log(text);

Three Steps to Complete Your Migration

Step 1: Find all affected usages in your codebase

Start by searching your project for the beta header and older model names:

# Search for the deprecated beta header
grep -r "context-1m-2025-08-07" ./
 
# Search for the affected model IDs
grep -r "claude-sonnet-4-5\|claude-sonnet-4-20250522" ./src/

This gives you a complete list of files that need updating.

Step 2: Update the model name and remove the beta header

For each location you found, make two changes:

  • Replace claude-sonnet-4-5-20250929 with claude-sonnet-4-6-20260217
  • Remove any anthropic-beta: context-1m-2025-08-07 header configuration

If you store model names as environment variables or in a config file (which is a good practice), you only need to update it in one place:

# Example: updating an environment variable
# Before
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
ANTHROPIC_BETA_HEADER=context-1m-2025-08-07
 
# After
ANTHROPIC_MODEL=claude-sonnet-4-6-20260217
# ANTHROPIC_BETA_HEADER is no longer needed — remove it

Step 3: Verify in a staging environment

Before pushing to production, run your most important use cases — particularly any that involve long documents or conversations exceeding 200K tokens — and confirm:

  • Responses are returned successfully
  • The response quality meets your expectations
  • Token counts and costs align with your estimates

Benefits of Moving to Claude Sonnet 4.6

This isn't just a maintenance migration. Claude Sonnet 4.6 brings real improvements over Sonnet 4.5:

Performance gains:

  • Improved performance on agentic search tasks compared to Sonnet 4.5
  • Better token efficiency — many tasks complete with fewer tokens consumed
  • Native support for Extended Thinking, useful for complex multi-step reasoning

Operational simplicity:

  • No beta header management across different environments
  • Reduced risk of configuration drift between dev and production
  • Supported as a current-generation model with a longer active lifecycle

For a deep dive into maximizing Claude Sonnet 4.6's capabilities — including 1M context strategies and Extended Thinking patterns — check out Claude Sonnet 4.6 Complete Mastery Guide.

Pricing Considerations

The long-context pricing model remains the same: standard per-token rates apply up to 200K input tokens, and a higher per-token rate kicks in for input tokens beyond that threshold. Sonnet 4.6's long-context pricing is comparable to Sonnet 4.5, so your costs shouldn't change significantly.

One area where you might see savings: Sonnet 4.6's improved token efficiency can mean shorter, equally capable responses — which directly reduces both token usage and cost.

Migration Checklist

Use this checklist to make sure your migration is complete before April 30:

  • Search codebase for context-1m-2025-08-07 and note every location
  • Search codebase for claude-sonnet-4-5-20250929 and claude-sonnet-4-20250522
  • Update model names to claude-sonnet-4-6-20260217 (or claude-opus-4-6-20260205 where appropriate)
  • Remove all instances of the context-1m-2025-08-07 beta header
  • Update environment variables and config files if model names are stored there
  • Test long-context requests (200K+ tokens) in a staging environment
  • Deploy changes to production before April 30, 2026

Looking back

The 1M token context window beta for Claude Sonnet 4.5 and Sonnet 4 ends on April 30, 2026. Migrating is straightforward: update your model name to claude-sonnet-4-6-20260217 and remove the context-1m-2025-08-07 beta header. Claude Sonnet 4.6 supports 1M tokens natively with no configuration needed, and brings meaningful improvements in efficiency and agentic task performance.

For practical context window management patterns — including strategies for working efficiently within token limits and handling very long documents — see Claude 200K Context Window Production Mastery.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $15 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◉ Claude.ai2026-10-04
claude-sonnet-4-5 stops on November 30 — I checked the bill before calling its replacement cheaper
claude-sonnet-4-5-20250929 retires on November 30, 2026. The recommended claude-sonnet-5-5 has lower list prices, but a new tokenizer and a 400 on temperature change the math. After reading, you can audit your own calls and plan the switch in order.
◉ Claude.ai2026-10-06
Paid for Pro but still on Free? Where you bought it decides which screen to open and where to cancel
You paid for Claude Pro but the account shows Free, there is no invoice, or there is no Cancel button. A side-by-side of web/Desktop purchases versus iOS/Android in-app purchases, so you know which screen to open first for each symptom.
◉ Claude.ai2026-10-03
My Usage Limit Ran Out Before Noon, and the Reason Was Conversation Length, Not Message Count
When the usage-limit banner shows up on Pro or Max sooner than you expected, here is the order I check: the two bars in Settings > Usage, the length of the conversation and its attachments, then the model and effort level. The morning I got cut off before lunch, and the lines I drew afterwards.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links