claude-code - 💡(How to fix) Fix [Bug] Rate limit error at 72% token usage [3 comments, 3 participants]

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…
GitHub stats
anthropics/claude-code#47113Fetched 2026-04-13 05:41:06
View on GitHub
Comments
3
Participants
3
Timeline
6
Reactions
1
Author
Timeline (top)
commented ×3labeled ×3

Error Message

[{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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)","timestamp":"2026-04-12T21:19:16.004Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 209375 tokens > 200000 maximum"},"request_id":"req_011CZzaJU6FVzDrNhvLAntgu"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:18.849Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 204890 tokens > 200000 maximum"},"request_id":"req_011CZzaJsebFeTkjYKXAcKHz"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:25.045Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 212723 tokens > 200000 maximum"},"request_id":"req_011CZzaKL1cK9Jei2jZecQUg"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:31.232Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:33.853Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 208210 tokens > 200000 maximum"},"request_id":"req_011CZzaKnXJESeRWvJDWTrFM"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:37.145Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 211623 tokens > 200000 maximum"},"request_id":"req_011CZzaLE2DjEQui1F4wmRfC"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:43.556Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 209075 tokens > 200000 maximum"},"request_id":"req_011CZzaLhB7MQbwi56dMnT18"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:50.253Z"},{"error":"Error: ECONNREFUSED\n at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:52.167Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 211254 tokens > 200000 maximum"},"request_id":"req_011CZzaMBtWUmun56zTD41h4"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n at makeRequest (…

Code Example

[{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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)","timestamp":"2026-04-12T21:19:16.004Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 209375 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaJU6FVzDrNhvLAntgu\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:18.849Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 204890 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaJsebFeTkjYKXAcKHz\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:25.045Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 212723 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaKL1cK9Jei2jZecQUg\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:31.232Z"},{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:33.853Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 208210 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaKnXJESeRWvJDWTrFM\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:37.145Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211623 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaLE2DjEQui1F4wmRfC\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:43.556Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 209075 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaLhB7MQbwi56dMnT18\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:50.253Z"},{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:52.167Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211254 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaMBtWUmun56zTD41h4\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (
RAW_BUFFERClick to expand / collapse

Bug Description i'm at 72% usage and I'm getting a rate limited error

Environment Info

  • Platform: linux
  • Terminal: kitty
  • Version: 2.1.104
  • Feedback ID: 1c965b79-1cab-4356-bbec-0115ee97e039

Errors

[{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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)","timestamp":"2026-04-12T21:19:16.004Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 209375 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaJU6FVzDrNhvLAntgu\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:18.849Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 204890 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaJsebFeTkjYKXAcKHz\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:25.045Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 212723 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaKL1cK9Jei2jZecQUg\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:31.232Z"},{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:33.853Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 208210 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaKnXJESeRWvJDWTrFM\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:37.145Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211623 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaLE2DjEQui1F4wmRfC\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:43.556Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 209075 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaLhB7MQbwi56dMnT18\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-12T21:19:50.253Z"},{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:105:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12934)\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-12T21:19:52.167Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 211254 tokens > 200000 maximum\"},\"request_id\":\"req_011CZzaMBtWUmun56zTD41h4\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:53185)\n    at makeRequest (…

Note: Content was truncated.

extent analysis

TL;DR

Reduce the prompt length to below 200,000 tokens to resolve the "prompt is too long" error.

Guidance

  • Identify the source of the long prompt and shorten it to comply with the 200,000 token limit.
  • Verify the prompt length before sending the request to avoid "prompt is too long" errors.
  • Consider implementing a prompt length check in your code to handle such errors programmatically.
  • Review the API documentation for any specific guidelines on prompt length limits and handling.

Example

No specific code example can be provided without knowing the exact implementation details, but a general approach would involve checking the length of the prompt before making the request:

if (prompt.length > 200000) {
  // Handle the error, potentially by shortening the prompt or displaying an error message
} else {
  // Proceed with the request
}

Notes

The provided error messages indicate that the prompt exceeds the maximum allowed length of 200,000 tokens, leading to "prompt is too long" errors. Reducing the prompt length should resolve these errors. However, without more context about the application or the specific requirements of the prompt, it's challenging to provide a more detailed solution.

Recommendation

Apply a workaround by shortening the prompt to comply with the 200,000 token limit, as this directly addresses the error messages provided.

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

claude-code - 💡(How to fix) Fix [Bug] Rate limit error at 72% token usage [3 comments, 3 participants]