computer-use

computer-use is a skill for Claude Code, Codex from bojieli/ai-agent-book. It costs 139 tokens per session (2,859 once invoked), scanned A, original, Apache-2.0.

A guide to building agents that operate graphical interfaces through screenshots, mouse actions, keyboard input, and waits. It explains how to identify interface elements and safely repeat the observe, decide, and act cycle.

In plain words
What is it for?
Use it to automate desktop apps, websites, forms, and virtual screens; choose between element indexes, visual labels, or raw coordinates; and add confirmation and isolation before actions such as purchases or deletion.
Why use it?
Some software has no usable programming interface, so ordinary scripts cannot control it reliably. Screen-based automation must also handle changing layouts, coordinate errors, loading delays, and irreversible actions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to automate desktop apps, websites, forms, and virtual screens; choose between element indexes, visual labels, or raw coordinates; and add confirmation and isolation before actions such as purchases or deletion.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bojieli/ai-agent-book/computer-use
About the project

AI Agent: Design Principles and Engineering Practice is an open-source book that explains how AI agents combine language models, context, and tools, with accompanying experiments and code. It is intended for readers studying the principles and engineering of AI agents, from fundamentals through production use. The catalogue skills support coding-agent work related to the book's subject matter.

bojieli/ai-agent-book · 54,406 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bojieli/ai-agent-book --skill computer-use
Clone the repo
git clone --depth 1 https://github.com/bojieli/ai-agent-book

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for computer-use

README.md
[![agentmods](https://agentmods.dev/badge/skills/bojieli/ai-agent-book/computer-use/github.svg)](https://agentmods.dev/skills/bojieli/ai-agent-book/computer-use)
Your own site
<a href="https://agentmods.dev/skills/bojieli/ai-agent-book/computer-use"><img src="https://agentmods.dev/badge/skills/bojieli/ai-agent-book/computer-use/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for computer-use

Your own site · 80×15
<a href="https://agentmods.dev/skills/bojieli/ai-agent-book/computer-use"><img src="https://agentmods.dev/badge/skills/bojieli/ai-agent-book/computer-use.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 139 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,859 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00139 $0.02859
Opus 5.5 $0.00056 $0.01144
Sonnet 5.5 $0.00028 $0.00572
Haiku 4.5 $0.00014 $0.00286

Measured 22d ago against content hash aa65a04de8cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

computer-use scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 22d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/computer-use/SKILL.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Computer Use:GUI 自动化 Agent

何时使用

  • 要让 Agent 操作没有 API 的软件:填表、改系统设置、在网页上完成多步流程。
  • 要评估或实现"截图 → 决策 → 执行动作"的闭环,选模型、选 grounding 方案、选框架。
  • 定位不准、坐标偏移、点击错元素,需要排查 grounding 与坐标缩放链路。
  • Agent 每 3–5 秒才看一眼屏幕,错过通知、视频、弹窗等"两帧之间发生的事"。
  • 要把 Computer Use 扩展到移动端(Android 无障碍服务)或评估平台封禁风险。
  • 设计不可逆操作(删除、购买、提交)前的确认与安全边界。
  • 要减少操作步数与等待时间,让 Agent 达到"实用"而不只是"答对"(对照 OSWorld-Human 的人类基线)。
  • 没有编程 API 可用、Selenium 之类脚本化方案难以维护页面的场景。
  • 要在容器化虚拟桌面中跑 Agent,并隔离不可逆操作对真实环境的影响。

核心原则

  • 核心是感知-思考-行动循环:截图 → 多模态模型输出思考 + 一个动作 → 执行层真实执行(移动鼠标、点击、输入)→ 等界面响应再截图进入下一轮。
  • 区分"看懂界面"和"完成任务":前者可用一次截图问答测量(多模态理解);后者要求把理解和动作放进闭环,处理页面加载、状态变化、误操作和不可逆后果。每执行一步都要重新确认现实是否仍符合计划。
  • 动作空间分三类:GUI 操作(鼠标移动/点击/拖拽/滚动、键盘输入/组合键/长按、截图与等待)、持久 bash 会话(跨调用保持环境状态,用哨兵字符串判命令是否执行完)、字符串匹配的文件编辑(比整文件覆盖更精确,可撤销)。
  • 动作空间不是供应商私有协议:只要 Harness 能把同样的截图、动作约束和执行结果转换成目标模型支持的消息与结构化输出,Claude、开放权重视觉模型和自托管端点都能驱动同一个循环。
  • Grounding 优先把定位变成选择题:先给元素编号,模型只报 ID,系统换算中心坐标。选择题比填空题容易答对——模型说"点击 [123]"而不是"点击 (350, 464)"。三条路线按界面性质选:
    • 结构化元素索引(DOM / Accessibility Tree,browser-use 路线):结构化信息可得时首选,最精确稳定,无分割模型的漏检误检。
    • Set-of-Mark 视觉标注:用分割模型切候选区域叠加编号,不需要 DOM,原生桌面软件、游戏、Canvas/WebGL 界面适用。
    • 纯坐标预测(SeeClick、Claude computer use):直接在 GUI 截图-坐标配对上训练的模型更直接,省去标注步骤,但小元素和密集界面精度差。
  • 坐标预测必须做分辨率管理:模型对坐标的理解依赖训练分辨率,不匹配就系统性偏移。按宽高比选最接近的目标分辨率做双向缩放(如 2560×1440 的 16:9 屏幕选 FWXGA 1366×768,模型返回 (683,384) 反推真实坐标约 (1280,720))。切忌非等比拉伸把画面压扁。
  • "屏幕是静止的"是危险假设:该重新设计的是观察接口而不是动作接口——用关键帧截图(小模型判断是否有意义的变化,变化频繁时约 1 秒一次)、音量门控的语音转写、把截图压成一句持久文字描述来压缩多模态历史。
  • 世界模型带来"推测执行":行动前预测候选动作造成的状态差异,一致就沿计划继续,偏离才停下重规划。要预测的是可检查的状态差异(窗口、焦点、滚动位置、输入框内容、加载状态、权限、网络返回),不是生成逼真未来截图。
  • 生态壁垒是结构性问题:Agent 直达目标会绕过广告与推荐变现链路,平台有动机封禁;这不只是 CAPTCHA 的技术对抗,短期难以调和。
  • 循环节奏与尺度:Computer Use 的时间尺度是亚秒到秒——屏幕在两帧之间持续变化,因此"动作后重新确认现实"不是可选项而是循环的必要组成部分。这与语音(10ms–1s,可被打断)和机器人(毫秒级,动作分块可抢占)是不同的时机问题。
  • 结构化索引不省 token 但省错误:把所有可交互元素及其属性发给模型成本高,但换来定位准确稳定,且免去分割模型的漏检误检——这是值得的交换。
  • browser-use 式四步流程:CDP 取 DOM 与无障碍信息 → 检测可交互元素 → 标注唯一 ID 并在截图绘边界框 → 同步生成"ID → 元素描述"文本列表;模型只输出 ID,系统用中心坐标执行。

实践模式

  1. 搭循环:Harness 负责截图、把动作约束转换成目标模型支持的消息与结构化输出、执行结果回传。同一套循环可换驱动模型(Claude、开放权重 VLM、自托管 vLLM/SGLang 端点),并保留实际端点与模型 ID 以便区分实验组。
  2. 选 grounding 路线:先问"这个界面有没有结构化信息可得"——Web 走 DOM/a11y 索引(CDP 取 DOM → 检测可交互元素 → 标注唯一 ID 并在截图绘边界框 → 同步生成 ID 到元素的文本列表);原生桌面软件、Canvas/WebGL、游戏走视觉标注或坐标预测;模型做过 GUI 定位训练才优先坐标预测。
  3. 实现坐标缩放层:枚举目标模型支持的分辨率档位,按宽高比匹配;截图时等比缩放送入,动作坐标按比例反算回真实屏幕。
  4. 每步只做一个动作:保留每步截图与动作轨迹,便于回放和验收;页面加载用 wait,不要盲点。
  5. 安全边界:默认只读;不点击验证码、不登录、不提交、不购买、不改外部数据;不可逆操作先在隔离虚拟桌面预测是否出现确认框,必要时请求用户确认。凭证不落盘,最终截图要能佐证结论。
  6. 恢复策略要预置:遇到验证码、权限弹窗、页面 404 时按只读恢复指令改走可达路径(如改用公开 JSON 接口取数据),而不是反复重试或点击挑战。
  7. 增强观察接口:关键帧 + 音量门控 ASR + 文字描述三件套,让 Agent 对弹窗、视频、会议人声有感知,并让被清理出上下文的原图仍留下文字痕迹。
  8. 移动端适配:动作空间从"鼠标坐标 + 键盘"换成无障碍服务 API(如 Android AccessibilityService)读写元素、下发点击与输入;坐标语义变为手势类型(单击/长按/滑动起点)的边界。
  9. 验收要测量效率:准确率达到人类水平不等于实用——对照人类操作步数与等待时间,把"步骤数、总时长"纳入验收指标,并记录真实运行证据(截图哈希、动作轨迹)。

Read the full file on GitHub · 81 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 22d ago First seen · 81 lines · 139 tokens per session scan A aa65a04de8cb

Subscribe to this mod's changes

computer-use is a skill published in the GitHub repository bojieli/ai-agent-book (54,406 stars, last pushed 7d ago), licensed Apache-2.0. It adds 139 tokens to every session and 2,859 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-24.

Related

Other skills, from other repositories

06-test

Write and iterate developer-side tests until they pass, or validate a user journey end to end in the browser during implementation. Use when the user wants to add coverage, find what's untested, or walk a flow while building it. Do NOT use for independent acceptance QA or reviewer evidence, auditing test health, or…

ai-driven-dev/framework · 69 tokens

node-inspect-debugger

Debug Node.js via --inspect + Chrome DevTools Protocol.

HezaoHezao/poirot · 18 tokens

remem-mcp

Long-term memory for coding agents. Auto-applies at the start of any coding task — recall past context before answering, capture decisions/learnings/fixes after work, use CodeGraph instead of grep for symbol lookup. Invoke when you see [remem-mcp] in your context or when starting any non-trivial coding work.

tinhien11/remem-mcp · 71 tokens

tura

Work in the Tura agent-runtime repository. Use for Tura architecture, Rust backend, GUI/TUI, prompts, commands, providers, sessions, documentation, tests, packaging, and release work in this directory.

Tura-AI/tura · 46 tokens

e2e-setup

Set up Playwright e2e automation tailored to this team and app. Probes the running app (auth mechanism, API surface, spec availability), interviews with recommendations instead of open questions, scaffolds the playwright/ folder, and records every decision in playwright/AUTOMATION.md for the other e2e skills to read.…

TimothyHan/qa-buddy-skills · 152 tokens

verify-fix

Re-test a bug fix after a developer resolves it. Pulls the original bug from Jira, re-executes the repro steps in the browser, checks for regressions, and updates the bug status. The final step in the SDT workflow before a ticket moves to Done. Use when: "verify fix", "retest", "is this fixed?", "check BUG-123"…

TimothyHan/qa-buddy-skills · 116 tokens