Skip to content
IFAI

AI models

Claude Sonnet 4 gets a 1M token context window

Published Reach 51

Anthropic just expanded Claude Sonnet 4's context window to 1 million tokens, a 5x boost that lets developers ingest entire codebases with over 75,000 lines of code or complex agent tool-call histories in a single prompt. It is available in public beta on the Claude Developer Platform, Amazon Bedrock, and Google Cloud Vertex AI. Why it matters: massive context unlocks production-grade software engineering agents without losing coherence.

Claude Sonnet 4 gets a 1M token context window
Image: anthropic.com

If you have ever tried feeding an entire software repository to an AI, you know the pain of context limits. You chop files into chunks, feed them piecemeal, and watch the model forget your architecture five minutes later.

Anthropic is tackling that headache head-on. The company just expanded the context window for Claude Sonnet 4 to 1 million tokens, marking a massive 5x jump from its previous 200K limit.

That means Sonnet 4 can now swallow more than 75,000 lines of code or dozens of dense technical papers in a single prompt.

Big codebases and multi-day agents

Anthropic is pitching this upgrade directly at heavy-duty developer workflows and enterprise document tasks.

First up is repository-level analysis. Engineers can load full source trees, tests, and documentation at once, allowing Sonnet 4 to trace tricky cross-file dependencies and critique overall system design.

It also changes the math for autonomous agents. Complex agentic workflows often require hundreds of sequential tool calls. With a 1M buffer, agents can keep their complete scratchpad, system prompts, and tool history intact without suffering memory decay.

Early partners are already chiming in. Eric Simons, CEO of in-browser IDE platform Bolt.new, noted that the expanded window lets developers build substantially larger projects without sacrificing coding precision.

London-based iGent AI reported that the 1M window powered multi-day autonomous coding sessions inside its Maestro software engineering agent.

The 1M context beta is currently live on the Claude Developer Platform for Tier 4 and custom-tier accounts, with broader rollout coming over the following weeks. It is also available via Amazon Bedrock and Google Cloud's Vertex AI.

Tiered pricing over 200K

Long context does not come cheap, and Anthropic has introduced a tiered pricing model to cover the extra compute.

For prompts under 200K tokens, standard rates remain at $3 per million input tokens and $15 per million output tokens.

Once a prompt crosses the 200K threshold, rates jump to $6 per million input tokens and $22.50 per million output tokens.

To soften the blow, Anthropic points out that prompt caching can significantly cut latency and cost for repeated context. Developers can also run non-urgent workloads through the batch processing API for a 50% discount.

Why it matters

We think Anthropic just eliminated its single biggest competitive disadvantage against Google.

For the past year, Google held the long-context crown almost uncontested with Gemini 1.5 Pro. Developers who preferred Claude for logic and code generation frequently had to switch to Gemini simply because their codebases did not fit into 200K tokens. That tradeoff is now off the table.

For engineering teams building complex developer tools, testing this 1M beta is a no-brainer, particularly when paired with prompt caching to pin codebases in place.

Still, there are trade-offs to watch. Beyond the doubled input pricing above 200K, huge context windows bring real latency hits and potential attention drift. Finding needle-in-a-haystack strings is easy; doing flawless architectural reasoning across 75,000 lines is a much taller order.

Sources (1)

  1. [1]
    anthropic.com(opens in a new tab)Originalanthropic.com

Best of AI, daily