Opencode Large Image Optimizer — Development skill for Claude Code
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
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
- Images exceeding 2000px are rejected by Anthropic API
- request_too_large: Request exceeds the maximum size // exceded pixels image
- 413 Payload Too Large when reading local image
- Request Entity Too Large with images blocks session — compaction also fails
- Screenshots from Chrome DevTools MCP are larger than context window
- [Request Entity Too Large not c
Related Skills
Trim Context
Find and fix sources of Claude Code "token bloat" in a repo — oversized CLAUDE.md (vs the 40k-char limit), blo
Describe Image Skill
让无视觉能力的模型(如 DeepSeek v4)也能'看懂'图片 Enable vision‑incapable models (e.g., DeepSeek‑v4) to also "understand" image
Edit Image
This command edits existing images based on provided edit prompts using Replicate's API directly via curl.
Agent Skill Description Optimizer
Optimizes the description frontmatter of a Claude Code / Agent Skill - the text that decides whether Claude in
Claude Md Optimizer
Claude Code skill for optimizing oversized CLAUDE.md files using progressive disclosure
Toonify MCP
Context compression plugin for Claude Code. Automatically trims large tool output—JSON, YAML, stack traces, an
Related Agents
Unity Optimizer
Profiles and optimizes Unity performance. Uses MCP profiler for frame timing, memory snapshots, rendering stat
Context Isolator
Runs data-heavy read-and-summarize operations in an isolated context window to prevent bloating the main conve
Image Generator
Generates and edits images using the OpenAI Image API via the bundled CLI (scripts/image_gen.py). Use for conc