Understanding Computer Use

How Computer Use Works

5 min read

Computer Use operates through a continuous feedback loop between Claude and your computer. Understanding this loop is essential for building effective agents.

The Agentic Loop

One turn of the agentic loop

The animated edge is the one people forget: nothing moves until your code sends a fresh screenshot back.

looptask completeTask + first screenshotYou open the loop with the goal…Claude looks and decidesVision reads the screen; the mo…tool_use block returnedA structured action: click at x…YOUR SIDEYOUR code executes itAnthropic never touches your ma…New screenshot capturedThe result of the action, sent …stop_reason: end_turnThe model stops asking for tool…

The loop has exactly one dangerous step, and it is yours. Steps 1-3 happen inside the API. Executing the action runs on your machine, with your permissions. Every safety control in Module 5 attaches to that one step, because it is the only one you can intercept.

The Computer Tool

The computer_20251124 tool version provides these actions:

ActionDescription
screenshotCapture current screen state
mouse_moveMove cursor to x,y coordinates
left_clickClick left mouse button
right_clickClick right mouse button
double_clickDouble-click left button
triple_clickSelect entire line/paragraph
left_mouse_downHold left button (for dragging)
left_mouse_upRelease left button
scrollScroll up/down/left/right
typeType text string
keyPress keyboard key or combo
hold_keyHold a key while performing action
waitPause for specified duration
zoomView a specific screen region at full resolution (requires enable_zoom: true)

Required Headers

Computer Use is opt-in per request. Include the beta header:

headers = {
    "anthropic-beta": "computer-use-2025-11-24"
}

Screen Resolution

Claude works best with specific resolutions. The recommended setup:

# Optimal resolutions for Computer Use
RECOMMENDED_RESOLUTIONS = [
    (1024, 768),   # XGA - fast, efficient
    (1280, 800),   # WXGA - good balance
    (1920, 1080),  # Full HD - more detail
]

Tip: Lower resolutions mean faster screenshot processing and lower token costs.

Vision-Based Understanding

Claude uses its vision capabilities to:

  1. Identify UI elements (buttons, text fields, menus)
  2. Read text on screen
  3. Understand layout and spatial relationships
  4. Track changes between screenshots

This means Claude can work with any application without needing specialized integrations.

Next, we'll look at the Agent SDK that simplifies building these loops. :::

Quiz

Module 1: Understanding Computer Use

Take Quiz
Was this lesson helpful?

Sign in to rate