claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Feature: Long-context (≈1M) support for Claude Sonnet 4 in Claude Code

Open gaiar opened this issue 4 months ago • 7 comments

Summary

Please add first-class support in Claude Code (CLI / IDE integrations) for Claude Sonnet 4’s 1M-token context window and expose a way to pass Anthropic beta headers—specifically context-1m-2025-08-07. This would let the tool operate on entire repos / large docs without manual chunking. – Anthropic docs: 1M context + required beta header. Anthropic

– Availability: Anthropic API + Amazon Bedrock (Vertex AI “coming soon”). Anthropic

Problem

There isn’t a straightforward, tool-level way to enable long-context when it’s available on the account/provider. Whole-repo refactors and cross-file reasoning require dropping down to raw API calls or ad-hoc configs.

Proposal

  • Provide a simple toggle/setting to enable long-context mode when supported by the account/provider.
  • Abstract provider-specific opt-ins behind Claude Code’s config/UI.
  • Document expected limits, pricing/rate-limit considerations, and failure modes.
  • Gracefully handle ineligible accounts with clear, actionable messaging instead of hard errors.
  • Optional: when prompts approach the default context, nudge users to enable long-context (non-blocking).

Why this helps

Enables whole-repo operations, large-scale refactors, and multi-doc synthesis—the core Claude Code use cases—without extra glue code.

gaiar avatar Aug 15 '25 11:08 gaiar

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5644
  2. https://github.com/anthropics/claude-code/issues/5628

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Aug 15 '25 11:08 github-actions[bot]

Found 2 possible duplicate issues:

  1. Feature Request: Enable 1M Context Window for Claude Code #5644
  2. Feature Request: 1M Context with Max Plans in CC #5628

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

I need implementation for AWS Bedrock as well

gaiar avatar Aug 15 '25 11:08 gaiar

gaiar the just updated to 1M tokens for sonnet earlier this week

I don't get what you mean - I see updates for native Anthropic API usage, but I don't see way how to use it using AWS Bedrock.

gaiar avatar Aug 15 '25 12:08 gaiar

Anthropic have not made enough money on the double price of api usage on 1M model

Adamcf123 avatar Aug 28 '25 22:08 Adamcf123

Now is the time to support this feature:

3 - Claude Sonnet 4.5 supports a 1M token context window when using the context-1m-2025-08-07 beta header. Long context pricing applies to requests exceeding 200K tokens.


behrangsa avatar Oct 28 '25 14:10 behrangsa

Would love to have 1M context on Claude Web too for projects!

christianvuye avatar Nov 07 '25 05:11 christianvuye

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 11 '25 10:12 github-actions[bot]

Any updates?

MikeFeith avatar Dec 11 '25 14:12 MikeFeith

upvote

andriihrachov avatar Dec 17 '25 10:12 andriihrachov