Screencapture Mac logo

Screencapture Mac

Community
BretFisher
screencapture-mac

Captures the user's macOS screen, a window, or a region with the built-in `screencapture` CLI, then reads the image so the agent can see what the user sees. Use it when the user asks to check how a native macOS app looks (SwiftUI, AppKit, Electron, Qt, Tk, Java Swing), verify a window rendered correctly after a build or code change, diagnose a visual bug they describe in a desktop app, confirm a menu, dialog, or layout state, or asks "can you see this?" about anything outside a browser, even if they don't say "screenshot". Web pages and web apps belong to a browser automation tool.

Overview

PublisherBretFisher
Repositoryskills
Skill namescreencapture-mac
Stars
21
Forks
1
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by BretFisher on GitHub. Read the source before you install it.

Installation

Install the Screencapture Mac AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/BretFisher/skills/tree/main/plugins/utils/skills/screencapture-mac
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/BretFisher/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/utils/skills/screencapture-mac .claude/skills/screencapture-mac
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Screencapture Mac in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Screencapture Mac on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Screencapture Mac is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

screencapture-mac

macOS ships screencapture, a fast CLI for grabbing the screen. Use it to see what the user sees when working on native GUI software. Web apps belong in a browser-automation tool; this skill is for everything else (SwiftUI/AppKit, Electron, Java/Swing, Qt, Tk, games, system UI, Finder, Xcode, etc.).

Core workflow

  1. Capture to the scratch directory with a unique filename. Pick the directory in this order: the session scratch directory when the host names one in its instructions (Claude Code calls it the scratchpad directory), else $TMPDIR, else /tmp. A session directory is isolated from other sessions and from the user's project, so files there cannot collide or clutter shared space. Set OUT to that path and use it in every command below.
  2. Read the image with the Read tool — Agent is multimodal and will see the PNG inline.
  3. Delete the file immediately after reading. The user wants temp space kept clean; never leave screenshots lying around.

Filename convention: $OUT/screencap-$(date +%s).png. The timestamp prevents collisions if you capture multiple times in one task.

Picking the right mode

GoalCommand
Whole main display, no UI soundscreencapture -x -m $OUT/screencap-<ts>.png
All displaysscreencapture -x $OUT/screencap-<ts>.png (one file per screen — macOS appends suffixes)
User picks a window or region interactivelyscreencapture -x -i $OUT/screencap-<ts>.png
Specific rectangle (x,y,width,height in points, origin top-left)screencapture -x -R 100,100,800,600 $OUT/screencap-<ts>.png
Specific window by idscreencapture -x -l <windowid> $OUT/screencap-<ts>.png
Capture after delay (e.g. to let a menu open)screencapture -x -T 3 $OUT/screencap-<ts>.png

Always pass -x so the shutter sound doesn't startle the user.

-i is interactive: it blocks until the user clicks/drags. Only use it when you genuinely need the user to point at something — for autonomous "show me the app's main window" checks, prefer full-screen (-m) or a known rect (-R).

To find a window id for -l, you can run osascript -e 'tell app "System Events" to get id of windows of process "<AppName>"' or use CGWindowListCopyWindowInfo via a small helper; this is rarely worth it — full-screen capture is usually fine.

Full flag reference

text
usage: screencapture [-icMPmwsWxSCUtoa] [files]
  -c         force screen capture to go to the clipboard
  -b         capture Touch Bar — non-interactive modes only
  -C         capture the cursor as well as the screen. only in non-interactive modes
  -d         display errors to the user graphically
  -i         capture screen interactively, by selection or window
               control key — causes screenshot to go to clipboard
               space key   — toggle between mouse selection and window selection modes
               escape key  — cancels interactive screenshot
  -m         only capture the main monitor, undefined if -i is set
  -D<display> screen capture or record from the display specified. -D 1 is main display, -D 2 secondary, etc.
  -o         in window capture mode, do not capture the shadow of the window
  -p         screen capture will use the default settings for capture. The files argument will be ignored
  -M         screen capture output will go to a new Mail message
  -P         screen capture output will open in Preview or QuickTime Player if video
  -B<bundleid> screen capture output will open in app with bundleid
  -s         only allow mouse selection mode
  -S         in window capture mode, capture the screen not the window
  -J<style>  sets the starting of interactive capture
               selection       - captures screen in selection mode
               window          - captures screen in window mode
               video           - records screen in selection mode
  -t<format> image format to create, default is png (other options include pdf, jpg, tiff and other formats)
  -T<seconds> take the picture after a delay of <seconds>, default is 5
  -w         only allow window selection mode
  -W         start interaction in window selection mode
  -x         do not play sounds
  -a         do not include windows attached to selected windows
  -r         do not add dpi meta data to image
  -l<windowid> capture this windowsid
  -R<x,y,w,h> capture screen rect
  -v         capture video recording of the screen
  -V<seconds> limits video capture to specified seconds
  -g         captures audio during a video recording using default input.
  -G<id>     captures audio during a video recording using audio id specified.
  -k         show clicks in video recording mode
  -U         Show interactive toolbar in interactive mode
  -u         present UI after screencapture is complete. files passed to command line will be ignored
  -H         capture content in HDR
  files      where to save the screen capture, 1 file per screen

Cleanup is mandatory

The user keeps temp space tidy. After every Read of the screenshot, immediately rm it in the same logical step. Don't batch — capture, read, delete, one screenshot at a time. If you need a sequence of screenshots, still delete each one as soon as you've consumed it.

Example flow:

bash
OUT="${SCRATCH_DIR:-${TMPDIR:-/tmp}}"   # SCRATCH_DIR = the session scratch path from the host's instructions, if any
screencapture -x -m "$OUT/screencap-1715300000.png"
# → Read tool on $OUT/screencap-1715300000.png
rm "$OUT/screencap-1715300000.png"

If a capture fails (e.g. no Screen Recording TCC permission), screencapture writes a black or empty image rather than erroring loudly. If the Read shows a black/empty frame, tell the user to grant Screen Recording permission in System Settings → Privacy & Security → Screen Recording for the terminal app running Agent, then retry.

When NOT to use this skill

  • Web pages, web apps, anything in a browser → use the browser automation skill.
  • The user asks for a screen recording (video) → screencapture -v works but is rarely what's wanted; ask first.
  • You just want to know what app is focused → osascript -e 'tell app "System Events" to name of first process whose frontmost is true' is faster and doesn't need TCC.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Screencapture Mac AI skill do?

Captures the user's macOS screen, a window, or a region with the built-in `screencapture` CLI, then reads the image so the agent can see what the user sees. Use it when the user asks to check how a native macOS app looks (SwiftUI, AppKit, Electron, Qt, Tk, Java Swing), verify a window rendered correctly after a build or code change, diagnose a visual bug they describe in a desktop app, confirm a menu, dialog, or layout state, or asks "can you see this?" about anything outside a browser, even if they don't say "screenshot". Web pages and web apps belong to a browser automation tool.

Why use Screencapture Mac on TypingMind?

Because you install it once and use it with any model. Screencapture Mac is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Screencapture Mac in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/BretFisher/skills/tree/main/plugins/utils/skills/screencapture-mac. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Screencapture Mac?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Screencapture Mac?

As many as you like. As long as a model supports skills, you can use Screencapture Mac with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Screencapture Mac AI skill free?

Yes. It is published on GitHub by BretFisher under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇