[BUG] Session freezes when reading persisted-output tool-results file after large Bash output
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code session freezes indefinitely when attempting to Read a tool-results file that was created from a large Bash command output (<persisted-output>).
When Bash output exceeds ~30KB, it gets saved to a tool-results file. When Claude then tries to Read that file, the session becomes completely unresponsive - stuck in "Perusing..." state. Escape key does not work, and Ctrl+C requires multiple presses to interrupt. Only recovery is force exit and claude --continue.
What Should Happen?
Claude should successfully read the tool-results file and continue processing normally.
Error Messages/Logs
No error message displayed. Session simply hangs with no output.
The last visible output before freeze:
● Read(~/.claude/projects/.../tool-results/toolu_xxx.txt)
Then nothing - no response, no error, just frozen.
Steps to Reproduce
- Run a Bash command that produces large output (>30KB):
gh pr diff
- Observe the output is saved to a persisted-output file:
- Claude attempts to Read the persisted tool-results file to analyze the diff
- Session freezes - no response, stuck state
Note: The freeze occurs specifically when Claude's Read tool attempts to access the tool-results file created from large Bash output. Tested with gh pr diff producing ~34KB output.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.6
Claude Code Version
2.1.7
Platform
AWS Bedrock
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
Potentially Related Issues
- #17394 - Session freeze on large file Read error (similar freeze behavior)
- #17407 - Phantom Reads with persisted-output (same persisted-output mechanism)
v2.1.7 Changelog Reference
v2.1.7 changelog mentions: "Fix orphaned tool_result error when sibling tool fails during streaming" - this fix may have introduced the regression.
Workaround
Split large outputs before execution:
gh pr diff 2121 | head -200
\# or
gh pr diff 2121 -- specific/file.rb
Environment
- Running in GitHub Codespaces (Linux container)
- Issue does not occur when Bash output is small enough to display inline
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗