[Bug] Image dimension limit persists across turns after auto-compact, blocking continued use in the same session

Resolved 💬 2 comments Opened Apr 19, 2026 by DerekRDev Closed Apr 21, 2026

Summary

When a conversation includes one or more large images, Claude Code can continue failing on later turns with an image dimension limit error, even after the image is no longer relevant to the current request and the session has already auto-compacted.

This appears to happen because oversized image content remains included in the conversation context sent to the model across subsequent turns, instead of being omitted once it has become non-essential or once compaction has occurred.

The result is that the same session becomes effectively unusable until the user starts a new chat and manually reconstructs lost context.

Why this matters

This is not just a transient validation error. It creates a sticky failure state:

  • The original image caused the limit error
  • The error keeps recurring on later messages
  • The user cannot continue in the same session
  • The only workaround is to start over and manually restore context

For longer technical sessions, that is expensive and disruptive.

Expected behavior

When an image exceeds the allowable dimension limit for a many-image request:

  1. The current request should fail gracefully with a clear explanation
  2. Oversized or no-longer-needed image payloads should be dropped from future context automatically
  3. Auto-compact should prevent the same invalid image data from being re-sent on later turns
  4. The session should remain usable without requiring a new conversation

Actual behavior

The oversized image appears to remain in the retained conversation context, so later requests continue failing with the same validation error, even when the user is no longer interacting with that image.

Reproduction pattern

A reliable pattern seems to be:

  1. Work in a session that includes multiple images or a large image
  2. Hit the image dimension limit error
  3. Continue the conversation normally
  4. Observe that later turns can still fail with the same image-related validation error
  5. Starting a fresh session resolves the problem, which suggests stale image content is still being included in the original session context

Impact

  • Breaks continuity in long-running sessions
  • Forces manual context migration to a new chat
  • Creates avoidable friction in debugging, design, and multimodal workflows
  • Makes auto-compact feel incomplete because it does not clear the failing condition

Suggested fix

A good fix would be to treat invalid or oversized image content as removable context once it is no longer required. Possible approaches:

  • Exclude oversized image payloads from future turns after the first validation failure
  • Ensure auto-compact strips image objects that exceed limits or are not needed anymore
  • Replace retained image payloads with lightweight references or summaries where possible
  • Add a recovery path such as: "Remove problematic images from session context and continue"

Suggested UX improvement

In addition to fixing the bug, it would help to offer a session recovery mechanism when this happens. For example:

  • "This conversation contains image data that exceeds current limits."
  • "Would you like Claude Code to remove old image payloads from active context and continue?"

That would preserve the chat while avoiding a forced restart.

Environment

  • Platform: Linux
  • Terminal: Konsole
  • Claude Code version: 2.1.114
  • Feedback ID: 24d9711f-ce24-45bd-b887-c353745b1964

Error excerpts

[
  {
    "error": "Error: NON-FATAL: Lock acquisition failed for /home/dev/.local/share/claude/versions/2.1.114 (expected in multi-process scenarios)"
  },
  {
    "type": "invalid_request_error",
    "message": "messages.104.content.4.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels"
  },
  {
    "type": "invalid_request_error",
    "message": "messages.104.content.5.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels"
  }
]

View original on GitHub ↗

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