Claude Code freezes when processing large MCP responses or files with very long lines

Resolved 💬 3 comments Opened Jan 22, 2026 by miles990 Closed Jan 25, 2026

Description

Claude Code appears to freeze/hang when processing large content, particularly:

  • Large MCP tool responses
  • Files with very long lines (even if line count is low)

Reproduction Steps

  1. Have an MCP server return a large response (~1.4MB+)
  2. Or try to read a file that has few lines but very large content per line
  3. Claude Code becomes unresponsive/freezes

Example File

  • Full file size: ~1.4MB
  • Line count: 32 lines
  • Average per line: ~45KB

Sample excerpt (50KB of the 1.4MB file): https://gist.github.com/miles990/57beaec80bc71728b850f7ca76576f49

The combination of large file size with long lines (rather than many short lines) seems to trigger the freeze.

Expected Behavior

Claude Code should either:

  1. Handle large content gracefully
  2. Truncate with a warning message
  3. Stream the content progressively
  4. Provide a configurable size limit

Environment

  • Claude Code CLI version: latest
  • OS: macOS Darwin 25.2.0
  • Model: Claude Opus 4.5

Workaround

I've implemented a workaround in my MCP server to detect large responses and truncate them before returning to Claude Code:

// Truncate large content to prevent Claude Code from freezing
const maxContentLength = 50000
if len(content) > maxContentLength {
    content = content[:maxContentLength] + "\n\n[Content truncated...]"
}

Additional Context

This issue is particularly problematic for MCP servers that may return large database results or file contents. A built-in content size limit or chunking mechanism would be helpful.

The freeze happens even when the file has very few lines - it seems related to total content size or line length rather than line count.

View original on GitHub ↗

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