Two Resolutions, One Click — The macOS Coordinate Roundtrip.

A worked example shows how Claude's vision budget resizes macOS screenshots, shifting coordinates, and how to invert the transform so a click lands on the real pixel.

2:29 video2 min readWatch on YouTube

When Claude looks at a screenshot during macOS computer use, it's tempting to assume the coordinates it reports back land exactly where you'd expect on your screen. They don't. The API caps every image at a 1568-pixel long edge and 1568 tiles of 28-by-28 patches, well under what a native Retina display captures, and if a screenshot isn't resized before it's sent, the server resizes it anyway, in a space that was never actually observed. The result is click drift: a click meant for one button lands somewhere else.

One button, two numbers

The concrete case makes the mismatch obvious. On a native 1920-by-1080 screen, a button sits at (960, 540). Before Claude ever sees the screenshot, the reference implementation's target_image_size() resizes it to 1456 by 819. On that resized image, the same button now sits at (728, 409), a different number for the exact same pixel on screen.

Doing the resize yourself

target_image_size() runs a binary search for the largest width and height that keep the long edge under 1568 pixels and the tile count under 1568, while preserving the original aspect ratio. Calling it before sending the screenshot, and recording what it returns, is what makes the next step possible: those sent dimensions, 1456 by 819 in this case, become the denominator of every inverse calculation that follows.

Inverting the transform

The formula is straightforward: real coordinate equals model coordinate times original dimension divided by sent dimension. Working through the example, 728 times 1920 over 1456 comes out to 960, and 409 times 1080 over 819 comes out to 540. The click lands exactly on the button, but only because the sent dimensions came from an actual resize call rather than a guess.

When there's nothing to invert

If a screenshot is already inside the vision budget and passes through unresized, target_image_size() simply hands the input back unchanged, and there's no scaling left to invert.

Key takeaways

  • Claude's vision budget caps images at a 1568px long edge and 1568 tiles of 28x28 patches, below what a native Retina screenshot captures.
  • Skipping the resize doesn't avoid the problem: the server resizes the image anyway, in a space you never recorded, causing click drift.
  • The reference implementation's target_image_size() runs a binary search for the largest dimensions under budget that preserve aspect ratio.
  • The inverse transform is: real coordinate = model coordinate x original dimension / sent dimension.
  • In the worked example, a button at (960, 540) on a 1920x1080 screen, resized to 1456x819 and reported at (728, 409), inverts back to exactly (960, 540).
  • When a screenshot already fits inside budget, target_image_size() returns it unchanged, so there's nothing to invert.

Try it yourself

The video's own prompt is a good place to start: your screenshot gets resized to 1456 by 819 before Claude sees it, so write the inverse transform so the click hits the native display, then run it against your own macOS computer-use setup. The reference code for this exact example is linked from the video description, from the Humanitarians AI GitHub repository, for anyone who wants to port target_image_size() directly into their own project.

Chapters

  1. 0:00My Retina screenshot reaches Claude exactly, right?
  2. 0:12The wrong guess: over budget, resized either way
  3. 0:35The anchor: one button, two numbers
  4. 0:59The fix: the forward call
  5. 1:25The anchor returns: inverted, and it lands
  6. 1:57Carry-out
  7. 2:08Your turn
  8. 2:22Outro
Full transcript(auto-generated, with timestamps)

My Retina screenshot reaches Claude exactly, right?

[0:00]Someone assumes their retina screenshot reaches Claude pixel for pixel. It doesn't. The API resizes it first into a different coordinate space. So, how do you get Claude's click back onto your real screen? Your Mac's retina display

The wrong guess: over budget, resized either way

[0:12]Captures screenshots well above Claude's vision budget. Every image gets tiled into 28 by 28 patches, capped at 1,568 pixels on the long edge and 1,568 tiles total. The natural guess is that the coordinate Claude reports back already matches your screen's real pixels. Click there without resizing first, and the server resizes it anyway in a space you never saw. Here's the concrete case.

The anchor: one button, two numbers

[0:36]Your screen is 1920 by 1080, and the button sits at 960 540. Before Claude ever sees the screenshot, the reference implementation's target_image_size resizes it to 1,456 by 819. On that resized image, the very same button now sits at 728 409, a different number. For the same pixel,

The fix: the forward call

[0:59]Target_image_size runs a binary search. The largest width and height that keep the long edge under 1,568 pixels and the tile count under 1,568 while preserving the aspect ratio. You call it yourself before you ever send the screenshot, and you record what it returns, 1,456 by 819. Those sent dimensions are the denominator of every inverse you'll ever compute. Now invert it. Real equals

The anchor returns: inverted, and it lands

[1:26]Model coordinate times original over sent. 728 times 1920 over 1,456 is 960. 409 times 1080 over 819 is 540. The click lands exactly on the button. That inverse only works because you recorded genuine sent dimensions from your own resize. Skip that step. Or let a screenshot that was already inside budget pass through unresized, and there's nothing to invert. Target_image_size just hands the input straight back. On macOS, Claude's click lands in the

Carry-out

[1:58]Resized copy of your screenshot, not your native display. Record the size you sent, then multiply back by original over sent to hit the real pixel.

Your turn

[2:08]Your turn. Here's the prompt. Read it with me. On macOS, my screenshot gets resized to 1,456 by 819 before Claude sees it. Write the inverse transform so the click hits the native display. Lay 'em in for bear.

Outro

[2:22]Two resolutions, one click, the macOS coordinate round trip. Lay 'em in for bear.

More from HAI

Humanitarians AI Lyrical Literacy Project