Skip to content

Latest commit

 

History

History
17 lines (10 loc) · 569 Bytes

File metadata and controls

17 lines (10 loc) · 569 Bytes

image-size-guard

Language: python Source: anthropics/claude-code#37480 Estimated lines: 85

Problem

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.

Solution

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.

Expected Files

["image_size_guard.py","install.sh","README.md"]