[BUG] Expired Prompt Cache Causes Large Token Re-Caching and Disproportionately Consumes 5-Hour & Weekly Usage Limits in VS Code Agent Mode
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?
I frequently encounter messages such as:
"Idle 1d 10h. The prompt cache has likely expired, so your next message will re-cache about 800k tokens."
and:
"Idle 10d 22h. The prompt cache has likely expired, so your next message will re-cache about 517k tokens."
I understand that prompt caching has a limited lifetime and that, after being idle for a sufficiently long period, the next request may need to re-cache a large amount of context. However, this becomes particularly problematic when working on long-running projects.
For example, I may spend several hours or days working on a large research/coding project, with a very large conversation context. If I return after some time, I am warned that hundreds of thousands of tokens will need to be re-cached. At the same time, the paid Claude plan still imposes the 5-hour usage limit and weekly usage limits, and the impact of these limits can become disproportionately large when working with such large contexts.
This creates a situation where:
- A large amount of context has to be re-cached after the cache expires.
- The re-caching/large-context interaction consumes a significant portion of the available usage capacity.
- The 5-hour limit can then be reached relatively quickly.
- The weekly limit can also jump substantially after intensive work with large contexts.
- As a result, even though I am paying for the service, I cannot consistently make effective use of Claude for long-running projects.
What I would like to request
Could the developers consider providing one or more of the following?
- Longer-lived prompt caching for long-running conversations/projects.
- A way to manually keep important project context cached or mark a conversation/project as persistent.
- A more efficient mechanism for reusing previously cached context after a period of inactivity.
- Better separation between re-caching a large existing context and actual model usage, so that returning to an existing project does not disproportionately consume the user's usage allowance.
- A clear indication of how much of the 5-hour/weekly limit will be consumed before sending a request that requires a large re-cache.
- An option to resume a project from a persistent project context/summary without having to process hundreds of thousands of tokens again.
- Alternatively, some mechanism for users on paid plans to purchase or access additional usage specifically for large-context/long-running workloads.
I completely understand that there are infrastructure and cost considerations behind these limits. My concern is mainly that the current behavior makes Claude difficult to use for long-running research and software-engineering workflows, where conversations can naturally contain hundreds of thousands of tokens and may be revisited after several days.
A user may intentionally maintain a large context because it contains important project history, decisions, code, experiments, and reasoning. Having that context effectively become expensive to reuse after inactivity makes the workflow difficult to sustain.
It would be very helpful if the team could clarify:
Is there currently a recommended workflow for users who maintain very large Claude conversations/projects over weeks or months without continuously keeping the conversation active?
If not, I would strongly request consideration of a persistent-context or more efficient cache-reuse mechanism for paid users.
Thank you for looking into this.
What Should Happen?
The system should not consume a significant amount of my usage allowance simply because a prompt cache has expired.
The expected behavior should be closer to how the service worked in August, where I could use Claude for long-running projects without cache expiration and re-caching causing such a substantial impact on my available usage.
In particular:
- Cache expiration should not effectively "eat up" my available tokens/usage allowance. If the context was already processed previously, re-caching it after inactivity should not substantially penalize the user.
- Re-caching hundreds of thousands of tokens should not disproportionately reduce the 5-hour usage allowance.
- The 5-hour limit should primarily reflect actual model interaction/use rather than the overhead of rebuilding an expired prompt cache.
- The weekly usage limit should ideally be removed for paid users, or at minimum should not be heavily affected by cache re-caching and large-context overhead.
- Paid users should be able to maintain and resume large, long-running projects without being unexpectedly pushed toward their usage limits merely because they were inactive for several days.
- If cache expiration is unavoidable for infrastructure reasons, there should be a mechanism to preserve the benefits of previously processed context without charging the user the equivalent of reprocessing hundreds of thousands of tokens.
Essentially, I should not be penalized for coming back to my own existing conversation after a period of inactivity.
For paid users, the service should provide a predictable experience where token usage, cache expiration, and the 5-hour limit do not compound into a situation where a single large-context conversation consumes a disproportionate amount of the available usage.
At minimum, I would strongly request bringing this behavior back in line with the experience users had in August, and considering removal of the weekly limit for paid users.
Error Messages/Logs
Idle 10d 22h. The prompt cache has likely expired, so your next message will re-cache about 517k tokens.
Steps to Reproduce
- Install Visual Studio Code and the official Claude extension for VS Code.
- Sign in using a paid Claude subscription.
- Open a reasonably large software/research project in VS Code containing source files, documentation, configuration files, and other project context.
- Open Claude in the VS Code extension and switch to Agent Mode.
- Start a long-running conversation with Claude and ask it to work on the project. Allow the conversation to accumulate a large amount of context through multiple requests, file reads, code changes, and analysis.
- Continue using the same conversation/project over multiple sessions so that the context becomes large (in my case, the context can reach hundreds of thousands of tokens).
- Stop using Claude/VS Code for an extended period, for example 1–10+ days, while keeping the same conversation available.
- Return to the same VS Code project and continue the existing Claude Agent Mode conversation.
- Claude displays a message similar to:
> "Idle 1d 10h. The prompt cache has likely expired, so your next message will re-cache about 800k tokens."
or:
> "Idle 10d 22h. The prompt cache has likely expired, so your next message will re-cache about 517k tokens."
- Continue using the conversation. The large re-caching operation then appears to contribute significantly to the available usage, including the 5-hour usage limit, and intensive use can also contribute substantially toward the weekly limit.
- Repeat the process with a large-context conversation after another period of inactivity. The same behavior occurs: cache expiry → large context re-caching → substantial impact on available usage.
Environment
- Editor: Visual Studio Code
- Claude integration: Claude VS Code extension
- Mode: Agent Mode
- Account: Paid Claude subscription
- Project type: Large software/research project
- Conversation: Long-running conversation with a large accumulated context
- Key condition: Conversation is left idle long enough for the prompt cache to expire
Expected observation
Returning to an existing large project after several days should allow the user to continue working without the expired cache effectively consuming a disproportionate amount of their available usage. The cache-expiration/re-caching process should not significantly reduce the 5-hour allowance or compound with the weekly limit.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.251 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
<img width="1071" height="140" alt="Image" src="https://github.com/user-attachments/assets/987100db-df12-4ee6-ae30-cb0fc194570a" />
<img width="1071" height="140" alt="Image" src="https://github.com/user-attachments/assets/b0daf2af-8bbb-4724-b74e-e64c622609e4" />
<img width="1071" height="140" alt="Image" src="https://github.com/user-attachments/assets/aacccd3c-2b1b-4aca-aebf-3136116cb0ba" />