Skip to content

[Bug]: Images over 5 MB but under 2000px still stop a Claude turn when sent mid-turn #20106

Closed

Description

@OscarSwanros

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web and apps/mobile (attachment preparation); the failure surfaces in the Claude provider.

Steps to reproduce

  1. Start a Claude thread and send a prompt that keeps Claude busy for a while (for example "run sleep 20, then say done").
  2. While that turn is running, attach a PNG or JPEG that is at or under 2000px on its long edge but larger than ~3.75 MB (for example a photo pasted as PNG, or a 1800×1200 PNG of 6.5 MB), and send it.

Expected behavior

The image reaches Claude and the turn continues, as it does when the same image starts a turn.

Actual behavior

Claude Code rejects the steer before calling the API and ends the turn with terminal_reason: "image_error":

Image base64 size (8.2MB) exceeds API limit (5MB). Please resize the image before sending.

T3 shows "Claude stopped: an image in the conversation could not be processed." In our case the T3 session then stopped, and the image stays in the conversation.

Why

Anthropic caps each image at 5 MB of base64 (5,242,880 characters, about 3,932,160 bytes of file). Claude Code shrinks the images of a message that starts a turn, but sends images queued into a running turn as they are (same mechanism as #13647).

#19364 fixed the dimension half of this by scaling PNG/JPEG over 2000px at attach time. The byte half is still open on main (bb4e4e7ec): an image within 2000px passes through byte for byte as long as it fits the 10 MB PROVIDER_SEND_TURN_MAX_IMAGE_BYTES wire cap.

  • Web/desktop: compressImageToByteLimit returns the original when fitImageToMaxEdge has nothing to do and file.size <= maxBytes, and ChatComposer / SnapShotCoordinator pass the 10 MB cap.
  • Mobile: fitComposerImage only re-renders when the long edge is over 2000px, so the photo library, clipboard, native paste and share sheet keep originals up to 10 MB.
  • Server: ClaudeAdapterV2 base64-encodes the stored attachment as is.

So anything between ~3.75 MB and 10 MB that is already ≤2000px breaks a running Claude turn.

Evidence

Reproduced directly against Claude Code 2.1.296 with claude -p --input-format stream-json, sending the image as a second user message while a sleep 20 tool call was running:

Image base64 size Sent mid-turn Sent as turn start
1800×1200 PNG, 6,483,243 B 8,644,324 chars image_error, turn ended works (Claude Code scaled it)
1200×1050 PNG, 3,782,268 B 5,043,024 chars works –

We first hit it from the iPhone app on v0.0.45 with a 1206×2622 screenshot (5.3 MB, 16-bit PNG); a second screenshot of 4.5 MB failed the same way. #19364 now scales that particular screenshot, but the byte limit is independent of dimensions.

Impact

Major degradation or frequent failure: a normal paste while Claude is working stops the session.

Version or commit

Observed on desktop v0.0.45 (Claude Code 2.1.296); code paths confirmed unchanged on main @ bb4e4e7ec.

Environment

macOS, T3 Code desktop + iOS app, Claude provider (Claude Code 2.1.296).

Workaround

Send images only when Claude is idle, or shrink them below ~3.75 MB first.

Activity

  1. juliusmarminge commented on Oct 16, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Confirmed on main: images that are already within 2000px skip resizing entirely, so anything between ~3.75 MB and the 10 MB attachment cap reaches Claude unchanged.

    • Web/desktop: compressImageToByteLimit (apps/web/src/lib/imageCompression.ts) returns the original file when fitImageToMaxEdge has nothing to do and the file fits maxBytes, and ChatComposer/SnapShotCoordinator pass PROVIDER_SEND_TURN_MAX_IMAGE_BYTES (10 MB).
    • Mobile: fitComposerImage only re-renders when the long edge is over the limit.

    The root cause is upstream: Claude Code downsizes images that start a turn but not images queued into a running one. We already work around that for dimensions in #19364, so it makes sense to handle the byte half the same way, with a per-image byte cap under Anthropic's 5 MB base64 limit for Claude. Keeping this open as a bug.

    Workaround until then: send images while Claude is idle, or keep them under ~3.7 MB.

  2. added
    acceptedfeature request accepted
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 16, 2026
  3. shivamhwp commented on Oct 16, 2026

    @shivamhwp
    Collaborator

    Fixed upstream in Claude Code v2.1.299. The release notes say:

    Fixed images attached while Claude is working (VS Code, desktop app, SDK) being sent at full size, which led to repeated image errors in long conversations

    I retested this on Claude Code 2.1.300 with a 7.3 MB, 1800x1200 PNG sent mid-turn, and it works. T3 uses the user's installed Claude Code, so no T3 client change is needed. Users on an older Claude Code version should update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions