/appsnap:appsnapfrom appsnap
Captures a macOS app window as screenshot and extracts text via Accessibility APIs for agent context. Use when the user asks to snap, inspect, read, or summarize a visible Mac window.
Ships in appsnap. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Capture one selected macOS window and return the screenshot plus extracted text as context.
--fullpage / {"mode":"fullpage"} may be ACTIVE. Auto hover-picks a
window and scroll-stitches only when a bounded AX probe finds a scrollable area. --visible forces a
passive single visible screenshot.assemble.py returns read_image:true and you must read the screenshot for the visible content. Off-screen canvas text is not reachable by anyone unless the app exposes it through AX.Scripts need macOS PyObjC frameworks. Create a venv and install:
python3 -m venv <skill-dir>/.venv
<skill-dir>/.venv/bin/pip install -r <skill-dir>/requirements.txt
Run every script below with <skill-dir>/.venv/bin/python (not the system python3).
Check permissions:
python3 <skill-dir>/scripts/check_permissions.py
If it exits nonzero, stop and show its one-line stderr guidance.
Capture a window:
python3 <skill-dir>/scripts/capture.py
Stdin is optional. Default is {"mode":"auto"}. Use {"mode":"visible"} for hover-pick without scrolling,
{"mode":"fullpage"} to force active scroll-stitching, or {"mode":"frontmost"} only when the user
explicitly wants the frontmost window.
Extract AX text with the capture output:
python3 <skill-dir>/scripts/ax_extract.py
Pass {"pid":123,"windowid":456} from the capture JSON. If ax_extract.py is unavailable or returns ax_available:false, continue to OCR.
Assemble the final bundle (OCR stays off by default):
python3 <skill-dir>/scripts/assemble.py
Pass {"capture":{...},"ax":{...},"ocr":null}. To force local OCR for a
non-vision consumer, pass {"ocr_requested":true} or set APPSNAP_OCR=1.
Present the bundle to the current agent and ACT ON read_image:
image_path (the high-res screenshot) and text_markdown.
For full-page capture, surface every path in image_paths.read_image is true (AX was thin/absent — common for browsers and
canvas apps), read the screenshot yourself for the visible content;
text_markdown only covers what AX exposed.read_image is false, AX returned the full document; text_markdown
is the primary context and the image is confirmation.scripts/ocr_fallback.py exists for the opt-in / headless path: pass
{"image_path":"<abs png>"}; it recovers visible text only.
scripts/capture.pyInput:
{"mode":"auto"}
Output:
{"ok":true,"pid":123,"windowid":456,"app":"Safari","title":"...","bounds":{"x":0,"y":0,"w":1440,"h":900},"image_path":"/abs/window.png"}
For opt-in active full-page mode:
{"ok":true,"pid":123,"windowid":456,"app":"Safari","title":"...","bounds":{"x":0,"y":0,"w":1440,"h":900},"image_paths":["/abs/page-01.png"],"stitched":true,"frames":5,"stopped_by":"bottom"}
scripts/ax_extract.pyInput:
{"pid":123,"windowid":456}
Output:
{"ok":true,"source":"ax","text_markdown":"...","char_count":123,"element_count":45,"truncated":false,"ax_available":true,"note":""}
scripts/ocr_fallback.pyInput:
{"image_path":"/abs/window.png"}
Output:
{"ok":true,"source":"ocr","text_markdown":"...","char_count":123}
scripts/assemble.pyInput:
{"capture":{},"ax":{},"ocr":null}
Output:
{"image_path":"/abs/window.png","image_paths":["/abs/window.png"],"text_markdown":"...","text_source":"ax|ax+ocr|ocr|image-only","read_image":true,"primary_context":"image|text","app":"Safari","title":"...","truncated":false,"summary_line":"appsnap of Safari «title» — 123 chars via AX; read the screenshot for visible content"}
read_image:true ⇒ AX was thin/absent; the consuming agent must read the screenshot. text_source:"image-only" ⇒ no text from AX (and OCR not requested); the screenshot is the only context — this is a valid result, not an error.
Captures are saved to ~/Pictures/appsnap/ (override with APPSNAP_DIR). The one-shot appsnap.sh
prints an in-session reminder when screenshots older than APPSNAP_RETENTION_DAYS (default 7) exist, and
appsnap.sh --clean deletes them. When you see that reminder, surface it to the user and offer to run
--clean — never auto-delete.
LICENSE (opens in a new tab)README.md (opens in a new tab)appsnap.sh (opens in a new tab)requirements.txt (opens in a new tab)scripts/assemble.py (opens in a new tab)scripts/ax_extract.py (opens in a new tab)scripts/capture.py (opens in a new tab)scripts/capture_fullpage.py (opens in a new tab)scripts/check_permissions.py (opens in a new tab)scripts/ocr_fallback.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
macos, screenshot, accessibility, window-capture, screen-reading
npx claudepluginhub yrzhe/claude-skills --plugin appsnapOther plugins' skills for the same job