image-shrinker
Reviewed
at commit 07d0285
Shrinks large image files before Claude reads them so they take less of the context window, and tells Claude the scale back to the original pixels.
0 upvotes
Log in to upvote or save- Made by
- Moka
- Pinned commit
-
07d0285266c9ad5c635b09721f02b06554975efb - What we checked
-
On macOS, when Claude reads a large image that your permission rules already allow, it reads a smaller copy instead and adds a note with the original and reduced size so coordinates can be scaled back. The copy is a temporary file in /tmp/claude-shrunk that is deleted right after the read; your original is never changed. It makes no network calls.
Review details
Static review of the source at the pinned commit; not run. Delta review of the changes since 215aa3f; the rest carries over from the review at that commit. The only changes are manifest metadata (homepage and repository URLs now point to github.com/moka-apps/image-shrinker, the repository moved), README text and a banner image; hooks/register.ts is unchanged. Registers one hook, tool.call for the Read tool. For image extensions (png, jpg, gif, tiff, bmp, webp, heic) without an offset it first asks $.tool.check whether the real file and the temporary copy would be read without a prompt, and only continues on 'allow'; otherwise the call goes through unchanged. It runs the macOS sips tool to read the pixel size and write a resized copy (argv arrays, no shell), mkdir/chmod to make /tmp/claude-shrunk 0700 and the copy 0600, and rm -f to delete the copy in a finally block after the read. It rewrites the Read call to point at the copy and appends a context note with both sizes; Read with offset 1 returns the original. Without sips (not macOS) or on any failure it falls back to the original file. No network, no model calls, no stored data. No npm dependencies.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: yes
- Blocks or changes tool calls: yes
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: no
- Shows something on screen: no
- Hooked events
Shrinks big screenshots before Claude reads them, so long sessions last longer, and tells Claude the scale so clicks still land in the right place.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/image-shrinker/)