Prompting Claude Code with Human Demonstrations
Record human workflows and use them to guide Claude Code agents
Overview
Human demonstrations let you record a workflow once and replay it with AI assistance. This guide shows how to connect the Cua MCP server to Claude Code, record a demonstration, and use it to guide automated agents.
Add the Cua MCP Server
Connect Claude Code to your Cua sandboxes:
claude mcp add cua-mcp -- cua serve-mcpVerify the connection:
claude mcp listRun cua auth login first if you haven't authenticated with your Cua API key.
Prompts to Try
Once connected, try these prompts in sequence:
Create a Sandbox
Create a Linux sandbox in north-america with size mediumClaude Code uses the create_sandbox tool to provision a new cloud sandbox.
Record a Demonstration
Record a demonstration on my-sandbox called "login-flow" that shows how to log into the admin panelClaude Code opens the VNC interface with recording enabled. Perform your workflow, then click Stop Recording. The recording is processed and saved as a skill.
Replay the Demonstration
Read the login-flow skill and replay those steps on my-sandboxClaude Code reads the skill from ~/.cua/skills/login-flow/SKILL.md and executes each step using the computer control tools (computer_click, computer_type, etc.).
Managing Skills
# List all skills
cua skills list
# Read a skill's full content
cua skills read my-skill
# Read as JSON (includes trajectory data)
cua skills read my-skill --format json
# Replay the recorded video
cua skills replay my-skill
# Delete a skill
cua skills delete my-skillNext Steps
- Learn about Agent Loops for understanding how agents process tasks
- See Trajectories for debugging and analyzing agent behavior
- Explore Custom Tools to extend agent capabilities
Was this page helpful?