You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: <persisted-output> tool results are written to session JSONL at full size, causing session resume to hang #23948
When a Bash tool result exceeds the size threshold, Claude Code correctly saves the full output to a separate file under tool-results/ and wraps the content in <persisted-output> tags with a "Preview (first 2KB)" message. However, the full output is still serialized into the session JSONL file, making the session unloadable on resume.
Impact
The session JSONL grew to 12MB (728 lines), with two tool_result lines at ~5.2MB each. Attempting to /resume this session caused Claude Code to hang indefinitely.
Reproduction
Start a Claude Code session
Run a Bash command that produces very large output (e.g., grep on a large minified JS file — in this case, a 4.8MB webpack bundle)
Claude Code correctly triggers the persisted-output path:
Saves full output to ~/.claude/projects/<project>/<session-id>/tool-results/<tool-use-id>.txt
The tool_result content starts with:
<persisted-output>
Output too large (4.8MB). Full output saved to: .../<tool-use-id>.txt
Preview (first 2KB):
...
Bug: Despite the "Output too large" message, the JSONL line for this tool_result still contains the full 5.2MB of content, not just the preview.
Exit the session and try to /resume it — it hangs.
Two offending lines (240 and 385) were type: "user" messages containing tool_result content
Both were 5,244,945 and 5,245,153 bytes respectively
The corresponding tool-results/*.txt files also exist at 4.9MB each, confirming the output was saved externally and duplicated in the session
The specific tool_use IDs: toolu_01TV61RJnJvVAhZXL8ZnVFfF and toolu_014hD6eeBkffWJHgoEScYySw
Both were Bash tool calls running grep on a large .webpack/main/index.js file
Expected behavior
When a tool result triggers the <persisted-output> path, the JSONL session file should only contain the truncated preview (first 2KB), not the full output. The full output is already saved to tool-results/<id>.txt.
Actual behavior
The JSONL session line contains the full multi-MB output despite the message claiming it was "saved to" an external file. This makes the session file grow to 10MB+ and causes /resume to hang.
Environment
Claude Code version: 2.1.17
Model: claude-opus-4-5-20251101
Platform: macOS (Darwin 24.5.0)
Workaround
Manually delete the offending lines from the .jsonl session file using sed -i '' '<line_number>d'. Identify large lines with:
awk '{print NR, length}'<session-file>.jsonl | sort -k2 -nr | head
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Feb 7, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
github-actions commentedon Feb 11, 2026
This issue has been automatically closed as a duplicate of #21067.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
github-actions commentedon Feb 19, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.