Many-image 2000px dimension limit crashes sessions instead of gracefully resizing

Resolved 💬 3 comments Opened Mar 20, 2026 by danielalexlarsen Closed Mar 23, 2026

Bug Description

When a conversation accumulates many images (e.g., analyzing slide decks via DevTools screenshots), Claude Code hits a hardcoded 2000px dimension limit and crashes the session with:

An image in the conversation exceeds the dimension limit for many-image requests (2000px). 
Run /compact to remove old images from context, or start a new session.

This is catastrophic in long-running sessions. In our case, 8 hours of work analyzing 100+ presentation slides was effectively destroyed because:

  1. The session froze ("Baked for 19m 20s" with no output)
  2. The only suggested recovery (/compact) destroys the conversation context — which is the entire point of the work
  3. There is no way to recover the session without losing context

Expected Behavior

  • Claude Code should automatically resize images to fit within API limits before sending — it already has resize logic (Bk function) but it clearly fails in many-image scenarios
  • If an image can't be resized, it should skip that image with a warning, not crash the entire session
  • The limit should be configurable (e.g., imageMaxDimension in settings.json)
  • At minimum: graceful degradation, not session destruction

Reproduction

  1. Open a DevTools-connected session
  2. Take 30-40 screenshots of Google Slides (typical resolution: 2800-3200px wide)
  3. Analyze each screenshot with the Read tool
  4. Around image 35-40, the session crashes with the dimension error

Environment

  • Claude Code v2.1.76
  • Opus 4.6 (1M context)
  • WSL2 / Linux
  • DevTools MCP (chrome-devtools-mcp@latest)
  • Screenshots are standard browser resolution (2800-3200 x 1384px)

Current Workaround

We patched cli.js directly — changing WB=2000,ZB=2000 to WB=8000,ZB=8000. This works but gets overwritten on every update.

Suggested Fix

  1. Make the dimension limit configurable in settings.json
  2. Ensure the existing resize logic actually works for many-image requests
  3. Never crash a session over an image dimension — resize, compress, or skip with a warning
  4. Consider progressive image quality reduction as context fills (lower quality for older images)

A 1M context window AI that crashes over a 3000px image in 2026 is not acceptable.

View original on GitHub ↗

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