cc-haha/docs/desktop/computer-use.md
程序员阿江(Relakkes) c2cd615824 docs: rebuild the documentation site around two readers
The site had drifted from the product. Every screenshot predated the
v0.5.0 UI redesign, the reading experience shipped no search and no
syntax highlighting, and a third of the pages were internal process
artefacts — migration task lists addressed to agentic workers, a
release runbook, a proposal marked "historical".

Reorganise around the only two people who read this: someone getting
the desktop app running for the first time, and someone reading the
source. Five sections replace nine — start / desktop / im / cli /
internals — and the pages that served neither reader are gone.

Site rewrite:

- Palette lifted from the desktop app's 「纸·墨·印」 themes, so the
  site and the product read as one thing. Light mirrors 纯白, dark
  mirrors 墨夜, and dark mode exists at all now.
- Fonts are self-hosted. The old @import from Google Fonts is
  unreachable from mainland China, which left every heading in a
  fallback serif; it also only requested weight 600 while the CSS
  asked for 900, so Latin and CJK in the same heading disagreed.
- Docs were shipped as one 968KB manifest downloaded on every page
  view. Split into a 32KB index plus one lazily imported chunk per
  page; the entry bundle is now 101KB gzipped.
- Add search, syntax highlighting, per-route meta with canonical and
  hreflang, a sitemap, and an error boundary. Replace the 44vh
  mobile sidebar with a drawer.
- Image dimensions are read at build time and written into the tag,
  so lazy images reserve their space instead of collapsing.

Screenshots are recaptured from a real v0.5.0 build against a clean
demo project, with tokens, QR codes and paired accounts redacted.
The previous set is deleted rather than kept alongside.

Routes follow file paths, so the restructure would have broken every
inbound link; 37 old paths redirect, in both languages. The PR policy
gate and CODEOWNERS also hardcoded docs/guide/contributing.md.

Verified: check:docs 78 pages / 323 links / 0 problems, check:policy
127 pass. Walked every route at 1440 and 390 in both themes for
overflow, contrast, keyboard reachability and focus management.
2026-07-27 17:32:41 +08:00

4.7 KiB
Raw Blame History

title nav_title description order
Computer Use Computer Use 让 Claude 读屏幕、点鼠标、敲键盘,替你操作别的应用。 7

Computer Use

开了 Computer UseClaude 就能截屏看你的屏幕、移动鼠标、点击、输入文字,去操作那些没有 API 的应用——系统设置、原生笔记、Finder、第三方桌面软件都行。

它直接作用于你这台电脑,所以开之前请先看清楚要授权什么。

支持 macOS 和 Windows。Linux 暂无执行器。

准备环境

设置 → Computer Use:环境检测、macOS 两项授权、已授权应用

打开 设置 → Computer Use页面顶部是一排环境检查

  1. Python 3 — 需要本机装了 Python 3。没检测到时点「下载 Python 3」去装。装在 conda、pyenv 或其他自定义环境里的话在「Python 解释器路径」里手动选可执行文件,之后会优先用它。
  2. 虚拟环境依赖包 — 点「安装环境」,应用会自己建一个隔离的 venv 并装好平台依赖,不污染你的全局 Python。
  3. 全绿以后页面会显示「所有检查通过Computer Use 已就绪」。

装完可以随时点「重新检测」核对状态。

macOS 的两项系统授权

macOS 上还需要两个系统权限,缺一个都用不了:

权限 用来干什么
辅助功能 移动鼠标、点击、输入文字
屏幕录制 截屏,也就是「让它看见」

页面上有「打开辅助功能设置」和「打开屏幕录制设置」两个按钮,直接跳到系统设置对应位置。

:::warning 授权之后必须完全退出并重新打开应用才会生效。macOS 只在进程启动时读一次权限,不重启的话页面上会一直显示未授权。 :::

授权时注意勾的是真正启动 Claude Code Haha 的那个 App。屏幕录制的自动检测偶尔不稳定如果系统设置里明明已经勾上、页面却还显示未授权通常直接用就行。

预授权应用

默认情况下Claude 每次想控制一个新应用都会先弹一个「Computer Use 想控制这些应用」的确认框,写清它要控制哪些应用、为什么。你可以「本次会话允许」或者「拒绝」。

如果某几个应用你反复都会同意,可以在设置页的「已授权应用」里预先勾上。勾了以后 Claude 控制它们就不再弹窗。搜索框可以按名字过滤已安装的应用。

另外两个开关是单独的,不会因为授权了某个应用就自动获得:

  • 剪贴板访问 — 读写系统剪贴板。
  • 系统快捷键 — 发送系统级组合键。

:::danger 预授权等于永久放行。密码管理器、银行 App、企业 IM 这类应用不要放进列表——让它每次都问你一次。 :::

开始用

新建一条会话,用自然语言说清目标和允许操作的应用。从简单、可撤销的任务起步:

截取当前屏幕并告诉我你看到了什么。
打开「备忘录」,新建一条标题为「测试」的空白笔记。
帮我在系统设置里找到「显示器」那一页,但什么都不要改。

Claude 的工作方式是「截图 → 判断 → 操作 → 再截图」,所以它会比人慢,也会偶尔点错。给它明确的边界(「只在 X 应用里操作」「不要保存」)比给它一个笼统目标更靠谱。

同一时间只能有一条会话控制鼠标键盘。看到「正在被其他会话使用」时,先停掉或跑完那条会话。

已知边界

  • 没有全局中止热键。 想停下来就点会话里的停止按钮(⌘.)。
  • Windows 截图不过滤窗口。 macOS 的截图只保留已授权应用和桌面Windows 上所有可见窗口都会进画面。开始前请关掉或最小化含敏感信息的窗口。
  • 浏览器和终端里的操作受限。 浏览器只允许读(能看见但不能点),终端和 IDE 只允许点击(不能输入)。要操作网页请用浏览器扩展,要跑命令请让它用 Bash 工具。
  • UI 变了要重新截图。 页面变化之后不能沿用旧坐标。

排查

页面一直提示缺少权限 确认授权的是实际启动应用的那个 App完全退出后重开再点「重新检测」。

环境装不上 在「Python 解释器路径」里明确选一个 Python 3确认它支持 venv,重新点「安装环境」。还不行就去 设置 → 诊断 看安装日志。

能截图但点不动 确认目标应用在已授权列表里,并且它现在是前台窗口。浏览器和终端类应用受上面说的分级限制。

想了解权限分级、Python 桥接和执行器的实现,看Computer Use 架构