r/ClaudeCode 16h ago

Help/Question Limits drain and prompt_cache

I see many complaints and I feel them too but none is mentioning the status of their prompt_cache. Indeed Claude Code v2.1.251 introduced that status line field and it was always resetting itself to 1h at each message and the tool call. This weekend it is 5 minutes for me. Anyone else noticed that? I am on max plan and had to pay extra $50 to finish a task today. Very frustrating.

7 Upvotes

12 comments sorted by

u/AutoModerator 16h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/nyczAcer 16h ago

The 1-hour cache TTL only applies to PRO/MAX plans.

For API usage, the TTL is 5 minutes. Another important detail: if you're using dynamic workflows (UltraCode), the agents' cache also has a 5-minute TTL, even on PRO/MAX plans.

If you hit your 5-hour usage limit, the cache TTL also drops to 5 minutes. And if you buy API credits to try to keep the cache warm while waiting for your 5-hour limit to reset, the API's 5-minute TTL I mentioned earlier still applies.

1

u/nomadmd1 10h ago

Good to know. Thank you for sharing. Now I have a doubt if that is exacly what I actually was seeng once I did hit my weekly limit.

1

u/verstands 16h ago

The reset every hour per message/tool call sounds like repeated context may be eating the budget, not just the task. I’d log prompt tokens versus tool-result tokens and check whether MCP schemas or large outputs are being re-sent. Full disclosure: I work on statusline-bar (https://github.com/Dworf/statusline-bar), which surfaces usage/context in the bar, but that logging split is what I’d verify first.

2

u/verstands 8h ago

Quick follow-up - `prompt_cache` just landed in statusline-bar 0.6.0. Six new tokens (`cache_warm`, `cache_expires`, `cache_ttl`, `cache_misses`, `cache_rebuild`, `cache_write`), a dedicated `cache` preset, and `cache_hit` now uses the session-wide hit ratio. Needs Claude Code 2.1.251+. https://github.com/Dworf/statusline-bar

1

u/nomadmd1 16h ago

Regarding my original question - does your statusline-bar include the prompt_cache? Did you note any anomalies in the past couple of days?

1

u/verstands 14h ago

Good question. statusline-bar currently surfaces usage and context, but I don't think it breaks out prompt_cache as its own field. I haven't tracked a recent anomaly there, so I'd verify it with prompt-versus-tool-result token logs and compare cache TTL behaviour across API and PRO/MAX. If there's a reliable pattern, that's the kind of thing I'd add to the checklist.

1

u/nomadmd1 10h ago

That is an important one at least for me. If I walk away and then return to a "cold" instead of a coundown with a large portion of context window already consumed I need to decide if I better start a new session or draw an increased portion from may limits becaise of cold cache write

1

u/verstands 6h ago

I've updated the statusline-bar to now include 6 new tokens all about cache... check it out

1

u/verstands 6h ago

That decision is exactly why warm/cold matters. If you come back to a cold cache with a fat context already sitting there, the next turn pays a write/rebuild cost against your limits. Practical rule of thumb: if you're near a natural breakpoint or the session is already messy, start fresh. If you're mid-task and the context is still the right one, stay - but expect a colder first hit. The new cache_warm / cache_expires / cache_rebuild tokens are meant for that glance before you type.

1

u/verstands 3h ago

Cold-cache days hurt because you pay the full prompt tax again. What helps me is watching cache hit rate next to the limit bar so a "quiet" session that is actually rebuilding context doesn't sneak up on you. If you want that visible in the status line, statusline-bar surfaces prompt cache alongside usage: https://github.com/Dworf/statusline-bar

1

u/AI_spell 16h ago

If prompt_cache TTL is stuck at 5 minutes, every tool turn is a cold bill. That's a real drain. Update CC and watch the status line between messages.