assistant-skills/clipboard-history/SKILL.md

2.4 KiB

name description
clipboard-history Retrieve items from clipboard history using Maccy on macOS. Triggers when user mentions: - "clipboard history" - "from maccy" - "what was on my clipboard" - "get the last link I copied"

Quick Usage (Already Configured)

Query clipboard history

Maccy stores history in a Core Data SQLite database inside its app sandbox. Query it directly:

# All recent clipboard items containing a URL
sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \
  "SELECT h.ZTITLE, c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime') FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' AND c.ZVALUE LIKE '%http%' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT 10;"
# Last N clipboard items (any content type)
sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \
  "SELECT c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime'), h.ZAPPLICATION FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT N;"
# Search clipboard history for specific text
sqlite3 ~/Library/Containers/org.p0deje.Maccy/Data/Library/Application\ Support/Maccy/Storage.sqlite \
  "SELECT c.ZVALUE, datetime(h.ZLASTCOPIEDAT, 'unixepoch', 'localtime') FROM ZHISTORYITEM h JOIN ZHISTORYITEMCONTENT c ON c.ZITEM = h.Z_PK WHERE c.ZTYPE = 'public.utf8-plain-text' AND c.ZVALUE LIKE '%search_term%' ORDER BY h.ZLASTCOPIEDAT DESC LIMIT 10;"

Important Notes

  • This skill is macOS only. If the platform is not macOS, do not attempt to use it.
  • The database is Core Data format with Z-prefixed tables: ZHISTORYITEM and ZHISTORYITEMCONTENT.
  • Content types are stored in ZTYPE. The most common is public.utf8-plain-text. Other types include public.png, public.file-url, etc.
  • The ZVALUE column is a BLOB but can be read as text for plain text entries.
  • Timestamps are stored as Unix epoch in ZLASTCOPIEDAT.
  • Maccy must be installed and running for this to work. Install via: brew install --cask maccy

Database Schema Reference

  • ZHISTORYITEM: main table with metadata (title, timestamps, source application)
  • ZHISTORYITEMCONTENT: actual clipboard content, linked via ZITEM = Z_PK