Overview
Run Claude with the computer use tool in an isolated desktop container, let it play a simple game such as 2048 for a long, capped session, and log every move and screenshot so you can study how it plays.
Problem or Objective
- Which agents can play, test or benchmark themselves on games through a browser or screen?
- Which agents run and log experiments without supervision?
More in Games and Simulations
AI Agents and Models
Tools and Integrations
- Tools
- Claude API · Docker
- Prerequisites
- A Claude API key, a container or virtual machine to act as the desktop, and code that runs the computer use loop. Check which models support the current computer use tool version and its cost per request.
How It Works
Set up an isolated desktop in a container or virtual machine with minimal privileges and no logins or personal data on it. The Computer Use Demo in Anthropic's claude-quickstarts repository is one way to build this. Install or open a simple single-player game, such as an open-source 2048 clone, that runs locally inside that desktop. Limit internet access to an allowlist, or turn it off. Give Claude a short brief: the game's rules, the goal, and that it should take a screenshot after each move and note its reasoning briefly. In your agent loop, set a maximum number of turns, a time limit and a spending cap, and save every action, screenshot and score to a log file. Start the session, check in periodically, and stop it at the cap. Afterwards, read the log to see where play improved, stalled or repeated, and run the same setup again to see how much the results vary.
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 API, Docker.
- Check the prerequisitesA Claude API key, a container or virtual machine to act as the desktop, and code that runs the computer use loop. Check which models support the current computer use tool version and its cost per request.
- Gather your detailsCollect what the prompt asks for: The game, Short rules, What counts as success, Move cap per session.
- 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 the game and log each move
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are playing [The game] on this desktop. The rules: [Short rules]. Your goal is [What counts as success]. Before each move, take a screenshot, then make one move and state in one sentence why you chose it. Do not open a web browser, other apps or any settings. Stop when the game ends or after [Move cap per session] moves, whichever comes first, and report your final score.Run it only inside the isolated container, with turn, time and spending caps set in your loop, and save every action and screenshot for review.
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 documentation says the computer use tool gives Claude screenshot capabilities and mouse and keyboard control for autonomous desktop interaction, with your application performing each action on your own container or virtual machine. The quickstarts README describes the Computer Use Demo as an environment and tools Claude can use to control a desktop. No cited page reports game scores or how play changes over hours, so treat each run as an observation, not a benchmark.
Limitations and Considerations
Anthropic recommends a dedicated virtual machine or container with minimal privileges, keeping login details away from the model, limiting internet access to an allowlist of domains, and asking a human to confirm decisions with real-world consequences. It also warns that instructions in web pages or images can override yours, so keep the game local. Long sessions send many screenshots through the API, so check the cost per request and set a hard spending limit before you start. Check the game's licence before recording or publishing runs. 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
- Claude can interact with computer environments through the computer use tool, which provides screenshot capabilities and mouse/keyboard control for autonomous desktop interaction.
- Using a dedicated virtual machine or container with minimal privileges to prevent direct system attacks or accidents.
- Limiting internet access to an allowlist of domains to reduce exposure to malicious content.
- 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
- An environment and tools that Claude can use to control a desktop computer. This project demonstrates how to leverage the computer use capabilities of Claude.
- To use these quickstarts, you'll need an Claude API key.