image-diet
Shrinks images to 1280 px before Claude sees them: about 60% fewer image tokens.
Runs in the background, with no interface. These are illustrative logs.
Illustration. Actual results depend on the mod, terminal and environment.
Install
/plugin marketplace add sergical/claude-plugins
/plugin install image-diet@sergical
/reload-pluginsRun these commands one at a time in a Claude Code session.
claude plugin marketplace add sergical/claude-plugins
claude plugin install image-diet@sergicalThen run /reload-plugins in your session, or start a new session.
Please install the Claude Code mod "image-diet" (https://github.com/sergical/claude-plugins). Before installing, read the Security and Requirements sections of its README and tell me what it reads and writes, which commands it runs, whether it uses the network, and which Claude Code version, OS and terminal it needs. If everything looks fine, run claude plugin marketplace add sergical/claude-plugins and claude plugin install image-diet@sergical, then remind me to run /reload-plugins in my session.Send this to Claude Code so it reads the author’s instructions before installing.
git clone https://github.com/sergical/claude-plugins
cd claude-plugins
claude --plugin-dir ./plugins/image-dietClone the repository and try it in a local session with --plugin-dir.
What it accesses
Based on the author’s documentation, checked when listed; use claude plugin validate to check for yourself.
Reads
YesReads images returned by Read and MCP tools, and the IMAGE_DIET_* env vars.
Writes files
YesWrites image copies to a temp dir while resizing, removed afterwards; originals are untouched.
Runs commands
YesRuns a sh script that calls sips (macOS) or ImageMagick (Linux) to resize.
Network
YesRewrites images sent to the model and adds a size note to tool results; makes no requests itself.
Introduction
image-diet is a Claude Code mod that shrinks large images before they enter Claude's context. Screenshots are expensive: a 2000 px one costs 3,000 to 4,800 tokens.
- Read tool: a PNG or JPEG over 1280 px on its long edge is shrunk before Claude sees it.
- MCP tools: image blocks in any
mcp__*result (browser screenshots, Figma) are shrunk the same way. - Click tools skipped: tools whose names contain
computer,cuaorbrowser_batchare left alone, so clicks still land. - Claude is told: each shrink adds a note with the old and new size; a file with
.full.in its name is never shrunk, for full detail on demand. - Safe failure: if the resize fails, Claude gets the original. Pasted images are not changed.
The author's test with Opus 5.5 on six kinds of screenshots: 100% correct at 1280 px, image tokens down from 3,240 to 1,334. IMAGE_DIET_MAX_EDGE sets the size. Uses sips on macOS, ImageMagick on Linux. Requires Claude Code 2.1.287 or later.
Who it is for
- People who often have Claude read screenshots or use browser MCPs
Requirements
- Claude Code ≥ 2.1.287
- Uses sips on macOS; Linux needs ImageMagick (magick).
- Images pasted into the prompt are not changed.