Browse and preview images pasted into Claude Code sessions — directly from your Mac.
Claude Code displays pasted images as [Image #N]
placeholders. cc-preview extracts those images and lets you browse, preview, and copy them with a keyboard-driven native UI powered by Hammerspoon.
brew install Watari995/tap/cc-preview
cc-preview install
Then press Cmd+Shift+R in Hammerspoon to reload, and open cc-preview with Cmd+Shift+I.
brew install Watari995/tap/cc-preview
Download the latest binary for your Mac from Releases, then place it in your PATH
:
curl -L https://github.com/Watari995/cc-preview/releases/latest/download/cc-preview_darwin_arm64.tar.gz | tar xz
sudo mv cc-preview /usr/local/bin/
curl -L https://github.com/Watari995/cc-preview/releases/latest/download/cc-preview_darwin_amd64.tar.gz | tar xz
sudo mv cc-preview /usr/local/bin/
go install github.com/Watari995/cc-preview@latest
After installing the binary, run the one-time installer:
cc-preview install
This automatically:
- Registers a
SessionStart
hook in~/.claude/settings.json
-
Deploys the Hammerspoon script to
~/.hammerspoon/ -
Updates
~/.hammerspoon/init.lua
Then reload Hammerspoon (Cmd+Shift+R).
- macOS Claude CodeHammerspoon
| Action | Shortcut |
|---|---|
| Open cc-preview | Cmd+Shift+I |
| Filter sessions / images | Type to search |
| Preview image | Enter or Space |
| Close preview | Esc or Space |
| Copy image to clipboard | ⌘C while previewing |
| Go back | Esc |
| Close everything | Click outside the window |
- A
SessionStart
hook records each Claude Code session to~/.claude-preview/sessions.json
cc-preview sessions
lists sessions that contain imagescc-preview images <session-id>
extracts base64-encoded images from the JSONL transcript and caches them under~/.claude-preview/image-cache/
- The Hammerspoon script calls these commands and renders a native macOS chooser UI
Edit the config
table at the top of ~/.hammerspoon/cc-preview.lua
:
local config = {
copyMods = {"cmd"}, -- modifiers for copy shortcut
copyKey = "c", -- key for copy shortcut
}
To change the global shortcut (default Cmd+Shift+I):
hs.hotkey.bind({"cmd", "shift"}, "I", showSessions)
MIT — see LICENSE