Allow context warnings to be configurable
20% is too low given how much performance drops off. It used to be 40%. It would be good if there was a setting to set the percentage when the warning comes up - or a way to configure this via the status bar agent. The context command is useful, but it's manual. The less friction the better.
Hey, I've noticed this too and it's definitely been a point of friction. You're right, the threshold was changed. I did a quick dig through the changelog, and it looks like version 1.0.51 "Increased auto-compact warning threshold from 60% to 80%". So your memory is spot on.
While there isn't a direct setting to configure that percentage (which I agree would be ideal), I've found a couple of workarounds from the docs that might help you manage it better:
-
Disable Auto-Compact Entirely: If the warning is more annoying than helpful, you can turn it off. Just run
/configand toggle "Auto-compact enabled" to off. You'll have to rely on manually running/contextand/compactwhen you feel performance degrading, but at least you control when it happens. -
Create a Custom Status Line: This is a bit more involved, but it gets closer to what you're asking for. You can create a custom script that acts as your status line. According to the changelog for
v1.0.88, the data piped to the status line script now includes anexceeds_200k_tokensflag. You could write a simple script to parse that JSON input and display a custom warning in your status line when your context gets high, giving you a persistent, visual indicator without the intrusive popup. You can get started with/statusline. -
Use a
PreCompactHook (Advanced): This is the most powerful option. You can set up a script that runs right before an auto-compact is triggered. This hook could send you a desktop notification or print a custom message, giving you a chance to intervene before Claude compacts the context.
It's not a perfect substitute for a simple percentage setting, but hopefully one of those helps reduce the friction for you.
+1 for adding a compactWarningThreshold key to settings.json though. That would be the cleanest solution by far.
@coygeek I have tried numerous times to get accurate context window counts in the statusline but haven't been able to do it. Have you had any success?
Check out:
https://github.com/sirmalloc/ccstatusline and https://github.com/ryoppippi/ccusage
@coygeek Thank your for the inputs. I personally built myself a custom status line that makes use of ccusage and a custom script. I also turned off auto-compacting. But I still get warnings as soon as I get close to ~75% context usage that I have ~10% left (so compacting seems to be recommended at 85%).
I would like to turn that off too, since I can see at all times with my approach where I'm currently at.
My status line looks like this with automatic yellow/red coloring at 50%/80% passing:
So I manage compacting myself, but the built-in warning breaks my status line visually, which is ugly:
tl:dr – Please add an option to turn off the warning entirely!
@coygeek Thank your for the inputs. I personally built myself a custom status line that makes use of ccusage and a custom script. I also turned off auto-compacting. But I still get warnings as soon as I get close to ~75% context usage that I have ~10% left (so compacting seems to be recommended at 85%).
I would like to turn that off too, since I can see at all times with my approach where I'm currently at.
My status line looks like this with automatic yellow/red coloring at 50%/80% passing:
So I manage compacting myself, but the built-in warning breaks my status line visually, which is ugly:
tl:dr – Please add an option to turn off the warning entirely!
care to share how you made that statusline? what api does it use under the hood to get the remaining context?
@vinc3m1 I open-sourced my custom status line in my ContextKit CC framework/plugin, find the full implementation here: https://github.com/FlineDev/ContextKit/blob/main/Templates/Scripts/CustomStatusline.sh
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.
Following up, as my issue was auto-closed as a duplicate, but this reference issue was also closed. This would be a great feature as part of the Claude Code (no plugins / hooks required)!

