[Bug] Excessive token consumption causing unusable API costs
Status Closed — not planned
Reported on v2.1.89
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Apr 1, 2026 · closed May 22, 2026
Bug Description
my tokens are using like there is no tomorrow. I hope Im gonna have it back. Im gonna have to switch to openAI for a while. I can't work.
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.89
- Feedback ID: 51868ce8-d7d9-4c02-bffd-f713711ea0be
Errors
[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/aleksandrazugaj/.local/share/claude/versions/2.1.89 (expected in multi-process scenarios)\n at pb_ (/$bunfs/root/src/entrypoints/cli.js:1891:2138)\n at bc6 (/$bunfs/root/src/entrypoints/cli.js:1891:1218)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:20:49.989Z"},{"error":"Error: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()\n at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12938)\n at emitError (node:events:43:23)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:112:1149)\n at emitError (node:events:43:23)\n at <anonymous> (node:_http_client:253:22)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:09.029Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:13355)\n at emit (node:events:92:22)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:112:3321)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:10.526Z"},{"error":"Error: 1P event logging: 9 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n at queueFailedEvents (/$bunfs/root/src/entrypoints/cli.js:424:2574)\n at async doExport (/$bunfs/root/src/entrypoints/cli.js:424:1516)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:10.557Z"},{"error":"Error: {\"message\":\"Failed to export 9 events (code=ECONNABORTED, timeout of 10000ms exceeded)\",\"originalLine\":\"424\",\"originalColumn\":\"1668\",\"line\":\"424\",\"column\":\"1668\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Failed to export 9 events (code=ECONNABORTED, timeout of 10000ms exceeded)\\n at doExport (/$bunfs/root/src/entrypoints/cli.js:424:1668)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (/$bunfs/root/src/entrypoints/cli.js:1829:4366)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:418:36796)\n at u29 (/$bunfs/root/src/entrypoints/cli.js:418:37340)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:419:19103)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:10.557Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:13355)\n at emit (node:events:92:22)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:112:3321)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:14.044Z"},{"error":"Error: 1P event logging: 14 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n at queueFailedEvents (/$bunfs/root/src/entrypoints/cli.js:424:2574)\n at async doExport (/$bunfs/root/src/entrypoints/cli.js:424:1516)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:47.243Z"},{"error":"Error: {\"message\":\"Failed to export 14 events (code=ECONNABORTED, timeout of 10000ms exceeded)\",\"originalLine\":\"424\",\"originalColumn\":\"1668\",\"line\":\"424\",\"column\":\"1668\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Failed to export 14 events (code=ECONNABORTED, timeout of 10000ms exceeded)\\n at doExport (/$bunfs/root/src/entrypoints/cli.js:424:1668)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (/$bunfs/root/src/entrypoints/cli.js:1829:4366)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:418:36796)\n at u29 (/$bunfs/root/src/entrypoints/cli.js:418:37340)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:419:19103)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-01T06:21:47.243Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:13355)\n at emit (node:events:92:22)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:112:3321)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467…
Note: Content was truncated.
11 Comments
I've been experiencing the same issue on Max 20 ($200/mo) — rate limit 100% exhausted in ~70 minutes.
After setting up a monitoring proxy using the official
ANTHROPIC_BASE_URLenv var, I identified two cache bugs as the root cause (#40524, #34629) and measured the impact: cache read ratio dropped to 4.3%, meaning ~20x token inflation per turn. After applying workarounds it stabilized at 89-99%.Full analysis with per-request measured data, safe workarounds, and community references (including cc-cache-fix): https://github.com/ArkNill/claude-code-cache-analysis
Update (April 2): v2.1.90 has significantly improved cache efficiency — benchmark shows 95-99% cache read in stable sessions (both npm and standalone installations).
If you're still affected:
claude update(ornpm install -g @anthropic-ai/claude-code)"DISABLE_AUTOUPDATER": "1"to~/.claude/settings.jsonenv section--resume(still broken)Note: server-side quota issues (org-level pool sharing, accounting mismatches) remain unresolved — the above fixes the client-side cache drain only.
Benchmark data: https://github.com/ArkNill/claude-code-cache-analysis
I used claude code for 30 min and used 50% of my limit. Max x5. Didn't do
much. Newest version...
czw., 2 kwi 2026, 06:03 użytkownik MJ Hwang @.***>
napisał:
@maiarowsky 30 min → 50% on Max x5 with the newest version is consistent with what others are reporting. v2.1.90 fixes the client-side cache regression, but there appear to be additional factors at play:
If you can check your session logs for entries with
model: "<synthetic>"andinput_tokens: 0, that would confirm whether the #40584 bug is affecting you. The log path is typically~/.claude/projects/*/[session-id].jsonl.Confirmed: #40584 is affecting my setup.
▎
▎
▎
-
26
<synthetic>
entries with
input_tokens: 0
found across 13 sessions in the last 7 days
▎
▎
▎
▎
The v2.1.90 cache regression fix is installed but doesn't resolve this.
Happy to provide full
session logs if helpful.
czw., 2 kwi 2026 o 16:19 MJ Hwang @.***> napisał(a):
Brief update (April 3): v2.1.91 is out and cache behavior is further improved — npm and standalone now perform identically (Sentinel gap closed). However, testing revealed two additional unfixed bugs: a 200K tool result budget cap that silently truncates older results, and a client-side false rate limiter generating
<synthetic>errors without API calls (151 entries confirmed). If you are still seeing drain after updating, these are the likely causes. Details: claude-code-cache-analysis▎
Thanks for the update. Updated to v2.1.91 — noted on the cache fix.
▎
Regarding the two unfixed bugs:
▎
<synthetic>
false rate limiter — confirmed on my end:
26 phantom entries across 13 sessions in the
last 7 days (v2.1.81 through v2.1.90). Worst case: 8 in a single session.
▎
Additional data point:
On v2.1.90, I started a fresh session and wrote
one prompt
— the session
opened at
5% usage already consumed
. That's before any meaningful work. This suggests the drain
isn't just from phantom entries accumulating during a session — something
is being counted at
session init.
▎
Is there a way to confirm whether
<synthetic>
entries and/or session bootstrap are counted against
the Max rate limit? If so, this is a significant portion of the x5 plan
being burned on non-work.
pt., 3 kwi 2026 o 02:41 MJ Hwang @.***> napisał(a):
I just started claude code (2.1.92). first prompt -> 2% of usage gone. max
x5. is that going to be like this?
pt., 3 kwi 2026 o 19:50 Jarl Macci @.***> napisał(a):
Anybody here?
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.