claude-code - 💡(How to fix) Fix [Bug] Usage allocation calculation inaccurate for short session durations [1 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#53120Fetched 2026-04-26 05:23:53
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

[{"error":"MaxFileReadTokenExceededError: File content (94284 tokens) exceeds maximum allowed tokens (25000). 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 yR_ (B:/~BUN/root/src/entrypoints/cli.js:4845:12722)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T01:15:05.834Z"}]

Code Example

[{"error":"MaxFileReadTokenExceededError: File content (94284 tokens) exceeds maximum allowed tokens (25000). 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 yR_ (B:/~BUN/root/src/entrypoints/cli.js:4845:12722)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T01:15:05.834Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description The usage allocation is extremely unreasonable. Despite only using it for an hour [5h:56% 🔄 3h57m / 7d:7% 🔄 Fri 22:00], the effort level is already /effort Medium

Environment Info

  • Platform: win32
  • Terminal: better-agent-terminal
  • Version: 2.1.119
  • Feedback ID: 5a6c611b-67f2-4152-bd58-d5a5a5027c12

Errors

[{"error":"MaxFileReadTokenExceededError: File content (94284 tokens) exceeds maximum allowed tokens (25000). 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 yR_ (B:/~BUN/root/src/entrypoints/cli.js:4845:12722)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-25T01:15:05.834Z"}]

extent analysis

TL;DR

The issue can likely be mitigated by using the offset and limit parameters to read specific portions of the file instead of reading the whole file.

Guidance

  • The error message suggests that the file content exceeds the maximum allowed tokens, causing a MaxFileReadTokenExceededError.
  • To verify the issue, check the file size and content to confirm it exceeds the 25000 token limit.
  • Consider using the offset and limit parameters to read specific portions of the file, as suggested in the error message.
  • Review the code in cli.js at line 4845 to understand how the file is being read and how to implement the offset and limit parameters.

Example

No code example is provided as the issue does not contain sufficient information about the code implementation.

Notes

The issue may be specific to the better-agent-terminal and win32 platform, and the solution may vary depending on the specific use case and requirements.

Recommendation

Apply workaround: Use the offset and limit parameters to read specific portions of the file, as this is a direct solution suggested by the error message and does not require upgrading to a fixed version.

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