claude-code - 💡(How to fix) Fix [Bug] Prompt cache invalidation causing excessive token consumption on minor edits

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n at Jwq (/$bunfs/root/src/entrypoints/cli.js:253:283620)\n at async Apq (/$bunfs/root/src/entrypoints/cli.js:406:898)\n at async iE6 (/$bunfs/root/src/entrypoints/cli.js:406:796)\n at async hq_ (/$bunfs/root/src/entrypoints/cli.js:2727:2084)\n at async ZDH (/$bunfs/root/src/entrypoints/cli.js:2752:5698)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2776:3358)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:31:27.913Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13344)\n at emit (node:events:92:22)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:18.300Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:57.959Z"}]

Code Example

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at Jwq (/$bunfs/root/src/entrypoints/cli.js:253:283620)\n    at async Apq (/$bunfs/root/src/entrypoints/cli.js:406:898)\n    at async iE6 (/$bunfs/root/src/entrypoints/cli.js:406:796)\n    at async hq_ (/$bunfs/root/src/entrypoints/cli.js:2727:2084)\n    at async ZDH (/$bunfs/root/src/entrypoints/cli.js:2752:5698)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2776:3358)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:31:27.913Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13344)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:18.300Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:57.959Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Subject: Excessive token burn and logic regression in latest session. Issue: Claude Code consumed ~30% of my 5-hour quota in just 10 minutes for minor edits. Cache Invalidation: The tool seems to be re-reading the entire context window every turn despite minimal changes. Logic Errors: Claude failed to prioritize correct units (e.g., suggested 'Kilogram' instead of 'Gram' for '100 g' input) and UI overlaps on dropdowns. Efficiency: I had to manually guide it to fix basic CSS/logic issues that should have been trivial. Please investigate why the prompt caching is failing so aggressively in this session.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.114
  • Feedback ID: f3e9c4ee-0ae3-4104-9976-5aa0a59d6829

Errors

[{"error":"Error: Failed to delete keychain entry: security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n    at Jwq (/$bunfs/root/src/entrypoints/cli.js:253:283620)\n    at async Apq (/$bunfs/root/src/entrypoints/cli.js:406:898)\n    at async iE6 (/$bunfs/root/src/entrypoints/cli.js:406:796)\n    at async hq_ (/$bunfs/root/src/entrypoints/cli.js:2727:2084)\n    at async ZDH (/$bunfs/root/src/entrypoints/cli.js:2752:5698)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:2776:3358)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:31:27.913Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13344)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:18.300Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T16:30:57.959Z"}]

extent analysis

TL;DR

The issue can be mitigated by investigating and resolving the cache invalidation problem that causes the tool to re-read the entire context window every turn, despite minimal changes.

Guidance

  • Investigate the cache invalidation logic to determine why it's not working as expected, focusing on the SecKeychainSearchCopyNext error.
  • Check the cli.js file at lines 253, 406, and 2727 to understand the context of the Failed to delete keychain entry error.
  • Review the Axios timeout settings, as the timeout of 5000ms exceeded error may indicate a network or server-side issue.
  • Consider increasing the timeout value or optimizing the request to reduce the load on the server.

Example

No code snippet is provided, as the issue requires further investigation into the cache invalidation logic and error handling.

Notes

The provided errors and environment information suggest a complex issue that may require additional debugging and investigation to fully resolve. The SecKeychainSearchCopyNext error and Axios timeout may be related to the cache invalidation problem.

Recommendation

Apply a workaround by optimizing the cache invalidation logic and increasing the Axios timeout value, as this may help mitigate the issue until a permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING