Repository navigation
Replies: 1 comment
|
Worth flagging that the right downscale target is not one constant. Current Claude models, 4.7 and up, read images at up to about 2576px on the long edge, 4784 visual tokens, but anything on an older model caps at 1568px, so a single maxWidth default either wastes tokens on newer models or gets silently resized again on older ones. Separately, Claude Code throws a hard error above 2000px long edge on multi image tool results, independent of the token tradeoff, so whichever default lands under that line avoids a second failure mode on top of the cost one. I measured the pixel to token tradeoff for this kind of capture on my blog, slimsnap.ai/blog/screenshot-downscaling. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
screenshotalways captures at the full viewport (or page) size. Over MCP, image content goes straight into the model context, so every verification screenshot costs about 1.2k tokens at 1366×639. In one 0.39.0 session, 18 screenshots used ~21k tokens, and most were just checking that a step had worked.format: jpeg+qualityhelps file size but not the pixel dimensions that drive image token cost.ifChanged/thresholdhelp only when nothing changed.Suggested fix: a downscale option on
screenshot(CLI flag and MCP parameter), for examplescale: 0.5ormaxWidth: 800. On Chromium this could map to theclip.scalefield ofPage.captureScreenshotwithout changing the page's device metrics.Related: #418 proposed
--scale <css|device|N>, but it targets the old TypeScript implementation (src/actions.ts,src/browser.ts), which has since been replaced by the Rust daemon, and it hasn't been updated since February. This issue is the same request against the current codebase. The focus here is downscaling to save tokens, not DPI.All reactions