A fast terminal-based image optimizer built in Rust. It helps you prepare images for pasting into Claude Code.
These images are tokens, and your context can only take so much. This will reduce your screenshots to less than 720p and if the images are smaller, it wont affect them. I got tired of my context getting obliterated by the loop of screenshot -> suggest fix -> test fix -> screenshot -> loop.
- Clamps images between 480-720px - automatically resizes images to an optimal size for Claude Code
- Drag and drop - just drag an image into the terminal and it processes automatically
- Instant clipboard - optimized image goes straight to your clipboard, ready to paste
- Visual feedback - shows original → optimized dimensions and confirmation
Large images in Claude Code can quickly consume your context window. This tool automatically resizes images to a sensible size (480-720px) before you paste them, keeping your conversations efficient.
git clone https://github.com/claimhawk/claude-image-optimizer.git
cd claude-image-optimizer
cargo build --release
cp target/release/imgopt /usr/local/bin/imgoptcargo install --git https://github.com/claimhawk/claude-image-optimizer-
Run the tool:
imgopt
-
Drag and drop an image file into the terminal
-
The optimized image is automatically copied to your clipboard
-
Paste into Claude Code!
Press ESC or Ctrl+C to quit.
- Smart clamping: Images larger than 720px are scaled down, images smaller than 480px are scaled up
- Maintains aspect ratio: Your images stay proportional
- High quality: Uses Lanczos3 filtering for clean resizing
- macOS optimized: Native clipboard integration using osascript
- Fast: Processes images instantly
- macOS (uses osascript for clipboard operations)
- Rust 1.70+ (for building from source)
When you drag an image into the terminal, imgopt:
- Detects the file path automatically
- Loads and analyzes the image dimensions
- Calculates optimal new dimensions (clamped 480-720px)
- Resizes using high-quality Lanczos3 filtering
- Copies the result directly to your clipboard
- Shows confirmation and waits for the next image
- Built with Rust for performance and reliability
- Uses
crosstermfor terminal UI - Uses
imagecrate for high-quality resizing - Uses
arboardfor clipboard operations
MIT
Issues and pull requests welcome!
Built with ❤️ for efficient Claude Code conversations
| 🦞 MiniClaw | miniclaw.bot — The technology behind AM and a popular OpenClaw plugin ecosystem |
| 👋 Amelia | helloam.bot — Your personal AI companion |
| 👨💻 Michael ONeal | augmentedmike.com — The engineer behind it all |
| 📖 AM Blog | blog.augmentedmike.com — Comic strip dev log |
| 💻 GitHub | github.com/augmentedmike |