Clipboard image paste fails for Chromium/Electron apps (Figma, Chrome) on macOS

Resolved 💬 3 comments Opened Mar 5, 2026 by elomid Closed Mar 5, 2026

Bug

Pasting images copied from Chromium-based apps (Figma, Chrome, etc.) into Claude Code via Ctrl+V fails with "No image found in clipboard", even though the image data is present on the clipboard and pasteable into other apps (Obsidian, Notion, etc.).

Root cause

Claude Code's macOS clipboard image check uses:

osascript -e 'the clipboard as «class PNGf»'

This checks for the legacy AppleScript pasteboard type com.apple.pboard.type.PNGf. However, Chromium-based apps place image data on the clipboard as public.png (the modern UTI type), not as the legacy PNGf class.

These are different pasteboard types despite both representing PNG data:

  • com.apple.pboard.type.PNGf — legacy AppleScript four-char-code type
  • public.png — modern UTI type (what Chromium uses)

Native macOS apps (Preview, Safari) tend to include both types, which is why pasting from those apps works.

Diagnostic evidence

After copying from Figma ("Copy as PNG"):

All types on clipboard (8 total):
  [477437 bytes] org.w3.web-custom-format.type-0
  [573675 bytes] public.png
  [573675 bytes] Apple PNG pasteboard type
  [47 bytes] org.w3.web-custom-format.map
  [24 bytes] org.chromium.internal.source-rfh-token
  [120 bytes] org.chromium.source-url
  [6598476 bytes] public.tiff
  [6598476 bytes] NeXT TIFF v4.0 pasteboard type

Image type presence check:
  ✅ public.png: 573675 bytes
  ✅ public.tiff: 6598476 bytes
  ❌ com.apple.pboard.type.PNGf (PNGf): not present

Claude Code compatibility check:
  ❌ 'the clipboard as «class PNGf»' FAILS (exit 1)

The PNG data is right there as public.png, but the AppleScript bridge can't access it via the «class PNGf» type.

Suggested fix

Instead of relying on AppleScript's «class PNGf», use NSPasteboard directly (e.g., via a small Swift helper or swift -e invocation) to check for and read image data. NSImage(pasteboard:) handles all image types including public.png.

Alternatively, add a fallback that checks public.png when «class PNGf» fails.

Workaround

Re-encode the clipboard to include the legacy type after copying from Figma:

// fix_clipboard.swift
import AppKit
let pb = NSPasteboard.general
guard let image = NSImage(pasteboard: pb),
      let tiffData = image.tiffRepresentation,
      let bitmapRep = NSBitmapImageRep(data: tiffData),
      let pngData = bitmapRep.representation(using: .png, properties: [:]) else { exit(1) }
pb.clearContents()
pb.setData(pngData, forType: NSPasteboard.PasteboardType("public.png"))
pb.setData(pngData, forType: NSPasteboard.PasteboardType("com.apple.pboard.type.PNGf"))
pb.setData(pngData, forType: .tiff)

Then swift fix_clipboard.swift before pasting into Claude Code.

Environment

  • macOS (Darwin 25.3.0, Apple Silicon)
  • Figma (Electron/Chromium-based)
  • Also affects: any Chromium-based app's "Copy image" feature

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗