Research

How AI coding tools handle visual edits, and what to give them so they stop guessing

AI models read a screenshot well enough to see that something looks wrong, but they are weak at saying exactly where it is: published studies and the vendors' own documentation both say so. They do much better when each spot carries a number on the picture and is tied to an element in the code, so a visual edit should reach the AI as the element, a note with the change, and a numbered mark on a full snapshot, with all the edits in one batch.

Published by Peak Human Edits.

Seeing is easy, locating is hard

Current models can describe a screenshot and often notice that something on the page looks wrong; that is an observation from use, not a measured result. Saying exactly where, in pixels or as "the third button from the left", is the weak part, and the vendors say so themselves. OpenAI's vision guide lists among its limitations: "The model struggles with tasks requiring precise spatial localization, such as identifying chess positions." Anthropic's documentation says "Claude's spatial reasoning has limits" and adds: "Small elements lose precision when an image is downscaled: for fine targets, crop the region of interest and send the crop."

Research on screens says the same, with numbers. SeeClick (Cheng et al., 2024) built ScreenSpot, a benchmark that asks a model to find the element an instruction describes on mobile, desktop and web screenshots, and called this "GUI grounding" a key challenge: "Even GPT-4V struggles with accurately locating screen elements." In its results table GPT-4V found the right element 16.2% of the time on average. The OmniParser paper (Lu et al., 2024) puts it bluntly: "GPT-4V is unable to produce the exact x-y coordinate of the button location."

Building pages from screenshots shows the same weakness. Design2Code (Si et al., 2024) tested models on 484 real web pages and found that they "mostly lag in recalling visual elements from the input webpages and generating correct layout designs."

These studies tested models from 2023 and 2024, mostly GPT-4V. Newer models have come out since, and the tests were not re-run for this article, so read the numbers as the size of the problem in those studies rather than as today's scores. The vendors' own limitation notes, read today, still describe the same weakness.

Big screenshots shrink before the model sees them

A model does not see a screenshot at full size. Anthropic's documentation gives the limit as "1,568 px on the standard tier, 2,576 px on the high-resolution tier" on the long edge, and notes that even "a 1920×1080 screenshot resizes to 1456×819." A full-page snapshot of a long desktop page, 1440 px wide and 6,000 px tall, scaled to fit 1,568 px on its long edge, would reach the model at most about 376 px wide (arithmetic from that limit, not a figure from the documentation): body text becomes a few pixels tall. OpenAI's guide likewise says "Images may be resized before analysis."

So one giant screenshot of a whole page is a poor way to show small problems. Pictures cut into parts of moderate height, each still at the page's real width, keep small text far more legible; it is the same idea as Anthropic's advice to send a crop of the region that matters.

What helps: a number on the spot

The clearest result comes from Set-of-Mark prompting (Yang et al., 2023). The authors split an image into regions and "overlay these regions with a set of marks e.g., alphanumerics, masks, boxes", so that the model can answer with a label instead of a position. On one grounding task in their results table (RefCOCOg), GPT-4V scored 25.7 when asked for coordinates directly and 86.4 with the marks. They write: "SoM significantly improves GPT-4V's performance on complex visual tasks that require grounding."

OmniParser applied the idea to screens: it detects the clickable elements in a screenshot, labels each "with a unique ID next to it" and adds a short description of each. On ScreenSpot that raised GPT-4V's average from 16.2% to 73.0% in its results table. The gain comes from the IDs and the descriptions together, not from the IDs alone.

The lesson for visual edits: a model that cannot reliably find "the spot 40 px under the heading" can reliably read the number 3 drawn on that spot. Anthropic gives the same advice for whole images: "When sending several images, introduce each one with a short text label (Image 1:, Image 2:, and so on)".

What helps: naming the element

Words are the other source of guessing. On r/vibecoding, someone asked Claude for a phone layout with a save button at the bottom: "it put the button at the bottom of the screen so it would stay there while scrolling. i meant after the last field". On r/cursor, a pricing page had three cards with the same button and one was misaligned on mobile; the poster wrote that after describing it, "the agent edits the wrong card, or all three."

An element reference removes that ambiguity in the code itself. A CSS selector is, in MDN's words, one of the "patterns used to match, or select, the elements you want to style": the AI coding tool can search the code for it instead of interpreting a description. A selector alone can be fragile, since generated class names change and three identical cards share one, so it works best with the element's visible text and the numbered mark on the picture: three independent ways to land on the same element.

What helps: the change, written next to it

The mark says where; the note has to say what. "Make the heading about 32 px on phones" can be done and checked; "looks off" sends the model back to guessing what you would like instead. The note belongs with the mark, under the same number, so the AI never has to match a list of sentences to a set of circles.

Why one batch rather than one edit per message

This has not been measured; the reasons are practical. The usual workflow is a loop: screenshot, describe, wait, check, repeat. A post on r/ClaudeAI described it well: "What I used to do was screenshot everything and type out what was wrong. It does the job but it takes a lot of back and forth" (the thread). Handing over every edit at once changes three things. The AI sees related problems together, such as the same card component misbehaving on three pages, and can fix the shared cause once. Each edit keeps its number, so the AI can report on each one, done or not and why, and nothing is silently skipped. And you review once, then check once, instead of switching between reviewing and prompting all afternoon.

The plumbing for this exists. Claude Code's documentation says images can be dragged in, pasted, or given as a file path, and suggests "screenshots of errors, UI designs, or diagrams for better context". The Model Context Protocol, which AI coding tools such as Claude Code can connect to, lets a tool's result contain images as well as text (its specification shows an "image" content type), so an agent can fetch each snapshot and its notes itself instead of you pasting them in one at a time.

Putting it together

From the research and the docs, a visual edit an AI can act on without guessing has five parts:

  1. The element: its CSS selector and visible text, or an area inside a named element when the problem is a gap.
  2. The change, written as an instruction.
  3. A numbered mark on a snapshot of the page, the same number as the note.
  4. The position of the mark on that snapshot, in pixels, at the width it was taken.
  5. The width: desktop, tablet or phone, because the same element can be fine at one and broken at another.

And the edits travel as one batch, with the snapshots cut into parts the model can read at full detail. Several website feedback tools now pass notes to AI coding tools along these lines, through an MCP server or an export, and they differ in how many of these parts they include: a ranked list of seven of them scores each tool's hand-off with one published checklist, Peak Human Edits included. The same format can also be put together by hand with a browser's developer tools, as the last section of the phone layout guide shows.

What is not known yet

None of the studies above tested the question that matters most here: how often an AI coding tool makes the intended visual change, given the same edits in different formats. They test finding things on screens, which is the step underneath. The studies and documentation cited are other people's work, each linked under Sources; connecting them to visual edits, as this article does, is an interpretation, not their finding. No published comparison of feedback formats for AI code edits was found, and no such test has been published on this site.

Questions

Can't the AI just look at a screenshot?

It can see one, and it often notices what is wrong. Saying precisely where is the weak part: OpenAI's and Anthropic's own docs list precise localization as a limitation, and in the studies above GPT-4V found the described screen element 16.2% of the time on average.

Why numbers instead of circles or arrows alone?

A number is a label the model can read and the note can refer to. In the Set-of-Mark study, labelled marks raised GPT-4V's score on a grounding task from 25.7 to 86.4. Circles and arrows show where; the number ties that spot to one note.

Is a CSS selector enough on its own?

Not always. Generated class names change, and repeated components share a selector. With the element's text and a numbered mark on the snapshot, the AI has three ways to find the same element.

Sources

Read on 4 December 2026. Prices and plans change; check the vendor's page before you buy.