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

  1. Start a session that uses an MCP tool returning large output (e.g., chrome-devtools list_console_messages without pagination)
  2. The tool result gets stored in the session JSONL file
  3. Exit the session
  4. Try to resume with claude --resume
  5. 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:

  1. Truncate large tool results when storing in session history (with a note that full output was truncated)
  2. Lazy-load tool results during session resume instead of loading everything into memory
  3. Add a size limit warning when MCP tools return very large results
  4. 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/

View original on GitHub ↗

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