Overview
Use the Claude computer use tool from a small program on a separate Mac user account or virtual machine so Claude can read a chess board from screenshots, make moves with the mouse and keep a move log in a text file.
Problem or Objective
More in Games and Simulations
AI Agents and Models
Tools and Integrations
- Tools
- Claude computer use · macOS
- Prerequisites
- Claude API access with the computer use tool, a separate macOS user account or virtual machine with a chess application, and code to run the agent loop.
How It Works
Set up a separate macOS user account or virtual machine with only a chess application and a text editor, signed in to nothing else. Build or adapt a computer-use agent loop that sends Claude screenshots and carries out its mouse and keyboard actions; the native-macOS reference implementation in the anthropics/claude-quickstarts repository is one way to build this. Scale screenshots and coordinates correctly for a Retina display. Start a new game against the computer, give Claude the prompt below, and let it play: after each move it writes the move in standard notation to the log file. Watch the session, stop the loop if Claude clicks outside the board, and compare the log with the game record at the end.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude computer use.
- Connect the toolsConnect the tools this workflow relies on: Claude computer use, macOS.
- Check the prerequisitesClaude API access with the computer use tool, a separate macOS user account or virtual machine with a chess application, and code to run the agent loop.
- Gather your detailsCollect what the prompt asks for: Colour Claude plays, Computer opponent level, Move log file, How to make a move, Maximum number of moves.
- Run the starter promptPaste the starter prompt below into Claude computer use and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at platform.claude.com before you rely on it.
Practical Starter Prompt: Play one game of chess on screen
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are playing [Colour Claude plays] in the chess application that is open on screen, against the computer at [Computer opponent level]. Use only the chess window and [Move log file] in the text editor. Before each move, take a screenshot and describe the position briefly; then make one legal move by [How to make a move]. After each move, add it in standard notation to [Move log file]. Stop after [Maximum number of moves] moves or when the game ends. Ask me before resigning, offering a draw or starting a new game, and do not open any other application.Run this only in the separate account or virtual machine, watch the session, and answer Claude when it asks about resigning, a draw or a new game.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Anthropic's computer use documentation describes a tool that lets Claude act on a desktop through screenshots plus mouse and keyboard actions run by your own application, and notes that macOS Retina screenshots need their coordinates scaled. It also says some interface elements can be tricky to manipulate. Nothing on the pages covers chess, so whether Claude reads the board and plays legal, sensible moves has to be watched game by game.
Limitations and Considerations
Anthropic recommends a dedicated virtual machine or container with minimal privileges; do not run the loop on an account with your email, passwords or files. Each turn of the agent loop is a new API call that carries screenshots, so long games cost tokens; the documentation recommends a maximum iteration limit to prevent unexpected API costs, so set a move limit as well. It also says some interface elements can be tricky to manipulate with the mouse and suggests prompting for keyboard shortcuts then; check whether your chess app accepts click-to-move or typed moves. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
Suggested Implementation Component
A repository that could serve as a building block. It is not part of the cited account and is not evidence that the workflow was run.
Sources
- Computer use tool - Claude Platform Docs (opens in a new tab)
Project documentation · platform.claude.com · Undated · Source checked 25 Nov 2026, 12:00 UTC
What this source supports
- Anthropic recommends using a dedicated virtual machine or container with minimal privileges to prevent direct system attacks or accidents.
- Some UI elements (such as dropdowns and scrollbars) might be tricky for Claude to manipulate using mouse movements.
- macOS Retina displays capture screenshots at a device pixel ratio of 2, so the image is twice the resolution of the logical screen coordinates.
- anthropics/claude-quickstarts README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- The Computer Use Demo is an environment and tools that Claude can use to control a desktop computer.
- Computer Use Best Practices is a pedagogical, native-macOS reference implementation of a computer-use agent.