macos-control

macos-control is a skill for Claude Code from NakaokaRei/SwiftAutoGUI. It costs 58 tokens per session (2,400 once invoked), scanned B, original, MIT.

A guide for controlling native macOS application interfaces with the sagui command-line tool. It covers mouse and keyboard input, screenshots, image recognition, screen queries, and AppleScript.

In plain words
What is it for?
Use it to click, type, scroll, drag, inspect screens, find images, take screenshots, and run AppleScript in macOS applications. It also explains installation options when sagui is missing.
Why use it?
It gives developers a checklist for confirming sagui is installed and handling the macOS permissions needed for desktop interaction. This reduces setup errors before automation begins.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the swift-auto-gui plugin — 2 skills shipped together

Good fit Use it to click, type, scroll, drag, inspect screens, find images, take screenshots, and run AppleScript in macOS applications. It also explains installation options when sagui is missing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nakaokarei/swiftautogui/macos-control
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 NakaokaRei/SwiftAutoGUI --skill macos-control
Clone the repo
git clone --depth 1 https://github.com/NakaokaRei/SwiftAutoGUI

Made for: Claude Code.

Or install swift-auto-gui, the plugin that ships this one along with the rest of its 2 skills.

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 macos-control

README.md
[![agentmods](https://agentmods.dev/badge/skills/nakaokarei/swiftautogui/macos-control/github.svg)](https://agentmods.dev/skills/nakaokarei/swiftautogui/macos-control)
Your own site
<a href="https://agentmods.dev/skills/nakaokarei/swiftautogui/macos-control"><img src="https://agentmods.dev/badge/skills/nakaokarei/swiftautogui/macos-control/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 macos-control

Your own site · 80×15
<a href="https://agentmods.dev/skills/nakaokarei/swiftautogui/macos-control"><img src="https://agentmods.dev/badge/skills/nakaokarei/swiftautogui/macos-control.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,400 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Excessive Agency · line 170
    Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.
    Fix: Remove the model/provider override or disclose it prominently and require explicit operator approval before invoking an external coding CLI or billed model.
  • medium Privilege Escalation · line 39
    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
    Fix: Avoid sudo/root unless strictly required. Prefer least-privilege patterns. If elevation is needed, document the justification and scope.
How audits are shown
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.00058 $0.02400
Opus 5 $0.00029 $0.01200
Sonnet 5 $0.00012 $0.00480
Haiku 4.5 $0.00006 $0.00240

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

Security

Grade B, and why

macos-control scanned grade B with 1 finding 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 10d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo cp .build/release/sagui /usr/local/bin/sagui
plugins/swift-auto-gui/skills/macos-control/SKILL.md · 207 lines

How it starts

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

macos-control

The sagui CLI provides mouse control, keyboard input, screenshot capture, image recognition, and screen queries for macOS automation.

Preflight: ensure sagui is installed

Before issuing any sagui command, run:

command -v sagui

If the command prints a path, you're ready — continue to the sections below.

If it prints nothing (exit code 1), sagui is not installed. Stop and ask the user for permission to install it before doing anything else. Show them these options and wait for confirmation:

Recommended — Homebrew:

brew install NakaokaRei/tap/sagui

Fallback — build from source (requires Xcode / Swift 6.2+ toolchain; verify with swift --version):

git clone https://github.com/NakaokaRei/SwiftAutoGUI.git /tmp/SwiftAutoGUI
cd /tmp/SwiftAutoGUI
swift build -c release
# Copy the binary somewhere on $PATH. /usr/local/bin requires sudo:
sudo cp .build/release/sagui /usr/local/bin/sagui
# Or, no sudo, into a user dir already on PATH:
# cp .build/release/sagui ~/.local/bin/sagui

After install, re-run command -v sagui to confirm the binary is reachable, then continue.

Permissions

The first time sagui issues an event or screenshot, macOS will prompt for these permissions. Without them, commands silently fail or return blank screenshots.

  • Accessibility — required for sagui key and sagui mouse. Enable in System Settings → Privacy & Security → Accessibility for the app running Claude Code (Terminal.app, iTerm, etc.).
  • Screen Recording — required for sagui screen screenshot, sagui screen pixel, and sagui screen locate*. Enable in System Settings → Privacy & Security → Screen Recording for the same app.

If a command unexpectedly fails or returns empty output, ask the user to verify both permissions are granted to their terminal app.

This skill is macOS-onlysagui builds on CoreGraphics. On other platforms, tell the user the skill cannot run and stop.

Coordinates

Read the full file on GitHub · 207 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. 10d ago First seen · 207 lines · 58 tokens per session scan B 1811b320e7dd

Subscribe to this mod's changes

macos-control is a skill published in the GitHub repository NakaokaRei/SwiftAutoGUI (92 stars, last pushed 18d ago), licensed MIT. It adds 58 tokens to every session and 2,400 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

computer-use-macos

Top-level macOS computer-use skill with a bundled standalone runtime that bootstraps itself without any local Claude installation, private native modules, or extracted app assets.

wimi321/macos-computer-use-skill · 37 tokens

peekaboo

Use Peekaboo for macOS desktop automation, screenshots, visual UI maps, native accessibility inspection, app/window/menu/dialog control, native app and browser chrome control, browser-page MCP tooling, MCP diagnostics, and Peekaboo repo validation. Use when Codex needs current macOS UI state, direct desktop control…

openclaw/Peekaboo · 82 tokens

macos-harness

Control a whole Mac from one persistent Python session with screenshots, PID-targeted input, an animated virtual pointer, targeted Apple Accessibility, Apple Events, Browser Harness CDP, and filesystem access. Use for native, Electron, browser, dialog, file, or cross-app tasks without moving the physical cursor or…

browser-use/macos-harness · 71 tokens

use-peek

Use the peek CLI to inspect, debug, and interact with native macOS app windows. Use when the user asks to debug a macOS app, inspect UI elements, take screenshots, click buttons, or automate interactions with native apps.

alexmx/peek · 51 tokens

computer-use

A set of rules for controlling Windows desktop applications through screen observation and simulated mouse and keyboard actions. It also describes how to find and launch installed applications and verify the results.

Plocr/Reasonix-computer-use · 23 tokens

web-navigator

A browser-automation routing guide for web tasks. It directs navigation, page inspection, and actions such as clicking or filling forms to the appropriate browser tool.

Plocr/Reasonix-computer-use · 30 tokens