claude-code - 💡(How to fix) Fix [Bug] Multi-agent batch launches cause session context/history to disappear from UI [2 comments, 2 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#45493Fetched 2026-04-09 08:04:08
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2

Error Message

[{"error":"MaxFileReadTokenExceededError: File content (23479 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:25.124Z"},{"error":"MaxFileReadTokenExceededError: File content (14171 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:43.170Z"},{"error":"MaxFileReadTokenExceededError: File content (12512 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:02.942Z"},{"error":"MaxFileReadTokenExceededError: File content (17552 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:05.141Z"},{"error":"MaxFileReadTokenExceededError: File content (10358 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:11.991Z"},{"error":"MaxFileReadTokenExceededError: File content (11401 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:24.089Z"},{"error":"MaxFileReadTokenExceededError: File content (11238 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:32.092Z"},{"error":"MaxFileReadTokenExceededError: File content (20242 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:44.446Z"},{"error":"MaxFileReadTokenExceededError: File content (10169 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:45.239Z"},{"error":"MaxFileReadTokenExceededError: File content (20679 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:46.128Z"},{"error":"MaxFileReadTokenExceededError: File content (22065 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:04:10.109Z"}]

Fix Action

Fix / Workaround

Bug Description launching more than 12-15 agents and them proceeding with 20-30 tool calls causes session context to be completely hidden in the app with no option to see a single previous message or agent output, both ctrl+o and ctrl+e show nothing. Resuming session restores all context, until it dissapears on next agent batch launch. Regression appeared around 2.1.70+-5 minor versions release. Unfortunately still not fixed at runtime, previously patch for session resume was implemented.

Code Example

[{"error":"MaxFileReadTokenExceededError: File content (23479 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:25.124Z"},{"error":"MaxFileReadTokenExceededError: File content (14171 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:43.170Z"},{"error":"MaxFileReadTokenExceededError: File content (12512 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:02.942Z"},{"error":"MaxFileReadTokenExceededError: File content (17552 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:05.141Z"},{"error":"MaxFileReadTokenExceededError: File content (10358 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:11.991Z"},{"error":"MaxFileReadTokenExceededError: File content (11401 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:24.089Z"},{"error":"MaxFileReadTokenExceededError: File content (11238 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:32.092Z"},{"error":"MaxFileReadTokenExceededError: File content (20242 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:44.446Z"},{"error":"MaxFileReadTokenExceededError: File content (10169 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:45.239Z"},{"error":"MaxFileReadTokenExceededError: File content (20679 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:46.128Z"},{"error":"MaxFileReadTokenExceededError: File content (22065 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:04:10.109Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description launching more than 12-15 agents and them proceeding with 20-30 tool calls causes session context to be completely hidden in the app with no option to see a single previous message or agent output, both ctrl+o and ctrl+e show nothing. Resuming session restores all context, until it dissapears on next agent batch launch. Regression appeared around 2.1.70+-5 minor versions release. Unfortunately still not fixed at runtime, previously patch for session resume was implemented.

Environment Info

  • Platform: linux
  • Terminal: konsole
  • Version: 2.1.97
  • Feedback ID: 519641dc-1b01-4d40-9da1-a05ccdd6ff84

Errors

[{"error":"MaxFileReadTokenExceededError: File content (23479 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:25.124Z"},{"error":"MaxFileReadTokenExceededError: File content (14171 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:02:43.170Z"},{"error":"MaxFileReadTokenExceededError: File content (12512 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:02.942Z"},{"error":"MaxFileReadTokenExceededError: File content (17552 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:05.141Z"},{"error":"MaxFileReadTokenExceededError: File content (10358 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:11.991Z"},{"error":"MaxFileReadTokenExceededError: File content (11401 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:24.089Z"},{"error":"MaxFileReadTokenExceededError: File content (11238 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:32.092Z"},{"error":"MaxFileReadTokenExceededError: File content (20242 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:44.446Z"},{"error":"MaxFileReadTokenExceededError: File content (10169 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:45.239Z"},{"error":"MaxFileReadTokenExceededError: File content (20679 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:03:46.128Z"},{"error":"MaxFileReadTokenExceededError: File content (22065 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 cA7 (/$bunfs/root/src/entrypoints/cli.js:4307:12666)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T23:04:10.109Z"}]

extent analysis

TL;DR

Implementing pagination or limiting the amount of data read from files could resolve the MaxFileReadTokenExceededError.

Guidance

  • The error messages indicate that the file content exceeds the maximum allowed tokens (10000), suggesting that the issue is related to reading large files.
  • To mitigate this, consider using offset and limit parameters to read specific portions of the file, as suggested in the error messages.
  • Review the code in cli.js at line 4307 to understand how file reading is implemented and where pagination or limiting can be applied.
  • Test the application with smaller files or reduced tool calls to verify if the issue is indeed related to file size or data volume.

Example

No specific code example can be provided without knowing the exact implementation details of cli.js. However, the general approach would involve modifying the file reading function to accept offset and limit parameters, similar to:

function readFile(filePath, offset = 0, limit = 10000) {
  // Implementation to read the file with offset and limit
}

Notes

The provided error messages and code snippet are not sufficient to determine the exact cause or provide a precise fix. The suggestion to use pagination or limiting is based on the error message's recommendation.

Recommendation

Apply a workaround by implementing pagination or limiting the amount of data read from files, as this seems to be the most direct approach to resolve the MaxFileReadTokenExceededError based on the information 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