claude-code - 💡(How to fix) Fix [Bug] Image dimension limit persists across turns after auto-compact, blocking continued use in the same session [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#50750Fetched 2026-04-20 12:14:05
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

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.

Error Message

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 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 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.
  1. Hit the image dimension limit error
  2. Observe that later turns can still fail with the same image-related validation error

Error excerpts

"error": "Error: NON-FATAL: Lock acquisition failed for /home/dev/.local/share/claude/versions/2.1.114 (expected in multi-process scenarios)"

Root Cause

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.

Fix Action

Fix / Workaround

  • 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
RAW_BUFFERClick to expand / collapse

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"
  }
]

extent analysis

TL;DR

Exclude oversized image payloads from future turns after the first validation failure to prevent recurring errors.

Guidance

  • Identify and remove oversized image content from the conversation context after a validation failure to prevent it from being sent in subsequent requests.
  • Implement auto-compact to strip image objects that exceed limits or are no longer needed.
  • Consider adding a recovery path, such as removing problematic images from the session context and continuing, to preserve the chat and avoid a forced restart.
  • Review the error excerpts to understand the specific validation errors occurring and adjust the image handling accordingly.

Example

No specific code example is provided, but the fix would involve modifying the conversation context handling to exclude oversized images after a validation failure.

Notes

The provided error excerpts indicate that the issue is related to image dimensions exceeding the maximum allowed size for many-image requests. The fix should focus on handling such cases to prevent recurring errors.

Recommendation

Apply a workaround to exclude oversized image payloads from future turns after the first validation failure, as this directly addresses the root cause of the recurring errors and allows the session to remain usable without requiring a new conversation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Bug] Image dimension limit persists across turns after auto-compact, blocking continued use in the same session [2 comments, 3 participants]