You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Context limit reached · /compact or /clear to continue #19018
This is EXTREMELY frustrating and break causing. This happened in the middle of a refactoring. After running "/compact", I started Claude again, instructed Claude to read the CLAUDE.md, the code and notes, it then ignored other parts of the deployment and did some extra stuff. Then after discussing and reading thru what it broke, the usage limit hit. Then, I did some other things, waited two hours and started again. And again, despite Claude stating it understood what to change, it did something different. And then while researching what it did and discussing why, I ran into the usage limit again! I just wasted two hours with no progress because compacting happens in the middle of coding, Claude looses context and then again when the usage limit is reached! I hate complaining, Claude helped me make incredible progress in two days, but to just stop in the middle of a refactoring, wow! That's not cool.
Reacted by Alberto Lara Hernández, Samson Sprouse, Saman Shahbazi and 6215
same issue. 2.1.12, windows native.
auto-compact : false,
but it seems that it started happening since i used /compact,
any way, i found a workaround on reddit: setting CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE="197000" in powershell.
or just u can go back to 2.1.6 or 2.1.2.
it's just a temporary tweak.
i hope this bug gets fixed ASAP.
Keeps happening to me, doesn't matter if auto-compact is on or off (it's been on though). Right now I'm at 65% and can't even compact.
It only happens when I have subagents. Maybe they're trying to bring in too much context, but I told them to write-to-file and bring back minimal context ("done").
Not only is it annoying, but it's wasting so many tokens.
I'm on the latest Claude Code version (2.1.79), and am still getting the error; "Context limit reached · /compact or /clear to continue" when i try the next prompt even though my sessions' context usage is like roughly 190,000 / 1,000,000, using the model Opus 4.6 (1M context). It's a clear bug 🐞, and it has been going on since previous versions too, where I was hoping the bug would be fixed by now.
I shouldn't need to action the suggested slash commands (/compact, /clear) when i am well within my sessions' context window limit, especially when using a 1M model.
I've just ran into this issue after my first local install and I think I've come across a solution that at least worked for me.
I'm using the latest version.
running /compact wouldn't work
running /rename wouldn't work
running /configauto compact wouldn't work
I then ran /context and noticed I had only used 75% of my tokens.
I then pressed ESC a few times to bring up the Rewind History and then simply just scrolled back up to where I first got the limit message and simply resubmitted my last request and presto I could continue to work without getting that message limit notification.
Hopefully this can help someone work around this bug.
@bcherny@ThariqS - this is issue is still happening to this day, and very frequently, even after all the CC version iteration updates. Can this issue also be looked at?
Reaching apparent rate limit reached error, and having to manually compact my session at around 167k tokens used on the Opus 4.6 (1M context) model just now is not right.
Are we (the affected) missing something?
I even applied these other environment variables to my settings.json, to try and mitigate against the issue, but to no avail:
Activity
github-actions commentedon Jan 18, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
abreufilho commentedon Jan 18, 2026
Same here. Clearly something changed from 2.1.6
jmmirabile commentedon Jan 18, 2026
This is EXTREMELY frustrating and break causing. This happened in the middle of a refactoring. After running "/compact", I started Claude again, instructed Claude to read the CLAUDE.md, the code and notes, it then ignored other parts of the deployment and did some extra stuff. Then after discussing and reading thru what it broke, the usage limit hit. Then, I did some other things, waited two hours and started again. And again, despite Claude stating it understood what to change, it did something different. And then while researching what it did and discussing why, I ran into the usage limit again! I just wasted two hours with no progress because compacting happens in the middle of coding, Claude looses context and then again when the usage limit is reached! I hate complaining, Claude helped me make incredible progress in two days, but to just stop in the middle of a refactoring, wow! That's not cool.
OlaHulleberg commentedon Jan 19, 2026
it seems like Claude Code has stopped parsing
message_deltaevents from the API, and instead bases it's usage on ONLYmessage_startinsteadHCYT commentedon Jan 19, 2026
I’m experiencing the same issue—Claude asks me to compact even with over 30% context remaining.
lutfi238 commentedon Jan 20, 2026
same issue with version 2.1.12 (Claude Code)
mysehyunhope commentedon Jan 20, 2026
same issue. 2.1.12, windows native.
auto-compact : false,
but it seems that it started happening since i used /compact,
any way, i found a workaround on reddit: setting CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE="197000" in powershell.
or just u can go back to 2.1.6 or 2.1.2.
it's just a temporary tweak.
i hope this bug gets fixed ASAP.
overkloud commentedon Feb 15, 2026
even after

/clearor restart of claude the issue persistsseik commentedon Feb 16, 2026
This is happening quite often to me now.
v2.1.42xcybplx commentedon Feb 17, 2026
The same here
NathanR-85 commentedon Feb 18, 2026
Keeps happening to me, doesn't matter if auto-compact is on or off (it's been on though). Right now I'm at 65% and can't even compact.
It only happens when I have subagents. Maybe they're trying to bring in too much context, but I told them to write-to-file and bring back minimal context ("done").
Not only is it annoying, but it's wasting so many tokens.
tandemloop commentedon Feb 24, 2026
happening in 2.1.44 as well still
jakebromberg commentedon Mar 3, 2026
Still happening with 2.1.63
iJiaHaoZhong commentedon Mar 17, 2026
v2.1.74 allway on,but i open 1M context mode
Sayvai commentedon Mar 19, 2026
I'm on the latest Claude Code version (
2.1.79), and am still getting the error;"Context limit reached · /compact or /clear to continue"when i try the next prompt even though my sessions' context usage is like roughly 190,000 / 1,000,000, using the modelOpus 4.6 (1M context). It's a clear bug 🐞, and it has been going on since previous versions too, where I was hoping the bug would be fixed by now.I shouldn't need to action the suggested slash commands (
/compact,/clear) when i am well within my sessions' context window limit, especially when using a 1M model.0nly1ken0bi commentedon Mar 28, 2026
Solution
I've just ran into this issue after my first local install and I think I've come across a solution that at least worked for me.
I'm using the latest version.
running
/compactwouldn't workrunning
/renamewouldn't workrunning
/configauto compactwouldn't workI then ran
/contextand noticed I had only used 75% of my tokens.I then pressed
ESCa few times to bring up theRewindHistory and then simply just scrolled back up to where I first got the limit message and simply resubmitted my last request and presto I could continue to work without getting that message limit notification.Hopefully this can help someone work around this bug.
Sayvai commentedon Apr 13, 2026
@bcherny @ThariqS - this is issue is still happening to this day, and very frequently, even after all the CC version iteration updates. Can this issue also be looked at?
Reaching apparent rate limit reached error, and having to manually compact my session at around
167ktokens used on theOpus 4.6 (1M context)model just now is not right.Are we (the affected) missing something?
I even applied these other environment variables to my
settings.json, to try and mitigate against the issue, but to no avail:{ "env": { "CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE": "1000000", "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "90" }, }ifzm commentedon Apr 18, 2026
Encountered the same problem and could not execute the command /compact, only /clear 🙍♂️