claude-code - 💡(How to fix) Fix [Bug] Claude Code generates non-functional code and wastes tokens without executing tasks [1 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#48504Fetched 2026-04-16 06:58:21
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

[{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011Ca1eo1th1AtiNPFkhCEem"}\n at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53266)\n at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T10:58:47.348Z"},{"error":"MaxFileReadTokenExceededError: File content (11709 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T11:25:00.399Z"},{"error":"MaxFileReadTokenExceededError: File content (13165 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T12:30:55.985Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\Users\morpr\AppData\Local\Temp\claude\C--Users-morpr-Desktop-proservice\797b141a-e14f-4ede-83da-c72c4d6e8663\tasks\aabc18c7056051a23.output'\n at async unlink (node:internal/fs/promises:1058:10)\n at async file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8034:340","timestamp":"2026-04-13T13:43:02.338Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 202659 tokens > 200000 maximum"},"request_id":"req_011Ca1sKmK7H28tzuDcHdDsM"}\n at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53044)\n at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T13:43:04.128Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\Users\morpr\AppData\Local\Temp\claude\C--Users-morpr-Desktop-proservice\797b141a-e14f-4ede-83da-c72c4d6e8663\tasks\aeec89fca0c405116.output'\n at async unlin…

Code Example

[{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011Ca1eo1th1AtiNPFkhCEem\"}\n    at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53266)\n    at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n    at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T10:58:47.348Z"},{"error":"MaxFileReadTokenExceededError: File content (11709 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T11:25:00.399Z"},{"error":"MaxFileReadTokenExceededError: File content (13165 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T12:30:55.985Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\\Users\\morpr\\AppData\\Local\\Temp\\claude\\C--Users-morpr-Desktop-proservice\\797b141a-e14f-4ede-83da-c72c4d6e8663\\tasks\\aabc18c7056051a23.output'\n    at async unlink (node:internal/fs/promises:1058:10)\n    at async file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8034:340","timestamp":"2026-04-13T13:43:02.338Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 202659 tokens > 200000 maximum\"},\"request_id\":\"req_011Ca1sKmK7H28tzuDcHdDsM\"}\n    at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53044)\n    at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n    at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T13:43:04.128Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\\Users\\morpr\\AppData\\Local\\Temp\\claude\\C--Users-morpr-Desktop-proservice\\797b141a-e14f-4ede-83da-c72c4d6e8663\\tasks\\aeec89fca0c405116.output'\n    at async unlin…
RAW_BUFFERClick to expand / collapse

Bug Description קלוד בטרמינל VS ממשיך לשקר ולא מבצע כלום.מבזבז את הטוקנים .רק משקר זה הונאה אני משלם כסף ושום דבר לא מתבצע אחרי שמתייב 100% שהכל בנוי היטב ומודה שטעה וממשיך בזבז לי את כל השבוע האחרון רק שקרים זה הונה הונאה הונאה הונאה !!!!!! אני מבקש להתיחס ברצינות לכל מה שקורה כאן

Environment Info

  • Platform: win32
  • Terminal: vscode
  • Version: 2.1.104
  • Feedback ID: 9416e6df-a4fa-4d8f-8e69-330947a77048

Errors

[{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011Ca1eo1th1AtiNPFkhCEem\"}\n    at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53266)\n    at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n    at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T10:58:47.348Z"},{"error":"MaxFileReadTokenExceededError: File content (11709 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T11:25:00.399Z"},{"error":"MaxFileReadTokenExceededError: File content (13165 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at eEK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n    at async qyK (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-13T12:30:55.985Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\\Users\\morpr\\AppData\\Local\\Temp\\claude\\C--Users-morpr-Desktop-proservice\\797b141a-e14f-4ede-83da-c72c4d6e8663\\tasks\\aabc18c7056051a23.output'\n    at async unlink (node:internal/fs/promises:1058:10)\n    at async file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8034:340","timestamp":"2026-04-13T13:43:02.338Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 202659 tokens > 200000 maximum\"},\"request_id\":\"req_011Ca1sKmK7H28tzuDcHdDsM\"}\n    at aq.generate (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:8:53044)\n    at gL.makeStatusError (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:1652)\n    at gL.makeRequest (file:///C:/Users/morpr/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:47:4928)\n    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","timestamp":"2026-04-13T13:43:04.128Z"},{"error":"Error: ENOENT: no such file or directory, unlink 'C:\\Users\\morpr\\AppData\\Local\\Temp\\claude\\C--Users-morpr-Desktop-proservice\\797b141a-e14f-4ede-83da-c72c4d6e8663\\tasks\\aeec89fca0c405116.output'\n    at async unlin…

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix is to address the rate limit errors and file size limits by modifying the request parameters or handling the errors programmatically.

Guidance

  1. Rate Limit Errors: The error messages indicate that the requests are exceeding the account's rate limit. Consider implementing a delay between requests or handling the rate limit errors by retrying the requests after a certain period.
  2. File Size Limits: The MaxFileReadTokenExceededError suggests that the file content exceeds the maximum allowed tokens. Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.
  3. Error Handling: Implement proper error handling to catch and handle the errors, such as ENOENT and invalid_request_error, to prevent the program from crashing.
  4. Request Validation: Validate the request parameters, such as the prompt length, to ensure they are within the allowed limits before making the request.
  5. Temporary Workaround: Consider reducing the file size or prompt length to temporarily work around the issues.

Example

// Example of handling rate limit errors
async function makeRequest() {
  try {
    // Make the request
  } catch (error) {
    if (error.type === 'rate_limit_error') {
      // Wait for a certain period before retrying
      await new Promise(resolve => setTimeout(resolve, 1000));
      makeRequest();
    } else {
      throw error;
    }
  }
}

Notes

The provided error messages and code snippets are truncated, which may limit the ability to provide a comprehensive solution. Additionally, the issue may be related to the specific implementation or configuration of the @anthropic-ai/claude-code library.

Recommendation

Apply a workaround by modifying the request parameters and implementing error handling to address the rate limit errors and file size limits. This will help prevent the program from crashing and provide a more robust solution.

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