kargnas

Opencode Large Image Optimizer — Development skill for Claude Code

Development community

OpenCode plugin that automatically optimizes oversized images to prevent context window bloat and API errors.

How to install Opencode Large Image Optimizer

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kargnas/opencode-large-image-optimizer and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Opencode Large Image Optimizer does

OpenCode plugin that automatically optimizes oversized images to prevent context window bloat and API errors.

Alternatives in Development

  • Imagegen — Generate and edit images using OpenAI's Image API for projects 14.6k ★
  • Ccusage — CLI for analyzing Claude Code/Codex usage from local JSONL files 11.8k ★
  • Om Tidy — Self-maintenance pass — acts on every hygiene flag: archives completed work, groups loose clusters, splits ove 4.6k ★

README

opencode-large-image-optimizer

OpenCode plugin that automatically optimizes oversized images before they hit model APIs.

It prevents common image-related failures by resampling images larger than 1568px (Anthropic's internal downscale target) and converting very large files to JPEG, reducing request payload size and context window pressure without losing any model-visible information.

Problem (Errors this plugin solves)

If you use screenshots, pasted images, or `read` attachments in OpenCode, you may hit errors like:

Image base64 size (8.4 MB) exceeds API limit (5.0 MB). Please resize the image before sending.
API Error: 413 {"error":{"type":"request_too_large","message":"Request exceeds the maximum size"}}
messages.X.content.0.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels
Image was too large. Double press esc to go back and try again with a smaller image.
invalid_request_error: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels

These errors kill your active session with no way to recover — you're forced to start a new conversation and lose all context.

This plugin prevents these failures automatically by optimizing images before they reach the API.

Related Issues