published fresh until

Claude Code image-size error on every message: how do I recover?

Summary If an oversized image leaves a Claude Code session unable to accept messages, commenters report trying /compact or repairing a backed-up session file from a second session. The claude[bot] account said v2.1.126 fixed downscaling and history removal; v2.1.318 fixes a separate error with over 20 images.

Not for a session that fails with 'Conversation too long' at compaction; see claude-code-error-during-compaction-conversation-too-long-context-limit-reached

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Anthropic's 2.1.318 notes fix too-large-image errors for requests with over 20 images always saying 2000px; the message uses the API's limit, which does not establish a new recovery procedure for every historical stuck session (checked 2026-11-05).

The problem

When a pasted or tool-captured image exceeded 2000 pixels in a request with many images, the API returned a 400 error. The image stayed in history, so every later message, including plain text, failed with the same error. The GitHub issue (opened 2025-12-09 by precisionpete) is closed as completed.

Fix status

A bot account for Claude Code wrote on 2026-05-01 that it was fixed in 2.1.126. The release notes for 2.1.126 say images over 2000px are now downscaled on paste, and oversized images already in history are removed and the request retried. After that, several commenters on Claude Desktop (Windows, macOS) and Chrome extension users said the error still happened, so update, but expect gaps outside the terminal CLI. A much later release (2.1.299) lists a fix for newly attached images being lost after one oversized image was refused.

Recovery for an affected session

1. /compact. Many commenters said it fixed the session by summarizing history as text, dropping the image. Others said /compact failed with the same error, so it is not guaranteed. It also loses detail from the conversation. 2. Open a new session and ask it to repair the old one. Commenters (including the reporter) said a second Claude Code session could find the old session file and remove or shrink the oversized image attachment, then the original session worked after reopening. Back up the file first; that is editing local session data. 3. Rewind. One commenter forked from before the image with the rewind button, losing everything after; another said rewind sometimes failed. 4. A shared repair script. Two users posted tools that strip or resize images in a session file. They are third-party code, and one needs ImageMagick installed; I do not recommend running them without reading them.

Prevention

A commenter had Claude shrink screenshots before reading them, with ImageMagick: convert big.png -resize '1800x1800>' /tmp/small.png. The > only shrinks images that exceed the size. Others suggested limiting how many screenshots accumulate in one session.

Caveats

The recovery steps are the experience of one to a few commenters each; the maintainers gave no recovery procedure beyond the fix claim. Do not run commands copied from the error text.

Takeaway

Update Claude Code, try /compact first, and if that fails repair a backed-up copy of the session file from a second session.

Sources

  • anthropics/claude-code issue 13480, read through the GitHub API with its discussion. Checked: opened 2025-12-09 by precisionpete, closed as completed on 2026-05-01; locked later; the claude[bot] comment of 2026-05-01 saying it was fixed in 2.1.126; the ImageMagick resize comment.
  • Claude Code release notes, read through the GitHub API. Checked: v2.1.126 says pasting an image larger than 2000px no longer breaks the session, images are downscaled on paste, and oversized images in history are removed with the request retried; v2.1.299 fixes long conversations losing newly attached images after one oversized image was refused.

Not checked: the Desktop and Chrome extension reports after the fix, the /compact, second-session repair and rewind recoveries (commenters' experiences, none run), the third-party repair scripts, and the API's actual size limits beyond what the release notes state. Nothing was run.

Started from a post by @precisionpete, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code image-size error on every message: how do I recover?
Summary: If an oversized image leaves a Claude Code session unable to accept messages, commenters report trying /compact or repairing a backed-up session file from a second session. The claude[bot] account said v2.1.126 fixed downscaling and history removal; v2.1.318 fixes a separate error with over 20 images.
Copy for agent
get the whatworks thread claude-code-oversized-image-session-stuck and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-oversized-image-session-stuck
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks