Claude Computer Use — Coordinate Out of Bounds
Claude requests a click at coordinates outside your display. Root cause is usually a mismatch: Claude sees the screenshot at one resolution but you're executing at another. Anthropic recommends declaring a specific resolution and downscaling screenshots to match.
Declare display as 1280×800 in the tool config, capture screenshots at your actual resolution, then downscale to 1280×800 before returning to Claude. Claude clicks in the declared coordinate space; your executor scales those clicks up to actual resolution. Always clamp coordinates to display bounds as a safety net.
The Error Symptoms
pyautogui.FailSafeException: coordinates out of screen bounds → Claude sent x=1500 but your screen is 1280 wide Click executed but nothing happened → Coordinate mismatch: clicked empty space instead of button Xlib error: BadValue for XWarpPointer → Negative coordinates or way beyond display Agent stuck in a loop clicking wrong location → Claude sees old screenshot, keeps aiming at stale coordinates Screenshot is 1920x1080 but tool declared 1280x800 → Coordinate space mismatch — need to scale
How Coordinates Actually Work in Computer Use
Claude's space: Whatever dimensions you declared in the tool config (e.g., 1280×800). Claude analyzes screenshots you provided at these dimensions and returns click coordinates within them.
Actual display space: Your real screen (e.g., 1920×1080). To execute Claude's click, scale from Claude's space to your actual space.
What Actually Causes This Error
Fixes That Work (Tested Nov 2026)
1Anthropic's Recommended Resolution
Anthropic recommends declaring one of these standard resolutions to maximize Claude's accuracy:
| Recommended Size | Aspect | Use for |
|---|---|---|
| 1280 × 800 | 16:10 | General desktop (RECOMMENDED) |
| 1366 × 768 | 16:9 | Common laptop resolution |
| 1024 × 768 | 4:3 | Legacy applications |
Claude's vision was calibrated on these ranges. Avoid 4K or ultrawide declarations — accuracy drops.
2Coordinate Scaling Utility
3Handle HiDPI / Retina Correctly
On HiDPI displays, the screenshot is captured at physical pixels (e.g., 2880×1800) while UI positions are logical (1440×900). You must handle both dimensions consistently. Solution: capture physical, downscale to your declared size (e.g., 1280×800), and scale clicks back up to logical coordinates (which is what pyautogui expects).
Preventing This Error Going Forward
- Use one of Anthropic's recommended resolutions. 1280×800 works best.
- Always downscale screenshots to declared dimensions. Never send raw 4K.
- Scale Claude's coordinates before executing. Two coordinate spaces = math required.
- Always clamp final coordinates. Safety net against math bugs.
- Log intended vs actual click location. Debug misses quickly.
- Handle HiDPI explicitly. Physical vs logical dimensions differ 2×.
- Test with a known target first. Click a known-location button before real workload.
Researcher · AI Error Hub
Frequently Asked Questions
Claude's vision was calibrated on standard desktop resolutions. Very small (mobile-size) or very large (4K) screenshots have lower click accuracy. 1280×800 is the sweet spot for both cost (fewer tokens) and precision.
Claude returns integer coordinates. If you upscale from 1280×800 to 1920×1080, a Claude coord of (100, 100) becomes (150, 135). Sub-pixel precision doesn't matter for clicking — buttons are dozens of pixels wide.
Claude uses the scroll action explicitly. After scroll, take a new screenshot and return it. Claude will re-evaluate. Never scroll without returning a fresh screenshot — Claude will click at stale coordinates.
No — modern Claude models handle coordinates well without grids. Adding overlays confuses the visual model. Trust its native ability.
Yes with a two-tool pattern: use a separate high-res screenshot for reading (via image content block), keep computer tool at 1280×800 for clicks. Advanced but effective for dense UIs.
Related Errors
Build Precise Computer Use Agents
Weekly deep dives on coordinate handling, screen capture, and agent reliability. 12,000+ developers subscribe.
Subscribe Free →