UsageAppears in · BackgroundAdded

image-diet

Shrinks images to 1280 px before Claude sees them: about 60% fewer image tokens.

image-diet · Effect preview · IllustrationIllustrative
> Add pagination to the order list
⏺ I’ll look at the list component first.
⏺ Read(screenshot.png)
⎿ image-diet: shrank image from 2880x1800 to 1280x800 to save context.
⎿ For full resolution, copy the file to a name containing ".full." (illustrative)

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-plugins

Run these commands one at a time in a Claude Code session.

What it accesses

Based on the author’s documentation, checked when listed; use claude plugin validate to check for yourself.

Reads

Yes

Reads images returned by Read and MCP tools, and the IMAGE_DIET_* env vars.

Writes files

Yes

Writes image copies to a temp dir while resizing, removed afterwards; originals are untouched.

Runs commands

Yes

Runs a sh script that calls sips (macOS) or ImageMagick (Linux) to resize.

Network

Yes

Rewrites 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, cua or browser_batch are 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.