Screenshot → file → path on clipboard. Built for developers who work in the terminal.
When you take a screenshot with screenshotpath, it saves the file and copies the file path to your clipboard instead of the image. Paste it straight into Claude Code, a terminal command, or any text field.
Homebrew:
brew tap coreyepstein/tap
brew install screenshotpathcurl:
curl -fsSL https://raw.githubusercontent.com/coreyepstein/screenshotpath/main/install.sh | shManual:
git clone https://github.com/coreyepstein/screenshotpath.git
cp screenshotpath/bin/screenshotpath /usr/local/bin/
chmod +x /usr/local/bin/screenshotpathscreenshotpath is a CLI tool. Bind it to a hotkey so it works like the native screenshot shortcuts.
- Open Automator → File → New → Quick Action
- Set "Workflow receives" to no input in any application
- Add a Run Shell Script action
- Set Shell to
/bin/bashand paste:/usr/local/bin/screenshotpath - Save as "Screenshot Path"
- Open System Settings → Keyboard → Keyboard Shortcuts → Services
- Find Screenshot Path under General and assign a shortcut
Recommended shortcut: ⌘⇧4 — this replaces the built-in area screenshot. To free it up:
- Go to System Settings → Keyboard → Keyboard Shortcuts → Screenshots
- Uncheck "Save picture of selected area as a file"
- Now
⌘⇧4is available for your Quick Action
If you already use Hammerspoon, add to ~/.hammerspoon/init.lua:
hs.hotkey.bind({"cmd", "shift"}, "4", function()
hs.execute("/usr/local/bin/screenshotpath", true)
end)- Open Shortcuts app → New Shortcut
- Add Run Shell Script action
- Enter
/usr/local/bin/screenshotpath - Save, then assign a keyboard shortcut in System Settings → Keyboard → Keyboard Shortcuts → App Shortcuts
# Interactive area selection
screenshotpath
# Save to a custom directory
screenshotpath --dir ~/Desktop
# Skip the notification
screenshotpath --no-notifyDuring capture:
- Click and drag to select an area
- Press Space to switch to window selection mode
- Press Escape to cancel
Set in .zshrc or .bashrc:
| Variable | Default | Description |
|---|---|---|
SCREENSHOTPATH_DIR |
~/Screenshots |
Where screenshots are saved |
SCREENSHOTPATH_NOTIFY |
true |
Show macOS notification after capture |
export SCREENSHOTPATH_DIR="$HOME/Documents/screenshots"
export SCREENSHOTPATH_NOTIFY=falseThis is the workflow screenshotpath was built for:
- You're in a Claude Code session and need to share a screenshot
- Press your shortcut, select the area
- Paste into the prompt — you get the file path
- Claude reads the image directly from the path
A ~50-line bash script that calls three native macOS tools:
screencapture -i -x— interactive area selection, no shutter soundpbcopy— copies the file path to clipboardosascript— shows a notification (optional)
No dependencies. No frameworks. No daemons. No background processes.
"screenshotpath: command not found" — Ensure /usr/local/bin is in your PATH. If installed via Homebrew, use $(brew --prefix)/bin/screenshotpath in your Automator action.
Automator shortcut doesn't work — Go to System Settings → Privacy & Security → Accessibility and ensure Automator is listed and enabled.
No screenshot taken, no error — macOS may need screen recording permission. Go to System Settings → Privacy & Security → Screen & System Audio Recording and allow the relevant app (Terminal, Automator, or your Shortcuts app).
- macOS (any version with
screencapture)
MIT