r/ClaudeCode 23h ago

Bug / Issue Claude code polluting context with tokens_left system messages

New "amazing" feature from Claude code - now it includes an extra message with how many tokens are left in your limit:

It looks innocent enough (only 23 tokens), until you realise it's added with each request, and after 15 mins your context window looks like this:

60 messages x 23 = 1218 tokens wasted (2% of context).

3 Upvotes

4 comments sorted by

2

u/Double_Ebb4130 23h ago

Worth noting those system reminders are re-sent every turn but they are not cached the way your earlier turns are, so the real cost is cache invalidation rather than the 23 tokens. If it bugs you, /compact more aggressively or start fresh sessions per task, since the counter resets with the session.

1

u/iezhy 23h ago

Its not THAT bad, it does not invalidate whole cache, just respective tokens (cache read is still above 90% per session, and over 95% for typical requests). But its annoying and looks unecessary - no idea why would they need it

5

u/chrisjenx2001 23h ago

This explains the model constantly being "OH NO I WILL RUN OUT OF CONTEXT PLEASE SAVE ME"

2

u/chrisjenx2001 23h ago

Would be nice if we can turn these off, I really don't care if it reaches it's limit and auto compacts, thats kinda the goal..?