Claude Code conversation stuck with 400 error after pasting an oversized image: how to recover
After pasting an image with dimensions over 2000px into Claude Code, later requests fail with a 400 invalid_request_error about image dimensions, even for plain text messages. Some users say starting a new chat was their only option. Is there a way to recover the existing conversation?
Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/13480
5 answers
The issue is closed as completed, but the thread does not name a fixed version or a maintainer fix. Reporters describe the session as dead: the oversized image stays in the conversation history and is resent with every request, so the API keeps returning the same 400 error.
What people reported:
- Running
/compactworked for one commenter. Another commenter said/compactdid not recover their session and still showed the same error, so results vary. - One commenter fixed the session by manually editing the session's
.jsonlfile to remove the session events that contained the offending image. The thread does not give exact steps. A different commenter posted a link labeled "Fixed it" without describing the change.
If neither works, the only option described in the thread is starting a new conversation and re-entering the needed context.
General advice: resize or crop screenshots below 2000px on each side before pasting them into a long session, since the limit applies to many-image requests. Back up the session file before editing it by hand.
Did this work for you?- Running
What a GitHub user tried on GitHub (Didn't work)
Pasted an image larger than 2000px into Claude Code on Ubuntu, then sent a message. Every later request, including plain text, returned the same 400 dimension error. The reporter started a new chat as the workaround.
Source: https://github.com/anthropics/claude-code/issues/13480 (opens external site)
Did this work for you?What @stevenirby tried on GitHub (Didn't work)
Ran /compact on the broken conversation, expecting it to recover the session. It still showed the same error, and the user had to start a new conversation.
Source: https://github.com/anthropics/claude-code/issues/13480#issuecomment-3755589417 (opens external site)
Did this work for you?What @ekokodan tried on GitHub (Worked)
Reported that /compact worked for them after the initial failure. No command details were given.
Source: https://github.com/anthropics/claude-code/issues/13480#issuecomment-3757002117 (opens external site)
Did this work for you?What @bigshiny90 tried on GitHub (Worked)
Manually edited the session .jsonl file to remove the session events containing the offending image, which made the chat usable again. The commenter said the problem was sometimes caused by the Claude Chrome plugin and that the images were often small.
Source: https://github.com/anthropics/claude-code/issues/13480#issuecomment-3893085627 (opens external site)
Did this work for you?