CLAUDE LABJP
FORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as OctoberFORK — Claude Code 2.1.212 changes what /fork does: it copies your conversation into a new background session with its own row in claude agents, so you can keep working. The old in-session subagent is now /subtaskLIMITS — WebSearch calls are now capped at 200 per session by default, and subagent spawns get the same 200 ceiling, so a runaway search or delegation loop stops on its ownMCPBG — MCP tool calls running past two minutes now move to the background automatically, keeping the session usable. Tune the threshold with CLAUDE_CODE_MCP_AUTO_BACKGROUND_MSPLANFIX — Fixed plan mode auto-running file-modifying Bash commands such as touch and rm without a permission prompt or an SDK canUseTool callbackSONNET5 — Claude Sonnet 5 is running on introductory pricing of $2 per million input tokens and $10 per million output. After August 31 it moves to $3 and $15IPO — Bankers are reportedly lining up investor meetings for Anthropic ahead of a possible public listing as soon as October
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 window2migration guideClaude Sonnet 4.62deprecation3context-1m-2025-08-07Claude API115

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 $10 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-05-22
Holding the Line on Claude's Output Shape With <output_format> — A Pattern From My Indie App Copy Pipeline
How I keep multilingual App Store copy from drifting across 100+ locales by leaning on the <output_format> tag, with the prompts and validators I actually run.
Claude.ai2026-04-25
When Extended Thinking 'Does Not Work': 7 Causes That Hide Behind the Same Symptom
When you turn on Extended Thinking but the response feels identical to before, the cause is usually one of seven distinct problems. This guide walks through how to diagnose each from the API, the chat UI, the SDK, and the model layer.
Claude.ai2026-04-20
Claude Computer Use 2026 — Desktop Automation Across Browser, Desktop, and CLI
The practical guide to Claude Computer Use. Covers the latest setup for macOS general availability, browser and desktop automation patterns, and practical production deployment strategies.
📚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
See all →