paste-preview

Reviewed at commit d155009

See and mark up the images you paste into Claude Code: thumbnails above the prompt and in the transcript, and an editor that opens on paste

Made by
alan890104
What we checked

Shows thumbnails of images you paste above the prompt and in the transcript, and opens a drawing editor on every paste. An edited picture replaces the original in your message and Claude is told where to read it. It reads Claude Code's own copy of the paste (or the clipboard), keeps edits in a temp folder for a week, and sends nothing over the network.

Review details

Static review of the source at the pinned commit; not run. Hooks: session.start (polls the draft prompt every 500 ms), prompt.edit, prompt.submit (for edited pastes it adds a context line naming the edited file), session.append for the prompt door (removes the original image block of an edited paste from the message), and ui.render for AbovePrompt and UserMessage (thumbnails, an Edit button per image). Runtime calls: $.prompt.read, $.fs read, write, stat, list, exists, $.env.get for temp, locale and terminal variables, $.state atoms, $.ui.toast, $.process.run for sips, pngpaste, wl-paste, xclip, PowerShell clipboard, header and language lookups, mkdir, mv, id, uname, and find or PowerShell to delete its own edit folders older than a week (the bin folder excluded), and $.process.spawn for the editor. On macOS it compiles the bundled editor/panel.swift with xcrun swiftc on first use and keeps that panel running hidden for the session (it quits after 20 minutes unused or when its parent is gone); it is a WebKit window that loads only the bundled editor.html through a custom scheme and reads and writes only the picture and output paths given in request files in its own folder. Elsewhere (Linux, Windows, Mac without Swift) it runs editor/server.mjs under node, which serves editor.html on 127.0.0.1 behind a random token, opens it in a Chrome, Edge or Brave app window or the default browser, and accepts the edited PNG by POST; the page loads no external scripts and makes only same-origin requests, and the server exits after save, cancel or 30 minutes. Edits and thumbnails go to /private/tmp/paste-preview (macOS, not restricted to the user), /tmp/paste-preview-<uid> (0700) or %TEMP%\paste-preview, as the README says. The change since the previous review (255142d to d155009) only adds a byte budget for thumbnails drawn as inline image data, sending the rest by file name, so the band does not disappear past the engine's 2 MiB limit; it changes no data flow. Node, Swift, browsers and the clipboard tools were not reviewed. The editor files, which the bundle lists as referenced paths, were included and read; the unresolved ../types import is the type-only types/index.d.ts, also included.

What it uses
  • Reads your prompts: yes
  • Sees tool calls: no
  • Blocks or changes tool calls: no
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Made this mod? Add a badge to your README

modsforClaude badge for paste-preview

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/paste-preview.svg)](https://modsforclaude.com/mods/paste-preview/)

← All mods