claude-code - 💡(How to fix) Fix [BUG] Session crashes on accumulated screenshots — no recovery, no transcript export (regression of #9170 / #42558 / #51042)

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…

Error Message

API Error: 400 messages.N.content.X.image.source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels

Root Cause

  1. Auto-downscale or auto-strip oversized / cumulatively-too-big images before sending, so the API never returns a dimension/size error in the first place. The model rarely needs the full resolution — a 1024px-wide screenshot is enough to read UI text, and a 512px one is enough for a "does the layout look right" check.
  2. Recover gracefully from image errors. When the API returns an image-related 400, automatically prune (or stub out) the offending block from history so the next text-only turn succeeds. Today the same error repeats forever.
  3. Export the transcript even from a crashed session. A "Copy transcript" / "Export to markdown" button that works regardless of session state would let users carry context to a fresh session instead of losing hours of work. This alone would massively reduce the pain of every other crash class, not just image-related ones.
  4. Better diagnostics on Retry. If "Retry" can't possibly succeed (because the failure is structural — bad payload still in history), say so, and offer the right next step ("Trim last N turns", "Start new session with summary", "Export transcript").

Fix Action

Fix / Workaround

A pragmatic short-term mitigation that would already help a lot: a hard pre-send pass that downscales any image to ≤ 1024px on the long edge and re-encodes it under, say, 1.5 MB before it ever reaches the API. Almost no code-related screenshot needs more than that.

Code Example

API Error: 400 messages.N.content.X.image.source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels

---

An image in the conversation exceeds the dimension limit for many-image requests (2000px). Start a new session with fewer images.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues — three closely related ones exist (#9170, #42558, #51042) but all are CLOSED, while the bug still occurs in 2.1.79 on macOS. Filing this as a regression / persistent bug.
  • This is a single bug report
  • I am using a recent version of Claude Code

What's Wrong?

In long sessions where the model has accumulated several screenshots in context (e.g. QA testing, PRD review with Figma exports, UI work), the session crashes — the assistant stops responding mid-turn and the only thing the UI offers is a "Retry" button that doesn't recover the conversation.

This reproduces the exact pattern fixed and re-fixed in #9170 (closed Oct 2025), #42558 (closed Apr 2026) and #51042 (closed Apr 2026): once an image-related error happens, the bad image stays in the history and every subsequent turn re-validates and re-fails. The previous fixes seem either incomplete, environment-specific (those issues mention VS Code / Windows), or have regressed.

Two compounding problems on top of the crash itself:

  1. No usable recovery path. "Retry" doesn't help — if the issue is the cumulative image payload (or one rejected image still in history), retrying the same payload obviously fails again. There's no in-product way to drop the offending image, downscale it, or strip it from context.
  2. No way to export / copy the transcript. When the session is unusable, the user can't even copy-paste the conversation into a fresh session to keep going. The transcript is locked behind the broken UI. So the user loses every bit of state the model accumulated — plan, file references, decisions made — even though nothing about that state was actually corrupted.

The combination is brutal: a session can be running for hours, the model has built up real context, one screenshot tips it over the limit, and everything is gone with no way back. This happens to me multiple times per day on QA / UI / design-review sessions.

What Should Happen?

In rough priority order:

  1. Auto-downscale or auto-strip oversized / cumulatively-too-big images before sending, so the API never returns a dimension/size error in the first place. The model rarely needs the full resolution — a 1024px-wide screenshot is enough to read UI text, and a 512px one is enough for a "does the layout look right" check.
  2. Recover gracefully from image errors. When the API returns an image-related 400, automatically prune (or stub out) the offending block from history so the next text-only turn succeeds. Today the same error repeats forever.
  3. Export the transcript even from a crashed session. A "Copy transcript" / "Export to markdown" button that works regardless of session state would let users carry context to a fresh session instead of losing hours of work. This alone would massively reduce the pain of every other crash class, not just image-related ones.
  4. Better diagnostics on Retry. If "Retry" can't possibly succeed (because the failure is structural — bad payload still in history), say so, and offer the right next step ("Trim last N turns", "Start new session with summary", "Export transcript").

Error Messages / Logs

I don't have a captured error this time — the session ends with the assistant turn failing and a "Retry" button. The previous closed issues' errors look like:

API Error: 400 messages.N.content.X.image.source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels

or

An image in the conversation exceeds the dimension limit for many-image requests (2000px). Start a new session with fewer images.

I'll attach a console log next time it happens. Filing this now because the pattern is consistent and the previous fix(es) clearly didn't cover macOS / this version.

Steps to Reproduce

  1. Start a long session that involves multiple screenshots — typical examples: a QA run reading screenshots from qa/workspace/.../screenshots/, a UI session pulling Figma exports, a code review where the user pastes screenshots of a running app.
  2. Continue working until ~10–20 screenshots have accumulated in the conversation context (or one large screenshot is added that pushes over a threshold).
  3. The next assistant turn fails. UI shows only a "Retry" button.
  4. "Retry" repeats the same failure indefinitely.
  5. There is no in-product way to: prune the bad image, export the transcript, or recover the session.

Claude Model

Opus 4.7 (claude-opus-4-7), but the issue is independent of model — it's the conversation transport / image handling.

Is this a regression?

Yes — #9170 (Oct 2025), #42558 (Apr 2026) and #51042 (Apr 2026) all describe the same class of bug and are CLOSED, but the behaviour reproduces on 2.1.79 / macOS 26.3.1.

Last Working Version

Don't know. Has been intermittent for a while.

Claude Code Version

2.1.79

Platform

Claude (Pro/Max subscription)

Operating System

macOS 26.3.1 (Darwin 25.3.0)

Terminal / Shell

zsh

Additional Information

Use cases where this hurts the most in my workflow:

  • QA test automation — the QA pipeline takes screenshots of every step on emulator/simulator. A single QA run can produce 30+ screenshots; if any of them ends up in chat context the session is at risk.
  • PRD / design review — pulling Figma exports or app screenshots to discuss UI.
  • Cross-platform parity work — comparing iOS / Android / Flutter screenshots side by side.

In all three cases I'm doing exactly what Claude Code is good at, and the platform punishes me for it. The frustrating part is not "images sometimes fail" — it's "when they fail I lose hours of accumulated context with no recovery, and I cannot even copy out what's there".

A pragmatic short-term mitigation that would already help a lot: a hard pre-send pass that downscales any image to ≤ 1024px on the long edge and re-encodes it under, say, 1.5 MB before it ever reaches the API. Almost no code-related screenshot needs more than that.

Related closed issues (filing this because the symptoms match but the fix didn't cover this environment):

  • #9170 — Image Upload Error Prevents Conversation Continuation
  • #42558 — Oversized image in conversation history permanently breaks all subsequent API calls
  • #51042 — Session permanently stuck after "image exceeds dimension limit" error in VSCode extension

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING