Language: python Source: anthropics/claude-code#37480 Estimated lines: 85
Pasting a large image into Claude Code causes the session to hang indefinitely when the base64-encoded image exceeds the 5MB API limit with no error message.
A PreToolUse hook for Read tool calls on image files that checks file size and image dimensions, returning a deny with a clear error message if the estimated base64 size exceeds 5MB.
["image_size_guard.py","install.sh","README.md"]