Agent skill

Capture Screen

by daymade in daymade/claude-code-skills

Programmatic screenshot capture on macOS. An agent skill from daymade/claude-code-skills.

MITAuto-check passedMobile

Install Capture Screen

skills CLI
$ npx skills add daymade/claude-code-skills --skill capture-screen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install daymade/claude-code-skills capture-screen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/daymade/claude-code-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/daymade-macos/capture-screen .claude/skills/capture-screen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
capture-screen
GitHub stars
1.4k
Token cost
~2.4k tokens
SKILL.md length
558 words
Files
3 (incl. scripts, references)
Skills in repo
103
Repo updated
First seen
Licence
MIT

At a glance

Programmatic screenshot capture on macOS. An agent skill from daymade/claude-code-skills.

  • Works in 3 steps: Get Window ID (Swift) → Control Window (AppleScript) → Capture (screencapture)
  • Automating screenshots
  • SKILL.md covers Quick Start, Overview, Step 1: Get Window ID (Swift) and Step 2: Control Window…, plus 5 more sections
  • Runs Swift scripts from its folder; calls osascript and swift

What it does

Capture Screen is an agent skill from daymade/claude-code-skills. Programmatic screenshot capture on macOS. Find window IDs with Swift CGWindowListCopyWindowInfo, control application windows via AppleScript (zoom, scroll, select), and capture with screencapture. Use when automating screenshots, capturing application windows for documentation, or building multi-shot visual workflows.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/permission-triage-template.md`).

It sits in Mobile, covering iOS development. It works with macOS and Microsoft Excel. The repository describes itself as: Professional Claude Code skills marketplace featuring production-ready skills for enhanced development workflows. The licence is MIT.

When your agent uses it

  • Automating screenshots
  • Capturing application windows for documentation
  • Building multi-shot visual workflows

Example prompts

  • “/capture-screen”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Get Window ID (Swift)
  2. Control Window (AppleScript)
  3. Capture (screencapture)

What it can do on your machine

Read from SKILL.md and the folder at commit 91bed2b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Swift), which the agent can run.

    Shell commands in SKILL.md call:

    • osascript
    • swift

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Capture Screen loads about 2.4k tokens when it runs, and up to ~3.1k if it reads all its reference files. Until then it costs about 84 tokens; SKILL.md has 558 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~84
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from daymade/claude-code-skills at commit 91bed2b, republished under its MIT licence (© daymade). 558 words, ~2,379 tokens.

Download SKILL.mdSave it as .claude/skills/capture-screen/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
capture-screen
description
Programmatic screenshot capture on macOS. Find window IDs with Swift CGWindowListCopyWindowInfo, control application windows via AppleScript (zoom, scroll, select), and capture with screencapture. Use when automating screenshots, capturing application windows for documentation, or building multi-shot visual workflows.

Capture Screen

Programmatic screenshot capture on macOS: find windows, control views, capture images.

Quick Start

bash
# Find Excel window ID
swift scripts/get_window_id.swift Excel

# Capture that window (replace 12345 with actual WID)
screencapture -x -l 12345 output.png

Overview

Three-step workflow:

1. Find Window  →  Swift CGWindowListCopyWindowInfo  →  get numeric Window ID
2. Control View  →  AppleScript (osascript)           →  zoom, scroll, select
3. Capture       →  screencapture -l <WID>            →  PNG/JPEG output

Step 1: Get Window ID (Swift)

Use Swift with CoreGraphics to enumerate windows. This is the only reliable method on macOS.

Quick inline execution
bash
swift -e '
import CoreGraphics
let keyword = "Excel"
let list = CGWindowListCopyWindowInfo(.optionOnScreenOnly, kCGNullWindowID) as? [[String: Any]] ?? []
for w in list {
    let owner = w[kCGWindowOwnerName as String] as? String ?? ""
    let name = w[kCGWindowName as String] as? String ?? ""
    let wid = w[kCGWindowNumber as String] as? Int ?? 0
    if owner.localizedCaseInsensitiveContains(keyword) || name.localizedCaseInsensitiveContains(keyword) {
        print("WID=\(wid) | App=\(owner) | Title=\(name)")
    }
}
'
Using the bundled script
bash
swift scripts/get_window_id.swift Excel
swift scripts/get_window_id.swift Chrome
swift scripts/get_window_id.swift          # List all windows

Output format: WID=12345 | App=Microsoft Excel | Title=workbook.xlsx

Parse the WID number for use with screencapture -l.

Step 2: Control Window (AppleScript)

Verified commands for controlling application windows before capture.

Microsoft Excel (full AppleScript support)
bash
# Activate (bring to front)
osascript -e 'tell application "Microsoft Excel" to activate'

# Set zoom level (percentage)
osascript -e 'tell application "Microsoft Excel"
    set zoom of active window to 120
end tell'

# Scroll to specific row
osascript -e 'tell application "Microsoft Excel"
    set scroll row of active window to 45
end tell'

# Scroll to specific column
osascript -e 'tell application "Microsoft Excel"
    set scroll column of active window to 3
end tell'

# Select a cell range
osascript -e 'tell application "Microsoft Excel"
    select range "A1" of active sheet
end tell'

# Select a specific sheet
osascript -e 'tell application "Microsoft Excel"
    activate object sheet "DCF" of active workbook
end tell'

# Open a file
osascript -e 'tell application "Microsoft Excel"
    open POSIX file "/path/to/file.xlsx"
end tell'
Any application (basic control)
bash
# Activate any app
osascript -e 'tell application "Google Chrome" to activate'

# Bring specific window to front (by index)
osascript -e 'tell application "System Events"
    tell process "Google Chrome"
        perform action "AXRaise" of window 1
    end tell
end tell'
Timing and Timeout

Always add sleep 1 after AppleScript commands before capturing, to allow UI rendering to complete.

IMPORTANT: osascript hangs indefinitely if the target application is not running or not responding. Always wrap with timeout:

bash
timeout 5 osascript -e 'tell application "Microsoft Excel" to activate'

Step 3: Capture (screencapture)

bash
# Capture specific window by ID
screencapture -l <WID> output.png

# Silent capture (no camera shutter sound)
screencapture -x -l <WID> output.png

# Capture as JPEG
screencapture -l <WID> -t jpg output.jpg

# Capture with delay (seconds)
screencapture -l <WID> -T 2 output.png

# Capture a screen region (interactive)
screencapture -R x,y,width,height output.png
Retina displays

On Retina Macs, screencapture outputs 2x resolution by default (e.g., a 2032x1238 window produces a 4064x2476 PNG). This is normal. To get 1x resolution, resize after capture:

bash
sips --resampleWidth 2032 output.png --out output_1x.png
Verify capture
bash
# Check file was created and has content
ls -la output.png
file output.png    # Should show "PNG image data, ..."

Multi-Shot Workflow

Complete example: capture multiple sections of an Excel workbook.

bash
# 1. Open file and activate Excel
osascript -e 'tell application "Microsoft Excel"
    open POSIX file "/path/to/model.xlsx"
    activate
end tell'
sleep 2

# 2. Set up view
osascript -e 'tell application "Microsoft Excel"
    set zoom of active window to 130
    activate object sheet "Summary" of active workbook
end tell'
sleep 1

# 3. Get window ID
#    IMPORTANT: Always re-fetch before capturing. CGWindowID is invalidated
#    when an app restarts or a window is closed and reopened.
WID=$(swift -e '
import CoreGraphics
let list = CGWindowListCopyWindowInfo(.optionOnScreenOnly, kCGNullWindowID) as? [[String: Any]] ?? []
for w in list {
    let owner = w[kCGWindowOwnerName as String] as? String ?? ""
    let wid = w[kCGWindowNumber as String] as? Int ?? 0
    if owner == "Microsoft Excel" { print(wid); break }
}
')
echo "Window ID: $WID"

# 4. Capture Section A (top of sheet)
osascript -e 'tell application "Microsoft Excel"
    set scroll row of active window to 1
end tell'
sleep 1
screencapture -x -l $WID section_a.png

# 5. Capture Section B (further down)
osascript -e 'tell application "Microsoft Excel"
    set scroll row of active window to 45
end tell'
sleep 1
screencapture -x -l $WID section_b.png

# 6. Switch sheet and capture
osascript -e 'tell application "Microsoft Excel"
    activate object sheet "DCF" of active workbook
    set scroll row of active window to 1
end tell'
sleep 1
screencapture -x -l $WID dcf_overview.png

Failed Approaches (DO NOT USE)

These methods were tested and confirmed to fail on macOS:

MethodErrorWhy It Fails
System Events → id of windowError -1728System Events cannot access window IDs in the format screencapture needs
Python import Quartz (PyObjC)ModuleNotFoundErrorPyObjC not installed in system Python; don't attempt to install it — use Swift instead
osascript window idWrong formatReturns AppleScript window index, not CGWindowID needed by screencapture -l

Permission Troubleshooting

swift scripts/get_window_id.swift reads on-screen windows via CoreGraphics, so it needs Screen Recording permission on macOS.

Use this order:

  1. Confirm trigger
  2. Confirm target identity
  3. Add/enable exact app in Settings

If the command fails with ERROR: Failed to enumerate windows, do this:

bash
open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"

Or print the same checklist directly from the script:

bash
swift scripts/get_window_id.swift --permission-hint screen
swift scripts/get_window_id.swift --permission-hint microphone

Then:

  1. In Privacy & Security → Screen Recording, enable the target app.
  2. If your app is missing from the list:
    • Ensure you granted permission to the real app bundle (not swift / terminal helpers).
    • For CLI tools, build/run as a packaged .app during permission verification.
    • Click + and add the .app manually from /Applications.
  3. Re-run the command after restarting the app.
  4. If this is a CLI workflow, also check whether the launcher is a helper binary:
    • In most cases the entry shown in TCC is the helper process (swift, Terminal, iTerm, etc.), not the business app.
    • Permission still works after helper-level grant, but it is not ideal for final UX.
Show full SKILL.md (157 more words)Show less

For mic-access-related prompts, use the same pattern with the microphone pane:

bash
open "x-apple.systempreferences:com.apple.preference.security?Privacy_Microphone"

The same rule still applies: the system can only show permissions for a concrete .app bundle. If the request is made by a helper binary, the settings list can be misleading or empty for your product app.

Quick Check Template
text
1) Error: permission denied
2) Open target pane
3) Verify identity shown by OS = identity you granted
4) If not matched, use the script-reported candidate identities and grant the launcher process
5) Reopen/restart and verify

For production apps, avoid requesting permissions via swift/python entry points; always route permission checks in the packaged app process so users only see one target.

If you maintain another macOS permission-related flow, reuse this standardized triage template:

Supported Applications

ApplicationWindow IDAppleScript ControlNotes
Microsoft ExcelSwiftFull (zoom, scroll, select, activate sheet)Best supported
Google ChromeSwiftBasic (activate, window management)No scroll/zoom via AppleScript
Any macOS appSwiftBasic (activate via tell application)screencapture works universally

AppleScript control depth varies by application. Excel has the richest AppleScript dictionary. For apps with limited AppleScript, use keyboard simulation via System Events as a fallback.

© daymade, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in daymade-macos/capture-screen of daymade/claude-code-skills.

  • SKILL.md
  • references/permission-triage-template.md
  • scripts/get_window_id.swift

Open the folder on GitHubat commit 91bed2b

Compare with similar skills

Capture Screen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Capture Screen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Capture Screen this skilldaymade/claude-code-skills1.4k—~2.4kAutomated safety check: PassMIT
Hig Project Contextraintree-technology/hig-doctor1435 repos~1.2kAutomated safety check: PassMIT
Hig Components Contentraintree-technology/hig-doctor1435 repos~1.3kAutomated safety check: PassMIT
macOS Auto Updatefayazara/macos-app-skills675—~1.8kAutomated safety check: PassNone
API Explorationsozercan/kaset2.4k—~454Automated safety check: PassMIT
Dev Loop Packagingsozercan/kaset2.4k—~388Automated safety check: PassMIT

Similar skills

  • Hig Project Context

    raintree-technology/hig-doctor

    Create or update a shared Apple design context document that other HIG skills use to tailor guidance.

    143 GitHub starsUsed in 5 repos~1.2k tokens
    MobileAuto-check passed
  • Hig Components Content

    raintree-technology/hig-doctor

    Apple Human Interface Guidelines for content display components.

    143 GitHub starsUsed in 5 repos~1.3k tokens
    MobileAuto-check passed
  • macOS Auto Update

    fayazara/macos-app-skills

    Add Sparkle auto-update support to a native macOS app. An agent skill from fayazara/macos-app-skills.

    675 GitHub stars~1.8k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • API Exploration

    sozercan/kaset

    A skill your agent uses when a task needs a new or modified YouTube Music API call, response parser validation, authenticated endpoint investigation, or fixture capture; explore endpoints with swift…

    2.4k GitHub stars~454 tokensUpdated 4 days ago
    MobileAuto-check passed
  • Dev Loop Packaging

    sozercan/kaset

    A skill your agent uses when you need a fresh packaged .app bundle, a fast build-package-relaunch loop, or a packaged runtime repro for Kaset instead of a compile-only verification.

    2.4k GitHub stars~388 tokensUpdated 4 days ago
    MobileAuto-check passed
  • App It

    Christian-Katzmann/app-it

    Turn a local project or a hosted web app (including a published Claude Artifact URL) into a macOS Dock-launchable .app.

    216 GitHub stars~2.4k tokensUpdated 7 days ago
    MobileAuto-check passed

More from daymade/claude-code-skills

All 103 skills in this repo
  • Video Comparer

    daymade/claude-code-skills

    This skill should be used when comparing two videos to analyze compression results or quality differences.

    1.4k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check: notes
  • CLI Demo Generator

    daymade/claude-code-skills

    Generates professional animated CLI demos as GIFs using VHS terminal recordings.

    1.4k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Doc To Markdown

    daymade/claude-code-skills

    Converts DOCX/PDF/PPTX and saved HTML/HTM to high-quality Markdown with automatic post-processing.

    1.4k GitHub stars~2.5k tokensUpdated today
    Auto-check passed
  • Interaction Design Board

    daymade/claude-code-skills

    Generates several distinct, clickable HTML interaction prototypes for one product surface into a Design Board and collects selection/remix feedback before implementation.

    1.4k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Auto Repo Setup

    daymade/claude-code-skills

    Diagnoses and repairs repository setup and guarded Git workflows for Claude Code or Codex — environment repair, startup sync, hook auditing, collaborator handoff.

    1.4k GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Bigdata Skill

    daymade/claude-code-skills

    Pulls Bigdata.com (RavenPack) financial and news data via the official bigdata-client SDK and /v1/ REST endpoints — structured financials, prices, analyst estimates, entity-sentiment series…

    1.4k GitHub stars~3.7k tokensUpdated today
    Auto-check passed

Categories

Questions about Capture Screen

What does Capture Screen do?

Programmatic screenshot capture on macOS. An agent skill from daymade/claude-code-skills. Capture Screen is an agent skill from daymade/claude-code-skills. Programmatic screenshot capture on macOS.

When should I use Capture Screen?

Capture Screen fits situations like: automating screenshots; capturing application windows for documentation; building multi-shot visual workflows.

How do I install Capture Screen in Claude Code?

Run `npx skills add daymade/claude-code-skills --skill capture-screen -a claude-code`. Or copy the skill folder (daymade-macos/capture-screen in daymade/claude-code-skills) into .claude/skills/capture-screen in your project. Claude Code loads it when a task matches its description.

How do I install Capture Screen in Codex?

Run `npx skills add daymade/claude-code-skills --skill capture-screen -a codex`. Or copy the skill folder (daymade-macos/capture-screen in daymade/claude-code-skills) into .agents/skills/capture-screen in your project. Codex loads it when a task matches its description.

Can I use Capture Screen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add daymade/claude-code-skills --skill capture-screen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/capture-screen, .gemini/skills/capture-screen, .github/skills/capture-screen and .opencode/skills/capture-screen in your project.

What does Capture Screen need to run?

Going by SKILL.md and its folder, Capture Screen needs Swift for the scripts in its folder and the command-line tools its instructions call (osascript and swift). Our summary lists: Python 3.

Does Capture Screen access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Capture Screen safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Capture Screen use?

Capture Screen is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Capture Screen use?

About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 677 tokens, read only when the agent opens those files.

What are the alternatives to Capture Screen?

Skills that share tags, products or a category with Capture Screen: Hig Project Context (raintree-technology/hig-doctor, 143 stars), Hig Components Content (raintree-technology/hig-doctor, 143 stars), macOS Auto Update (fayazara/macos-app-skills, 675 stars) and API Exploration (sozercan/kaset, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Capture Screen?

daymade (a GitHub user) maintains it in daymade/claude-code-skills, which has 1,444 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 8, 2026.

Source: daymade/claude-code-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.