I wrote a fish function that watches for new macOS screenshots and copies the file path to the clipboard. I use it all the time — take a screenshot, paste the path into Claude Code or Droid. No dragging, no Exposé, no waiting for the desktop to refresh.

I turned it into a CLI utility called shotpath.

What Changed

The fish function worked fine, but it had a couple of annoyances. It needed a terminal window running fish, and it depended on fswatch and terminal-notifier being installed. It was also hard to share with others — telling someone “paste this fish function and install these two dependencies” isn’t great.

shotpath is a single Swift binary. It uses FSEvents directly — no dependencies. Notifications use osascript, which is available on every Mac. And it can run as a background service via Homebrew.

Install

brew tap hboon/tap
brew install shotpath

Usage

Run it manually:

shotpath

Or start it at login so you never have to think about it:

brew services start hboon/tap/shotpath

That’s it. Take a screenshot with cmd+shift+4, and the path is in your clipboard ready to paste into your coding agent.

Why Not Just Copy to Clipboard?

macOS can be configured to copy screenshots to the clipboard instead of saving to a file — but not both. I want to keep all my screenshots. shotpath gives me both: the file is saved, and the path is in my clipboard.

How It Works

shotpath monitors ~/Desktop using FSEvents with file-level granularity. When a new file appears that matches the macOS screenshot naming pattern (Screenshot ... at ... .png), it copies the absolute path to the clipboard and shows a notification.

The whole thing is about 70 lines of Swift.