claude-code - 💡(How to fix) Fix [Bug] Chat halts on API error with no recovery mechanism [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#47894Fetched 2026-04-15 06:39:16
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Error Message

[{"error":"MaxFileReadTokenExceededError: File content (177714 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:39.517Z"},{"error":"MaxFileReadTokenExceededError: File content (54492 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:53.021Z"},{"error":"MaxFileReadTokenExceededError: File content (17091 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:00.524Z"},{"error":"MaxFileReadTokenExceededError: File content (15815 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:01.137Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:13.932Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:14.086Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code…

Code Example

[{"error":"MaxFileReadTokenExceededError: File content (177714 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:39.517Z"},{"error":"MaxFileReadTokenExceededError: File content (54492 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:53.021Z"},{"error":"MaxFileReadTokenExceededError: File content (17091 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:00.524Z"},{"error":"MaxFileReadTokenExceededError: File content (15815 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:01.137Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:13.932Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:14.086Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code…
RAW_BUFFERClick to expand / collapse

Bug Description chat got halted by an API Error. No way to resume the chat, it's dead.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.104
  • Feedback ID: 0957d9c1-73a5-4628-b4b7-df5fe990a9f7

Errors

[{"error":"MaxFileReadTokenExceededError: File content (177714 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:39.517Z"},{"error":"MaxFileReadTokenExceededError: File content (54492 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:55:53.021Z"},{"error":"MaxFileReadTokenExceededError: File content (17091 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:00.524Z"},{"error":"MaxFileReadTokenExceededError: File content (15815 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:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4711:12912)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async qyK (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4715:2638)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4720:7238)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:01.137Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:13.932Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2027:563)\n    at async Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2810:2098)\n    at async Q0Y (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:4178:8269)","timestamp":"2026-04-14T11:56:14.086Z"},{"error":"Error: Input buffer has corrupt header: pngload_buffer: end of stream\n    at yj6.vKz [as metadata] (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1546:12669)\n    at sa (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1570:2199)\n    at async Gx8 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code…

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix is to implement pagination using the offset and limit parameters when reading files to avoid exceeding the maximum allowed tokens.

Guidance

  • The errors suggest that the file content exceeds the maximum allowed tokens (10000), so implementing pagination is necessary.
  • Use the offset and limit parameters to read specific portions of the file instead of reading the whole file at once.
  • Consider searching for specific content instead of reading the entire file to reduce the number of tokens.
  • The MaxFileReadTokenExceededError errors are repeated with different token counts, indicating that the issue is not specific to a single file or request.

Example

No code snippet is provided as the issue does not include specific code, but an example of using offset and limit parameters might look like: readFile(offset: 0, limit: 10000).

Notes

The provided content was truncated, so there might be additional errors or information that could help with debugging. The Input buffer has corrupt header errors suggest a separate issue that may need to be addressed.

Recommendation

Apply a workaround by implementing pagination using offset and limit parameters to avoid exceeding the maximum allowed tokens. This should help mitigate the MaxFileReadTokenExceededError issues.

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