An AI-powered desktop automation agent that uses Claude's Computer Use capabilities to interact with a virtual desktop environment. The agent can execute bash commands, control the mouse/keyboard, edit files, and perform multi-step tasks autonomously inside a Docker container with a virtual display.
- Claude Computer Use -- leverages Anthropic's computer use API (tools:
computer,bash,text_editor) - Virtual Desktop -- runs a full GUI environment (Xvfb + Fluxbox) inside Docker
- VNC Access -- monitor the agent's actions in real-time via noVNC (browser) or VNC client
- Agentic Loop -- iterative tool-use loop with up to 10 reasoning steps
- Extended Thinking -- uses Claude's thinking mode for better planning
Docker Container
+------------------------------------------+
| Xvfb (virtual display :1) |
| +-- Fluxbox (window manager) |
| +-- Firefox / Chromium |
| +-- x11vnc --> noVNC (:6080) |
| |
| agent_loop.py |
| --> Anthropic API (Claude) |
| --> bash tool (subprocess) |
| --> computer tool (screenshots, etc.) |
+------------------------------------------+
- Docker and Docker Compose
- Anthropic API key with Computer Use access
git clone https://github.com/mazamaka/ai_desktop_agent.git
cd ai_desktop_agentcp .env.example .env
# Edit .env and set your Anthropic API keydocker compose up --build -d
Open your browser and navigate to http://localhost:8080 to view the agent's desktop via noVNC.
You can also connect directly via VNC on port 5900.
| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key | Yes |
ai_desktop_agent/
agent_loop.py # Main agent loop (Claude Computer Use)
scripts/
runner.py # GUI automation helper (pyautogui)
Dockerfile # Ubuntu 22.04 + Xvfb + VNC + Python
docker-compose.yml # Service configuration
run.sh # Entrypoint script
supervisord.conf # Process manager config
requirements.txt # Python dependencies
- The Docker container starts a virtual display (Xvfb) with a window manager
agent_loop.pysends a task to Claude via the Anthropic API- Claude responds with tool calls (
bash,computer,text_editor) - The agent executes the tool calls and returns results to Claude
- This loop continues until the task is completed (or max iterations reached)
To change the task the agent performs, edit the initial message in agent_loop.py:
messages = [ {"role": "user", "content": "Your task description here"} ]
Maksym Babenko
This project is licensed under the MIT License.