claude-code - 💡(How to fix) Fix [BUG] Context Limit reached, when only 27% is used [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51915Fetched 2026-04-23 07:41:30
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
2
Timeline (top)
labeled ×5commented ×2

Error Message

⎿ Error: Error during compaction: API Error: Extra usage is required for 1M context · run /extra-usage to

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Whenever i use claude code, i'm using 2.1.117. I'm getting Context limit reached, whenever i try compacting, i get: ❯ /compact ⎿ Error: Error during compaction: API Error: Extra usage is required for 1M context · run /extra-usage to enable, or /model to switch to standard context

If i run /context, this is my output: /context ⎿ Context Usage ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛀ ⛀ ⛀ Sonnet 4.6 ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-sonnet-4-6 ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ 53.6k/200k tokens (27%) ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ Estimated usage by category ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ System prompt: 6.5k tokens (3.2%) ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ System tools: 7.8k tokens (3.9%) ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ Custom agents: 417 tokens (0.2%) ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ Memory files: 195 tokens (0.1%) ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ Skills: 1.3k tokens (0.7%) ⛁ Messages: 2.4m tokens (1178.1%) ⛝ Autocompact buffer: 33k tokens (16.5%)

What Should Happen?

Fix claude code

Error Messages/Logs

Steps to Reproduce

Use claude code, no matter if using Opus 4.6 or sonnet 4.6, get to 27% context and it will start doing it

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

claude --version ⎿  Context limit reached · /compact or /clear to continue (but it's 2.1.117

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by running the /extra-usage command to enable extra usage for the 1M context or switching to the standard context using the /model command.

Guidance

  • The error message indicates that the context limit has been reached, and the /compact command is not sufficient to resolve the issue.
  • Running the /context command provides a breakdown of the context usage, which shows that the "Messages" category is exceeding the context limit (1178.1%).
  • To resolve the issue, the user can try running the /extra-usage command to enable extra usage for the 1M context.
  • Alternatively, the user can switch to the standard context using the /model command to avoid the context limit issue.

Example

No code snippet is provided as the issue is related to the usage of the Claude Code tool and its commands.

Notes

The issue is reported as a regression, and the user is using the latest version of Claude Code (2.1.117). The problem occurs when the context usage reaches 27%, regardless of the model used (Opus 4.6 or Sonnet 4.6).

Recommendation

Apply the workaround by running the /extra-usage command to enable extra usage for the 1M context, as this is the most straightforward solution to mitigate the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING