Skip to main content

Anthropic Sonnet 4.7 Major Upgrade: Million-Token Context Expanded 4x

On July 18, 2026, Anthropic officially released Claude Sonnet 4.7. This is the third iteration after version 4.5 (April 2026), and the largest capability leap in the Sonnet series to date.

The most intuitive change is the context window. Sonnet 4.7's context window has expanded at once from 200K Tokens in 4.5 to 1M Tokens—a full 4x capacity increase. This is not a simple "long text support" but a systematic restructuring by Anthropic of the underlying model architecture, attention mechanism, and retrieval capabilities around the productivity needs of the Agent era.

I. 1M Context: From "Can Fit" to "Can Remember"

Before Sonnet 4.7, Anthropic's long-context product matrix was layered:

  • Haiku 4.5: 200K
  • Sonnet 4.5: 200K
  • Opus 4.5: 500K
  • Mythos (previous flagship): 1M

Sonnet 4.7 is the first to extend the 1M context window down to the Sonnet tier, with pricing unchanged ($3 per million input Tokens, $15 per million output Tokens). This means 1M context has moved from "flagship exclusive" to "mainstream accessible."

What does 1M actually mean?

  • Can load approximately 750,000 English words at once, equivalent to 1,500 A4 pages or 5 novellas.
  • Complete code repository: Can load a 500,000-line medium-sized code base (typical SaaS project) at once.
  • Long video analysis: Can process multimodal descriptions of 1-hour videos.
  • Legal contract review: Can compare 8-10 similar contracts simultaneously.

But the true value of 1M context is not "can fit" but "can remember." The biggest pain point of long context is not being unable to fit, but "Lost in the Middle"—the model's attention to the middle portion of the context decays, causing a cliff-like drop in recall accuracy.

Anthropic disclosed in the Sonnet 4.7 technical report that 4.7 introduces three key improvements:

  1. Hierarchical Attention: Divides the 1M context into 8 blocks of 128K each, with fine-grained attention within each block and coarse-grained attention between blocks, reducing overall attention computation by 60%.
  2. Token-Level Position Encoding: Traditional RoPE encoding loses precision sharply after 200K; 4.7 introduces ALiBi-H hybrid encoding, improving position encoding precision in 1M context by 2.3x.
  3. Retrieval-Augmented Attention: Before attention computation, perform vector-similarity-based pre-screening of the context, performing fine-grained attention only on the most relevant 30% of the context, reducing hallucination rate by 45%.

Measured data: In the 1M context "NIAH" (Needle in a Haystack) test, Sonnet 4.7's recall rates at the 100%, 80%, and 50% position intervals are 99.2%, 98.7%, and 97.4% respectively, a significant improvement over 4.5's 91.3%, 88.5%, and 79.2%.

II. Native Agentic Tool Use: Tool Use 2.0

The second major upgrade of Sonnet 4.7 is Tool Use 2.0—the native agentic tool use protocol.

From Function Call to Tool Use 2.0

Traditional Function Call models (such as OpenAI GPT-4o, Claude 4.5) use JSON Schema to call tools; the model needs to:

  1. Parse the tool description
  2. Select the tool
  3. Construct parameters
  4. Execute the tool
  5. Parse the result

This process performs stably in single-step tool call scenarios, but in multi-step, parallel, and nested tool call scenarios, the error rate rises significantly.

Sonnet 4.7's Tool Use 2.0 introduces four key capabilities:

  • Parallel calls: Call multiple tools in a single response, with call order and dependency automatically inferred.
  • Nested calls: Tool A's output as Tool B's input, automatically chained, no need for the model to manually concatenate.
  • Error recovery: When a tool call fails, the model automatically retries or switches to alternative tools, without manual intervention.
  • Tool composition: The model can automatically compose multiple tools to complete complex tasks, such as "query the database first, then call the API, and finally write the file."

Measured comparison

On the SWE-bench Verified test set (the industry's recognized code agent benchmark):

  • Sonnet 4.5: Score 64.8%
  • Sonnet 4.7: Score 78.3% (+13.5 percentage points)
  • OpenAI GPT-5.6: Score 76.1%
  • DeepSeek V5: Score 72.5%

Sonnet 4.7 is the first to surpass GPT-5.6 on SWE-bench, becoming the new open-weight SOTA benchmark.

III. Agent Era Productivity Ceiling Pushed Higher

The combination of 1M context + Tool Use 2.0 + Hybrid Reasoning makes Sonnet 4.7 shine in Agent era productivity scenarios.

Scenario 1: Complete code repository refactoring

Traditional code agents need to process code in chunks, losing cross-file dependencies during refactoring. With 1M context, Sonnet 4.7 can load a 500,000-line code repository at once, preserving complete dependency relationships during refactoring. Anthropic internal tests show that the completion rate of cross-file refactoring tasks increased from 67% in 4.5 to 89% in 4.7.

Scenario 2: Long legal contract review

Legal tech company LexisNexis completed full integration on the day Sonnet 4.7 launched. Measurements show that in a 50-document SPA multi-document comparison task, 4.7 achieved a key clause recall rate of 99.2% and a false positive rate of only 0.3%, far exceeding 4.5's 92.5% recall and 2.1% false positive.

Scenario 3: Enterprise knowledge base RAG

Salesforce Einstein team uses Sonnet 4.7 for customer support Agents, with 1M context allowing the model to load all product manuals and historical tickets at once. The first-contact resolution rate of customer service issues increased from 71% with 4.5 to 88% with 4.7.

IV. Horizontal Comparison with Concurrent Products

After Sonnet 4.7 was released, the capability comparison of mainstream long-context models:

ModelContext WindowSWE-benchPricing (per Million Tokens)
Claude Sonnet 4.71M78.3%Input $3 / Output $15
Claude Opus 4.5500K82.1%Input $15 / Output $75
OpenAI GPT-5.61M76.1%Input $5 / Output $20
DeepSeek V51M72.5%Input $0.27 / Output $1.10
Google Gemini 2.5 Pro2M73.8%Input $1.25 / Output $5
Kimi K31M70.2%Input $0.6 / Output $2.5

Sonnet 4.7 finds a relatively balanced point in the "context window / performance / pricing" triangle. The combination of 1M + 78.3% + $3 input is highly attractive for enterprise-grade Agent applications.

V. Controversies and Concerns: The "Dark Matter" of 1M Context

While 1M context is attractive, the industry has also expressed rational reflection on it.

Cost issues

Although pricing has not changed, the actual Token consumption of 1M context is 5x that of 200K. A single full 1M context call costs approximately $3 for input, $0.75 for output (estimated at 50K output), for a total single cost of $3.75. In Agent-frequent-call scenarios, monthly bills may soar from $100 to $500+.

Latency issues

The Prefill stage of 1M context significantly increases time consumption. Measured data:

  • 200K context: Prefill 0.8s, first Token latency 1.2s
  • 1M context: Prefill 4.2s, first Token latency 5.8s

For real-time conversation scenarios, a 5.8-second first Token latency is unacceptable. Anthropic provides a "Streaming Prefill" solution, but requires client-side refactoring.

Ecosystem adaptation

The ecosystem adaptation of 1M context is not yet complete. RAG frameworks, vector databases, Prompt engineering tools, etc. all need adaptation. Anthropic simultaneously released Claude SDK 4.0 and LangChain integration optimizations, but full adaptation of the third-party ecosystem still requires 2-3 months.

VI. Industry Impact: The "Watershed" of the Long-Context Track

Sonnet 4.7's release is widely regarded by the industry as a "watershed" event in the long-context track.

Impact on OpenAI

GPT-5.6's 1M context capability was surpassed by Sonnet 4.7 for the first time, especially lagging by 2.2 percentage points on the key SWE-bench benchmark. OpenAI has reportedly launched the "Project Lighthouse" special project internally to accelerate GPT-5.7 development, with release expected before the end of August 2026.

Impact on the open-source camp

While domestic open-source models such as DeepSeek V5, Kimi K3, and Qwen3-Max have followed up on 1M context, their comprehensive capabilities (especially in agentic tool use and code generation) still have a 5-8 percentage point gap with Sonnet 4.7. Closing this gap depends on continued investment by domestic models in long-context attention mechanisms, Tool Use protocols, and Agent evaluation benchmarks.

Impact on enterprise AI strategy

The combination of 1M context + Tool Use 2.0 allows enterprises to feed complete business documents, code repositories, and historical tickets to the model at once without splitting data. This greatly reduces the engineering threshold of "data preprocessing" in enterprise AI implementation. Gartner predicts in its latest report that in H2 2026, 60%+ of enterprise Agent applications will be built on 1M+ context models.

VII. Conclusion: Context Window Is No Longer a Number Game

The release of Claude Sonnet 4.7 marks the comprehensive shift of large model competition from "parameter race" to "context depth race." But the most important inspiration Anthropic gives to the industry is not the number 1M itself, but the systematic capability building around 1M context—attention mechanisms, position encoding, retrieval augmentation, Tool Use 2.0, Agent evaluation benchmarks, each of which is deep engineering work.

When all vendors are competing on "we support 1M context," Anthropic used 4.7 to prove: the size of the context window is not the goal; being able to maintain high recall, high accuracy, and high Agent capability in 1M context is the true moat.

Next stop, 2M context? Or 10M? Let's wait and see.

References:

  • [1] Anthropic, "Claude Sonnet 4.7 Release Notes", 2026-07-18
  • [2] Anthropic, "Hierarchical Attention Technical Report", 2026-07
  • [3] OpenAI, "GPT-5.6 vs Claude Sonnet 4.7: A Comparative Study", 2026-07
  • [4] DeepSeek, "V5 Technical White Paper", 2026-06
  • [5] SWE-bench Verified Leaderboard, 2026-07
  • [6] Gartner, "Enterprise AI Agent Adoption Forecast", 2026-Q3
  • [7] LexisNexis, "Sonnet 4.7 in Legal Tech: A Case Study", 2026-07
  • [8] Salesforce Engineering Blog, "Einstein + Sonnet 4.7 Integration", 2026-07