claude-code - 💡(How to fix) Fix [Bug] /clear command processes asynchronously, accepting input before completion [2 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#50774Fetched 2026-04-20 12:13:24
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

Error Message

[{"error":"MaxFileReadTokenExceededError: File content (25575 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 fM7 (/$bunfs/root/src/entrypoints/cli.js:4720:12550)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T03:45:50.195Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/francisco-home/srht/pureawesome'\n at X_H (/$bunfs/root/src/entrypoints/cli.js:1564:144)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-18T03:58:26.340Z"},{"error":"Error: File does not exist. Note: your current working directory is /francisco-home/srht/pureawesome.\n at call (/$bunfs/root/src/entrypoints/cli.js:4729:7630)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T03:38:42.399Z"}]

Code Example

[{"error":"MaxFileReadTokenExceededError: File content (25575 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 fM7 (/$bunfs/root/src/entrypoints/cli.js:4720:12550)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T03:45:50.195Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/francisco-home/srht/pureawesome'\n    at X_H (/$bunfs/root/src/entrypoints/cli.js:1564:144)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-18T03:58:26.340Z"},{"error":"Error: File does not exist. Note: your current working directory is /francisco-home/srht/pureawesome.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4729:7630)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T03:38:42.399Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description I did /clear then pasted some work. I got a note: Session cleared. What would you like to work on?

It is as if the /clear had not worked until after I had pasted the text even though I see clearly the note for the initial clear /clear
⎿  (no content)

Environment Info

  • Platform: linux
  • Terminal: kitty
  • Version: 2.1.112
  • Feedback ID: 8c955e27-a8b5-41e4-a5ab-51834ab03fe6

Errors

[{"error":"MaxFileReadTokenExceededError: File content (25575 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 fM7 (/$bunfs/root/src/entrypoints/cli.js:4720:12550)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T03:45:50.195Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/francisco-home/srht/pureawesome'\n    at X_H (/$bunfs/root/src/entrypoints/cli.js:1564:144)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-18T03:58:26.340Z"},{"error":"Error: File does not exist. Note: your current working directory is /francisco-home/srht/pureawesome.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4729:7630)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T03:38:42.399Z"}]

extent analysis

TL;DR

The /clear command may not be working as expected due to a file size limit error or directory operation issues, and a workaround could involve checking file sizes and directory permissions.

Guidance

  • Check the size of the files being worked on to ensure they are within the allowed token limit (25000 tokens) to avoid the MaxFileReadTokenExceededError.
  • Verify the directory permissions and ensure that the current working directory is correct, as indicated by the EISDIR and File does not exist errors.
  • Consider using the offset and limit parameters to read specific portions of the file instead of reading the whole file at once.
  • Review the terminal and platform settings to ensure compatibility with the version being used (2.1.112).

Example

No specific code snippet can be provided without more context, but ensuring file sizes are within limits and directories are correctly configured can help mitigate these errors.

Notes

The provided errors suggest issues with file sizes and directory operations, but without more information about the specific use case and environment, it's difficult to provide a more targeted solution.

Recommendation

Apply workaround: checking file sizes and directory permissions to mitigate the errors, as the root cause seems to be related to these factors rather than a version-specific issue that would require an upgrade.

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] /clear command processes asynchronously, accepting input before completion [2 comments, 3 participants]