[BUG]

Resolved 💬 3 comments Opened Feb 28, 2026 by paulalicante Closed Mar 3, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Uploading an image (4,845 KB on disk) to Claude Code in the VS Code extension triggers an API error stating the image is 7.4 MB and exceeds the 5 MB limit. After this error, the session becomes completely unrecoverable from within the UI:

  1. Cannot delete the uploaded image — mouseover does not show an "X" to remove it (as it normally does)
  2. Cannot cut the image — right-click > Cut does not work
  3. Every attempt to continue produces the same error, as the image is still attached
  4. Restarting VS Code does not help — it restores the same session with the same stuck image/error
  5. The only workaround is to manually navigate to the .claude directory, find the project's session files, and delete them

This is a critical UX issue. A simple oversized image upload should never put the user in an unrecoverable state requiring filesystem surgery.

Expected Behavior

  • The image should be deletable from the chat input after the error (mouseover "X" should work)
  • Alternatively, the image should be validated before being permanently attached to the session
  • At minimum, the user should be able to clear or reset the conversation from within the UI
  • Restarting VS Code should not force-restore a broken session with no way to escape

Steps to Reproduce

  1. Open Claude Code in VS Code extension
  2. Upload an image that is under 5 MB on disk but exceeds 5 MB after base64 encoding (e.g., a ~4.8 MB image)
  3. Submit — receive API error about image exceeding 5 MB limit
  4. Attempt to delete the image from the input — no delete option appears
  5. Attempt to continue working — same error repeats
  6. Restart VS Code — same broken session restores
  7. Only fix: manually delete session files from .claude directory

Environment

  • OS: Windows
  • IDE: VS Code (latest)
  • Claude Code Extension: Latest version
  • Image size on disk: 4,845 KB (~4.7 MB)
  • Reported size in error: 7.4 MB (presumably after base64 encoding)

Additional Context

The discrepancy between the file size on disk (4.8 MB) and the size reported in the error (7.4 MB) suggests the image is being base64-encoded before size validation. The 5 MB limit should either:

  • Be validated against the original file size before encoding, OR
  • The upload limit shown to users should reflect the pre-encoding size that will actually trigger the limit (roughly 3.75 MB for a 5 MB post-encoding limit)

Suggested severity: High

This bug traps users in an unrecoverable state with no in-app escape. The only workaround requires knowledge of internal file structures.

What Should Happen?

"When an uploaded image triggers a size error, the user should be able to delete the image and continue working. The mouseover 'X' to remove the image should still function after the error. Restarting VS Code should not force-restore a broken session with no way to escape. Ideally, image size should be validated before attaching it to the session so oversized images are rejected upfront."

Error Messages/Logs

"API error stating the uploaded image was approximately 7.4 MB and exceeded the maximum allowed size of 5 MB. The error suggested resizing the image. The original file was 4,845 KB on disk — the size increase is likely due to base64 encoding."

Steps to Reproduce

Open Claude Code in the VS Code extension
Upload an image that is close to 5 MB (mine was 4,845 KB on disk)
Submit — API error says image is ~7.4 MB and exceeds 5 MB limit
Try to delete the image (mouseover "X") — doesn't work
Try right-click > Cut — doesn't work
Try to send any new message — same error repeats
Restart VS Code — same broken session loads with same error
Only fix: manually delete session files from the .claude directory

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Bash Check for global npm installation of Claude Code IN npm list -g @anthropic-ai/claude-code 2>/dev/null || echo "Not installed globally via npm" OUT C:\Users\Honey\AppData\Roaming\npm `-- (empty) Not installed globally via npm Claude Code isn't installed as a standalone CLI — you're using it through the VSCode extension only. To find your version: Open VSCode Extensions panel (Ctrl+Shift+X) Search for "Claude Code" The version number appears next to the extension name Or if you want the CLI available system-wide, you can install it with:

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗