/use-agentvision:use-agentvisionfrom use-agentvision
Control the user's real macOS screen via the `agent-vision` CLI — session management, element targeting, and UI interaction on live windows. Triggers: user says "look at my screen", "use agent-vision", "the app/browser/simulator is open", "take a screenshot of my screen", "fill this form" (when app is already open), "check the UI", "watch the browser", "navigate to" (in an open app), "scroll through", "click on" (in a visible window), "I have X open", visual QA of running applications, iOS Simulator or Android emulator interaction, before/after visual comparison of live UI, or any task requiring real screen capture and control. NOT for: headless browser testing, Playwright/Puppeteer scripts, code-only reviews, file-based screenshots, or building screen capture features.
Ships in use-agentvision. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Agent Vision is a macOS CLI that gives you eyes and hands on the user's screen. You can screenshot a selected region and control the mouse, keyboard, and UI elements within that region.
Use it for: visual feedback loops during UI development, navigating applications, filling forms, visual QA, testing mobile emulators, and any task that requires seeing and interacting with what's on screen.
Reference files in this skill's directory:
references/cli-reference.md— full command syntax, flags, and error tablereferences/app-tips.md— per-app behaviors and shortcutsreferences/clipboard.md— sharing files into apps via the macOS clipboardreferences/install.md— install and permission setup
Check that agent-vision is installed:
which agent-vision
If not found, read references/install.md and guide the user through it (brew install rvanbaalen/tap/agent-vision + Screen Recording + Accessibility permissions).
Every agent-vision interaction happens within a session that scopes all commands to a user-selected screen region.
Preferred — open when you know the app:
agent-vision open Safari
# add --title "..." to disambiguate multiple windows of the same app
Launches (or activates) the app and automatically selects its window. No manual interaction required.
Manual area selection — start:
agent-vision start
Blocks until the user drags or clicks to select an area. Use this for custom regions or when open doesn't apply. Tell the user exactly what to select: "Please select the browser window showing the app" — not just "please select an area".
Both commands print:
Area selected: 800x600 at (100, 200))Capture the UUID and pass it as --session <uuid> to every subsequent command. Shell variables don't persist between separate Bash calls — either chain commands in a single call, or paste the literal UUID into each command.
When done, confirm with the user before stopping:
agent-vision stop --session <uuid>
Every UI interaction follows this loop:
agent-vision elements --session <uuid> to discover what's on screensleep 0.5 (or longer for page loads) to let the UI updateelements again before the next interactionElement indices change after every UI update. Never reuse indices from a previous scan.
Complex apps can return 80+ elements. Use jq to cut OCR noise and focus on interactive elements:
agent-vision elements --session <uuid> | jq -r '.elements[] | select(.source=="accessibility") | "\(.index): \(.role) - \"\(.label // "")\" @ (\(.center.x | floor),\(.center.y | floor))"'
Prefer --element N over --at X,Y whenever the target appears in the scan:
--element N (preferred): Accessibility API. Focus-free — doesn't move the cursor or steal focus. The user can keep working in another window while you interact.--at X,Y (fallback): CGEvent. Moves the cursor and steals focus. Only use when the target genuinely isn't in the scan (canvas UIs, custom-drawn elements).OCR text vs interactive elements: if the scan shows OCR staticText, look for a nearby accessibility element (button, link, group) that wraps that text. Click the interactive parent with --element, not the raw text coordinates.
Coordinate verification when using --at: always preview first.
agent-vision preview --session <uuid> --at 400,150
# Read the preview PNG — the green dot must land on the target before you click.
See references/cli-reference.md for the full syntax of click, type, key, scroll, and drag.
agent-vision capture --session <uuid> --output /tmp/screenshot.png
After capturing, read the PNG with the Read tool and describe what you see. This confirms you're looking at the right thing and builds shared understanding with the user.
Before/after comparisons:
agent-vision capture --session <uuid> --output /tmp/before.png
# ...make changes, wait for reload...
sleep 2
agent-vision capture --session <uuid> --output /tmp/after.png
When an app needs an image or file attachment, don't navigate Finder via agent-vision — it's unreliable and the dialogs are hard to target. Copy to clipboard with osascript and paste with Cmd+V instead. See references/clipboard.md for the full recipe.
For multi-step sequences (form filling, multi-page navigation, repetitive UI tasks), dispatch a sonnet subagent with run_in_background: true and stream its progress with the Monitor tool. This keeps the main conversation lean, lets the user see what the subagent is doing in real time, and frees the main thread to handle other work.
Pattern:
subagent_type: "general-purpose", model: "sonnet", run_in_background: true.echo after each milestone:
echo "scanned 42 elements"echo "clicked Submit"echo "captured /tmp/result.png"Monitor on the returned agent ID — each echo becomes a notification you can surface to the user.Example Agent prompt for a background form-filler:
You have access to agent-vision. Use session UUID <uuid> to fill and submit a contact form.
Read <skill-path>/references/cli-reference.md for the full CLI.
Task:
- Name: John Doe
- Email: [email protected]
- Message: Hello, I'd like to discuss pricing.
Rules:
- Follow scan → act → re-scan. Run `agent-vision elements --session <uuid>` before every interaction.
- Use `--element N` targeting, not `--at X,Y`.
- After every step, echo a one-line progress marker (e.g., `echo "typed into Name field"`) so the
parent agent can stream your progress via Monitor.
- After submitting, `sleep 1`, capture `/tmp/form-result.png`, and Read it to confirm success.
- Echo "done" as your final line.
Do not use Monitor to replace the sleep calls inside the scan-act-re-scan loop — those are timed UI settle waits with no stream for Monitor to consume.
Delegate (background subagent + Monitor):
Keep in main:
See references/app-tips.md for per-app behaviors (browsers, messaging apps, mobile emulators, IDEs, terminals, canvas tools, file managers).
open, Puppeteer, Playwright, or other automation tools. osascript is allowed only for the clipboard recipes in references/clipboard.md.--element. Never send blind keystrokes.before.png)after.png)--element Nagent-vision open WhatsApptextField with --element Nenter to sendreferences/clipboard.mdDelegate to a background subagent (see Delegating Long Flows):
See the error table in references/cli-reference.md for the full list. Most common:
agent-vision start and have the user select an areaelements before every interactionelements times out waiting for focus — run agent-vision focus --session <uuid> --timeout 10 explicitly. Can happen right after open if the app is still settling.x values start well inside the area (e.g., window bounds at x=400 when the area is 1046 wide), the captured area is offset from the window. Stop the session and re-run agent-vision open <app> for a fresh alignment.staticText from windows behind the target app. Filter by source: "accessibility" for reliable targeting. Unrelated OCR results will have coordinates outside the target app's bounds.When stuck, capture a screenshot, describe what you see, and ask the user for help rather than guessing.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub rvanbaalen/skills --plugin use-agentvision