[Bug] Excessive token consumption causing unusable API costs

Status Closed — not planned
Reported on v2.1.89
Maintainer reply None cached
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.

View original on GitHub ↗

11 Comments

ArkNill · 5 months ago

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_URL env 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

ArkNill · 5 months ago

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:

  1. Update: claude update (or npm install -g @anthropic-ai/claude-code)
  2. Pin the version: add "DISABLE_AUTOUPDATER": "1" to ~/.claude/settings.json env section
  3. Avoid --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

maiarowsky · 5 months ago

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ł:

ArkNill left a comment (anthropics/claude-code#41859) <https://github.com/anthropics/claude-code/issues/41859#issuecomment-4174666991> 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: 1. Update: claude update (or npm install -g @anthropic-ai/claude-code) 2. Pin the version: add "DISABLE_AUTOUPDATER": "1" to ~/.claude/settings.json env section 3. Avoid --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 — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/41859?email_source=notifications&email_token=BARNSFIXWDKA53X3ZURBJU34TXYAJA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJXGQ3DMNRZHEY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4174666991>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BARNSFPEGZZTVVWZLNYACTD4TXYAJAVCNFSM6AAAAACXIY36MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNZUGY3DMOJZGE> . You are receiving this because you authored the thread.Message ID: @.***>
ArkNill · 5 months ago

@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:

  • Possible server-side accounting change (see #37394 — old Docker versions that were never updated also started draining fast recently)
  • Client-side false rate limiter bug (#40584) that blocks requests without calling the API

If you can check your session logs for entries with model: "<synthetic>" and input_tokens: 0, that would confirm whether the #40584 bug is affecting you. The log path is typically ~/.claude/projects/*/[session-id].jsonl.

maiarowsky · 5 months ago

Confirmed: #40584 is affecting my setup.

  • Claude Code v2.1.90 on macOS (Darwin 24.6.0)

  • Plan: Max x5


-
26
<synthetic>
entries with
input_tokens: 0
found across 13 sessions in the last 7 days

  • Worst case: 8 phantom entries in a single session (129eb533, v2.1.88)

  • Still present on v2.1.90 (1 entry in session bc2ba785)

  • Versions affected: v2.1.81 through v2.1.90


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):

ArkNill left a comment (anthropics/claude-code#41859) <https://github.com/anthropics/claude-code/issues/41859#issuecomment-4178633350> @maiarowsky <https://github.com/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: - Possible server-side accounting change (see #37394 <https://github.com/anthropics/claude-code/issues/37394> — old Docker versions that were never updated also started draining fast recently) - Client-side false rate limiter bug (#40584 <https://github.com/anthropics/claude-code/issues/40584>) that blocks requests without calling the API If you can check your session logs for entries with model: "<synthetic>" and input_tokens: 0, that would confirm whether the #40584 <https://github.com/anthropics/claude-code/issues/40584> bug is affecting you. The log path is typically ~/.claude/projects//[session-id].jsonl. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/41859?email_source=notifications&email_token=BARNSFM5H4BRRGXGHLGUFPL4T2AINA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJXHA3DGMZTGUYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4178633350>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BARNSFLL2EUL2XVLIEMTUXL4T2AINAVCNFSM6AAAAACXIY36MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCNZYGYZTGMZVGA> . You are receiving this because you were mentioned.Message ID: @.**>
ArkNill · 5 months ago

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

maiarowsky · 4 months ago


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):

ArkNill left a comment (anthropics/claude-code#41859) <https://github.com/anthropics/claude-code/issues/41859#issuecomment-4181337421> 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 <https://github.com/ArkNill/claude-code-cache-analysis> — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/41859?email_source=notifications&email_token=BARNSFJ2HFK7ASSMJGAWMPD4T4JFPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJYGEZTGNZUGIY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4181337421>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BARNSFIYFL4WOEFNIA4GIDL4T4JFPAVCNFSM6AAAAACXIY36MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCOBRGMZTONBSGE> . You are receiving this because you were mentioned.Message ID: @.***>
maiarowsky · 4 months ago

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):

▎ 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): > ArkNill left a comment (anthropics/claude-code#41859) > <https://github.com/anthropics/claude-code/issues/41859#issuecomment-4181337421> > > 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 > <https://github.com/ArkNill/claude-code-cache-analysis> > > — > Reply to this email directly, view it on GitHub > <https://github.com/anthropics/claude-code/issues/41859?email_source=notifications&email_token=BARNSFJ2HFK7ASSMJGAWMPD4T4JFPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJYGEZTGNZUGIY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4181337421>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/BARNSFIYFL4WOEFNIA4GIDL4T4JFPAVCNFSM6AAAAACXIY36MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCOBRGMZTONBSGE> > . > You are receiving this because you were mentioned.Message ID: > @.***> >
maiarowsky · 4 months ago

Anybody here?

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 1 month ago

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.