Introduction¶
When using the Anthropic Messages API within DeepSeek Harness (DSH), once a conversation accumulates more than 20 inline images, Anthropic tightens the “maximum unilateral pixel” limit from the usually allowed 8000px to 2000px. DSH itself normalizes attachments to a 2048×2048 pixel budget (8192px on the long side), but smaller images like mobile screenshots are often retained as-is. When there are many images in historical messages, subsequent requests easily hit this limit, causing the entire conversation to error out. The community plugin dsh-anthropic-image-clamp is introduced below; it performs deterministic downscaling on oversized base64 inline images before requests are sent to api.anthropic.com, avoiding the aforementioned errors.
What is this¶
dsh-anthropic-image-clamp is a host plugin for DSH, maintained by noahchalifour, currently at version 0.1.0 (MIT License). It targets error messages resembling:
messages.N.content.M.image.source.base64.data: At least one of the image
dimensions exceed max allowed size for many-image requests: 2000 pixels
The plugin works by wrapping the fetch call for api.anthropic.com/v1/messages, scanning the request body for inline base64 images. If the long side exceeds the configured maxDimension (default 2000), it downscales the image before sending, thereby complying with the 2000px single-side limit under “many-image requests.”
Core Features¶
- Intercept Anthropic Messages Requests: Acts only on messages calls sent to the Anthropic API, rewriting image payloads before they go outbound.
- Clamp Dimensions by Long Side: Default
maxDimensionis 2000, aligning with API limits in multi-image scenarios. - Deterministic Results & Content Hash Caching: When the same image content appears multiple times in history resends, the downscaling result is consistent, helping prompt cache hits remain byte-for-byte accurate.
- Configurable Hosts & Thresholds:
maxDimensionand thehostslist can be overridden via patches in the profile.
The runtime environment requires Node >= 22 (see the engines field in the repository’s package.json).
Installation and Activation¶
The installation command comes from the repository README and requires specifying a profile (using desktop as an example):
dsh plugin --profile desktop add github:noahchalifour/dsh-anthropic-image-clamp
After installation, restart DSH for the host plugin’s fetch wrapper to take effect.
To adjust the clamping dimension or restrict intercepted domains, override the plugin configuration in the corresponding profile’s cordis.patch.yml, for example:
- id: anthropic-image-clamp
config: { maxDimension: 1568, hosts: [api.anthropic.com] }
Typical Usage¶
Daily usage is straightforward: install the plugin in desktop (or other profiles) and restart. Then, use Claude models as usual. When conversation history contains more than 20 inline images, large images in outbound requests will be downscaled by the plugin layer without needing to manually alter attachments or clear history.
If you are using an HTTP proxy provided by a subscriptions-plugin, please note the caveat in the README: requests forwarded through such proxies may use undici’s native fetch and will not pass through this plugin’s wrapper. On machines without such proxy configurations, behavior matches the README description.
Use Cases and Notes¶
Who it’s for: Developers or agent builders who use Claude long-term in DSH, frequently attach screenshots or design drafts, and tend to accumulate large amounts of inline images in long conversations.
Permissions & Security: The plugin runs with the permissions of the current DSH process and will read and rewrite image data in the request body sent to Anthropic. It is recommended to review the source code and LICENSE (MIT) on the GitHub repository before installation to ensure compliance with your requirements.
Ecosystem Note: DSH adopts an “everything is a plugin” extension approach; the community directory SkillHub Plugin Page is an independent site. It has no official affiliation with DeepSeek/High-Flyer and is not an official app store.
Conclusion¶
dsh-anthropic-image-clamp solves the 2000px single-side limit in DSH + Anthropic multi-image sessions by replacing complete failures with deterministic downscaling before the outbound request. Directory and Source Code:
- Directory Page: https://www.skillhub.cn/plugins/noahchalifour/dsh-anthropic-image-clamp
- GitHub: https://github.com/noahchalifour/dsh-anthropic-image-clamp