[BUG] Context limit reached · /compact or /clear to continue
Open 💬 18 comments Opened Jan 18, 2026 by xlsi
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Auto-compact is off, but claude stops when there are still 30% context left.
<img width="2680" height="348" alt="Image" src="https://github.com/user-attachments/assets/63b704a8-9614-4b9c-9987-2ce7ce25f397" />
What Should Happen?
It should allow me to keep working with the warning showing but non-blocking
Error Messages/Logs
Steps to Reproduce
- turn off auto-compact,
- use 2.1.7 and above version.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.6 (Claude Code)
Claude Code Version
2.1.12 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
18 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same here. Clearly something changed from 2.1.6
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.
it seems like Claude Code has stopped parsing
message_deltaevents from the API, and instead bases it's usage on ONLYmessage_startinsteadI’m experiencing the same issue—Claude asks me to compact even with over 30% context remaining.
same issue with version 2.1.12 (Claude Code)
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.
even after
/clearor restart of claude the issue persists<img width="911" height="531" alt="Image" src="https://github.com/user-attachments/assets/81ca03f5-0bc6-415c-8f95-23b8ecb7d722" />
This is happening quite often to me now.
v2.1.42The same here
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.
happening in 2.1.44 as well still
Still happening with 2.1.63
v2.1.74 allway on,but i open 1M context mode
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.<img width="1126" height="426" alt="Image" src="https://github.com/user-attachments/assets/8ad6ce52-4de3-4b4a-8c54-cffee0980d5e" />
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.
@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:Encountered the same problem and could not execute the command /compact, only /clear 🙍♂️