Session resume freezes when JSONL contains large tool_result (~12MB)

Resolved 💬 2 comments Opened Feb 8, 2026 by tmokmss Closed Feb 8, 2026

Description

When resuming a session whose .jsonl file contains a large tool_result entry, Claude Code freezes/becomes unresponsive.

Reproduction

  1. In a session, run a command that produces large output (e.g., git diff on snapshot files producing ~11.4MB of output)
  2. The tool_result gets stored in the session's .jsonl file, making it ~12MB
  3. Try to resume that session (claude --resume <session-id>)
  4. Claude Code freezes

Details

  • The .jsonl file was only 19 lines, but line 18 alone was ~12.8 million characters (a single tool_result containing a large git diff output)
  • The persisted-output mechanism correctly saved the full output to an external file (tool-results/toolu_xxx.txt), but the full content also appears to be embedded in the JSONL entry itself
  • Session file: 387be59b-6574-49d9-b052-36925b2ba8ec.jsonl (~12MB)
  • Claude Code version: 2.1.37

Expected Behavior

  • Session resume should handle large tool_results gracefully without freezing
  • If output is already persisted to an external file via persisted-output, the JSONL entry should reference it rather than duplicating the full content inline

Suggested Improvements

  • Truncate or lazy-load large tool_results when resuming a session
  • Avoid storing full output in JSONL when it's already saved as a persisted-output file
  • Add a size threshold for tool_results stored inline in the JSONL

Environment

  • macOS (Darwin 25.2.0)
  • Claude Code v2.1.37

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗