Preflight Checklist
What's Wrong?
When Claude reads from Task Output of wordy/long tasks, it uses the entire available token budget to try and fit it, instead of limiting the amount of tokens to "BASH_MAX_OUTPUT_LENGTH" value, in this case "BASH_MAX_OUTPUT_LENGTH": "15000"
Claude correctly attempted to run tail -100 on the /tasks/bc7f68e.output file before reading this Task output, but oddly decided to read the full output after already getting that.
What Should Happen?
Claude should limit reads of background tasks to the proper configured amount, and not be able to read such large amounts of output from background files.
Error Messages/Logs
Steps to Reproduce
-
Have Claude run a verbose command (cargo build, cargo test)
-
Allow Claude to continue working
-
Claude will read the Task Output eventually to check status, resulting in the entire output being piped to the models context window.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.0.76
Platform
Other
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
No response