Pixels, elements or code: how an agent decides where to click

Coordinates, named elements and generated code fail in different ways. Which one an agent uses predicts its behaviour better than which model is behind it.

Photo: Startup Stock Photos / StockSnap, CC0

Every computer use agent has to answer one question on every step: where exactly should I click? The answers fall into three families, they fail in different ways, and which one an agent uses predicts its behaviour more reliably than which model sits behind it.

The opening split in the directory is desktop versus browser, and What is a computer use agent? describes the loop all of them share: capture the screen, ask a model, act, repeat. This page is about the step inside that loop that gets the least attention, the one that turns a decision into a click.

Family one: coordinates

The model looks at a screenshot and returns a position. Move the pointer here, click, type this. It is the most general approach, because a screenshot is the one thing every application has in common. It is how Claude Computer Use works on a full desktop, and it is what makes a desktop agent able to drive anything, including software with no accessibility support at all.

Its weakness is that a coordinate is a statement about a picture at one moment. If the layout shifts between the screenshot and the click, the click lands somewhere else. Cookie banners, late-loading images and a promotional overlay appearing mid-task all do this. The use-case pages return to the point repeatedly: banners and interstitials consume actions and occasionally capture an agent's attention completely (Ordering the weekly groceries).

Anthropic's computer toolset added zoom, enabled by default, and batched actions, which lets several actions go in one turn. The first helps when a screenshot is too coarse to read a small target; the second saves a model round trip per click.

Family two: named elements

The agent reads the structure of the page, not a picture of it, and acts on an element by reference. Claude Browser Use is the cleanest example in the directory. Its read_page returns the accessibility tree with element references, and the model acts on them by name, so a click targets an element and survives a layout shift that would break a coordinate (Anthropic takes computer use out of beta and splits off a browser tool).

The cost is scope. This only works where there is a structure to read. Anthropic's toolset is browser-only for exactly that reason. A native desktop application with a poor accessibility tree, or a canvas-rendered interface, has nothing to name.

Stagehand sits in this family from a different direction. It mixes natural-language actions with deterministic browser code, using Playwright-style methods, so that selectors and model calls can sit in the same script, and its pitch is to use the model only where the page is genuinely unpredictable. The deterministic selector is the default and the model is the exception.

Family three: not clicking at all

Some agents skip the interface and write code. Open Interpreter takes this road: the model writes Python, JavaScript, Bash or PowerShell and runs it locally. For a task that can be expressed as a script, this beats operating a GUI on speed, cost and repeatability.

It trades one risk for another. Generated code touches files and system settings directly, and the safeguard is a human approving each block. Notice also that OpenAI's guide now recommends code execution for GPT-6 Astra and describes the computer tool as supported as an alternative. The industry is moving toward this family where it can, and using a screen where it must.

The hybrid that vision-first tools are betting on

Skyvern works from what a page looks like rather than how it is marked up, which is aimed squarely at the failure mode of selector-based scripts: layouts change and selectors break. The trade is cost. Vision inference costs more per step than a selector lookup, and volume adds up. UI-TARS is the open-weights version of the same bet for desktop and mobile, a vision-language model trained for GUI control that you can run on your own hardware.

Choosing by failure mode

ApproachWorks onBreaks when
Coordinates Anything with pixels The layout moves between look and click
Named elements Pages with a usable structure There is no structure to read
Vision-first Sites that change their markup Volume makes the per-step cost bite
Code Tasks a script can express The software has no scriptable surface

What this means in practice

If your task stays inside web pages, start with element addressing, because it removes a whole class of failure for free. If it crosses applications, you need coordinates and you should plan for flakiness around overlays and loading states. If it can be a script, make it a script and keep the agent for the part that cannot.

Whichever you pick, run a task twice and compare. A step that works four times in five is worse than a step that fails every time, because it teaches the team to stop looking. This is also why this directory publishes no benchmark scores: Why computer use benchmark scores don't compare explains how many of these variables a single number hides.