Stop Fighting Screenshots Fastest Way To Get

If you work primarily in the terminal, the standard screenshot workflow on macOS is a constant interruption. You take a screenshot, it lands on your Desktop, you open Finder, find the file, drag it into your Claude Code prompt — and you’ve just broken your flow for 30 seconds. Multiply that by every debugging session and it adds up fast.

The faster path is skipping the image entirely and passing the file path directly into your Claude Code prompt. Claude Code reads the file from disk — no clipboard image, no drag-and-drop, no Finder. This post covers exactly how to do that from the CLI, with and without SnapCode.

Why File Paths Beat Clipboard Images in Claude Code CLI

When you paste a clipboard image into Claude Code, you’re relying on the terminal to handle binary image data. This works intermittently — and fails silently the rest of the time. You get no error, Claude Code just ignores the image, and you wonder why your prompt produced generic output.

File paths are different. Claude Code reads image files from disk reliably every time. The syntax is unambiguous:

claude "What is wrong with this UI? [/Users/you/Desktop/screenshot-2026-04-27.png]"

No clipboard involved. No drag-and-drop. Just a path. The entire problem is reduced to one question: how do you get that path into your clipboard without leaving the terminal?

The Manual Way: screencapture + pbcopy

macOS ships with a screencapture CLI tool. You can trigger a screenshot, save it to a known path, and copy that path to your clipboard in a single pipeline:

FILE=~/Desktop/snap-$(date +%s).png && screencapture -i "$FILE" && echo -n "$FILE" | pbcopy

Breaking this down:

  • screencapture -i activates the interactive crosshair selector — you draw the region to capture
  • The file saves to ~/Desktop with a timestamp
  • echo -n "$FILE" | pbcopy copies the path (no trailing newline) directly to your clipboard

After running this, your clipboard contains the file path. Paste it directly into your Claude Code prompt with Ctrl+V.

The downside: you have to run this command every time. You are also switching from your Claude Code session to a second terminal pane, which still interrupts flow.

The Hammerspoon Way: Global Hotkey That Copies the Path

If you already use Hammerspoon for macOS automation, you can bind a hotkey that captures a screenshot region and copies the path to your clipboard system-wide — including while Claude Code has focus in your terminal.

Add this to your ~/.hammerspoon/init.lua:

hs.hotkey.bind({"cmd", "shift"}, "6", function()
  local path = os.getenv("HOME") .. "/Desktop/snap-" .. os.time() .. ".png"
  hs.task.new("/usr/sbin/screencapture", function()
    hs.pasteboard.setContents(path)
    hs.alert.show("Path copied: " .. path)
  end, {"-i", path}):start()
end)

After reloading your Hammerspoon config, pressing Cmd+Shift+6 activates the screenshot selector. The moment you finish selecting, the file path is in your clipboard. Your terminal is still focused. You paste immediately.

This works well, but requires Hammerspoon to be installed and configured. For developers who want this working without any Lua scripting, there is a faster option.

The SnapCode Way: One Keystroke, Path in Clipboard

SnapCode automates exactly this workflow as a standalone macOS app — no scripting required. Press the configured hotkey, draw a region, and the screenshot file path is already in your clipboard by the time you release the mouse.

For CLI-first developers, the key advantage is that SnapCode works at the OS level. It does not require the terminal to have focus, it does not require Hammerspoon, and it saves to a configurable folder so your screenshot paths are predictable and consistent across sessions.

The workflow with SnapCode in a Claude Code session looks like this:

  1. You hit a bug or want to show Claude Code something visual
  2. Press SnapCode’s hotkey — crosshair appears
  3. Select the region
  4. Path is in clipboard — terminal still has focus
  5. Paste into Claude Code prompt with Ctrl+V
  6. Total time: under 5 seconds

No Finder. No Hammerspoon config. No second terminal pane. See the terminal users page for setup instructions specific to CLI workflows.

Building a Bash Function for Repeated Use

If you prefer to stay fully in the terminal without any additional app, wrap the screencapture approach in a shell function. Add this to your ~/.zshrc or ~/.bashrc:

snap() {
  local dir="${SNAP_DIR:-$HOME/Desktop}"
  local file="$dir/snap-$(date +%Y%m%d-%H%M%S).png"
  screencapture -i "$file" 2>/dev/null
  if [[ -f "$file" ]]; then
    echo -n "$file" | pbcopy
    echo "Copied: $file"
  else
    echo "Cancelled."
  fi
}

After sourcing your shell config (source ~/.zshrc), type snap in any terminal to capture a region and copy the path. Set SNAP_DIR in your environment to save screenshots to a custom folder instead of the Desktop.

Usage in a Claude Code session:

# In one terminal pane
snap
# Select region, path is now in clipboard

# Back in Claude Code pane
claude "Fix the layout issue shown here: [Ctrl+V pastes the path]"

Saving Screenshots to a Fixed Folder for Predictable Paths

One underrated improvement: stop saving screenshots to the Desktop. Use a dedicated folder like ~/screenshots and configure both macOS and your tools to save there. This means your screenshot paths follow a consistent pattern you can tab-complete or script against.

To redirect macOS default screenshots (Cmd+Shift+3/4) to a custom folder:

mkdir -p ~/screenshots
defaults write com.apple.screencapture location ~/screenshots
killall SystemUIServer

SnapCode also supports a configurable save folder — set it once and every screenshot lands in the same directory with a clean timestamped filename.

Putting It Into a Real Claude Code Prompt

Once the path is in your clipboard, the prompt is straightforward. Claude Code accepts image paths inside square brackets inline with text:

claude "The button alignment is broken on mobile. Screenshot: [/Users/you/screenshots/snap-20260427-143201.png] — fix the CSS."

You can also pass multiple screenshots to a single prompt:

claude "Compare these two states: [/path/to/before.png] and [/path/to/after.png]. What changed in the layout?"

The file path approach scales naturally — you can reference screenshots taken minutes or hours ago without them cycling out of your clipboard history.

Which Approach Is Right for You

  • One-off, no setup: Use the screencapture + pbcopy one-liner
  • Already using Hammerspoon: Add the Lua hotkey binding above
  • Want it done in 2 minutes with no scripting: SnapCode handles capture, save, and path copy in one hotkey
  • Heavy terminal user who scripts everything: Use the snap() bash function with a custom SNAP_DIR

All four approaches end at the same place: a file path in your clipboard, ready to paste into the next Claude Code prompt. The difference is how much context-switching they require to get there.

If you spend a significant amount of your day in terminal sessions with Claude Code, the 30-second Finder detour adds up to real time lost. Any of these approaches eliminates it. SnapCode eliminates it with the least setup.

Scroll to Top