Session resume freezes with large MCP tool results
Resolved 💬 3 comments Opened Jan 27, 2026 by lezama Closed Jan 30, 2026
Description
Claude Code freezes indefinitely when trying to resume a session that contains large MCP tool results (~1MB+ each).
Steps to Reproduce
- Start a session that uses an MCP tool returning large output (e.g.,
chrome-devtoolslist_console_messageswithout pagination) - The tool result gets stored in the session JSONL file
- Exit the session
- Try to resume with
claude --resume - Claude Code freezes on the session selection or shortly after
Environment
- Claude Code version: 2.1.17
- Platform: macOS (Darwin 25.3.0)
- Node: v22.14.0
Root Cause Analysis
The session JSONL file (~/.claude/projects/<path>/<session-id>.jsonl) contained entries with toolUseResult.stdout fields of ~1.1MB each. The total session file was 3.7MB with 518 entries.
Problematic entries were from mcp__chrome-devtools__list_console_messages returning 106 console messages with full stack traces.
Workaround
Manually trimming the large toolUseResult.stdout entries in the session JSONL file resolved the freeze:
# Trim entries where stdout > 50KB
if len(tr.get('stdout', '')) > 50000:
tr['stdout'] = tr['stdout'][:1000] + '\n\n[TRIMMED]'
Suggested Fix
Consider one or more of:
- Truncate large tool results when storing in session history (with a note that full output was truncated)
- Lazy-load tool results during session resume instead of loading everything into memory
- Add a size limit warning when MCP tools return very large results
- Stream/paginate the session loading process for large sessions
Related Files
- Session JSONL:
~/.claude/projects/<path>/<session-id>.jsonl - Tool results cache:
~/.claude/projects/<path>/<session-id>/tool-results/
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗