About screenshot
Screenshot is a macOS screenshot Skill that captures the screen, a window, or a selected region through Bash and screencapture. It emphasizes resizing images before reading them to keep their context footprint manageable.
Key features
- 01Capture the full screen
- 02Select a window interactively
- 03Capture a specified region
- 04Resize images and adjust compression
- 05Read image dimensions
Use cases
- 01Capture the screen for visual inspection
- 02Take a screenshot of a window or UI region
- 03Resize an image before model review
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ ninehills/ skills --skill screenshotAfter installing, type/screenshotin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
LICENSE.txtagents/openai.yamlscripts/ensure_macos_permissions.shmacos_display_info.swiftmacos_permissions.swiftmacos_window_info.swifttake_screenshot.ps1take_screenshot.pyDetails
From the project READMEScreenshot Skill
Take screenshots using macOS screencapture command via Bash.
Important: Always Resize for Context
Full-resolution screenshots (especially on Retina/5K displays) produce huge base64 that will exceed the model's context length. Always resize before reading.
Take and View a Screenshot
# 1. Capture full screen
/usr/sbin/screencapture -x -t jpg /tmp/alma-screenshot.jpg
# 2. Resize to 1024px wide (critical for context size!)
/usr/bin/sips --resampleWidth 1024 --setProperty formatOptions 60 /tmp/alma-screenshot.jpg --out /tmp/alma-screenshot-thumb.jpg 2>/dev/null
# 3. Get dimensions
/usr/bin/sips -g pixelWidth -g pixelHeight /tmp/alma-screenshot.jpg 2>/dev/null
Then use the Read tool to read /tmp/alma-screenshot-thumb.jpg (the resized version, NOT the full-size one).
Capture Options
# Full screen (default)
/usr/sbin/screencapture -x -t jpg /tmp/alma-screenshot.jpg
# Interactive window selection
/usr/sbin/screencapture -x -w -t jpg /tmp/alma-screenshot.jpg
# Specific region (x,y,w,h)
/usr/sbin/screencapture -x -R 0,0,800,600 -t jpg /tmp/alma-screenshot.jpg
# With 3-second delay
/usr/sbin/screencapture -x -T 3 -t jpg /tmp/alma-screenshot.jpg
Send Screenshot to User (Telegram)
If the user wants to see the screenshot directly, use the alma CLI or just describe what you see. The full-resolution file is at /tmp/alma-screenshot.jpg.
Tips
- Always resize before reading into context — use the thumb version
-xflag suppresses the capture sound-t jpgoutputs JPEG (smaller than PNG)- Use
sips --setProperty formatOptions 60for higher compression if needed