/copyq-scripting:clipboard-inspectfrom copyq-scripting
Read the current clipboard, the X11 PRIMARY selection, or any item from CopyQ history — by row, by MIME type, or filtered by regex. Use when the user wants to inspect what's on the clipboard, dump history to a file, or pipe clipboard contents into another tool.
Ships in copyq-scripting. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
copyq clipboard # text/plain (default)
copyq clipboard text/html # HTML representation
copyq clipboard text/uri-list # file URIs (when files are copied)
copyq clipboard image/png > /tmp/clip.png # image data
List MIME types currently on the clipboard:
copyq eval -- 'print(clipboard("?"))'
copyq selection
Only meaningful on X11 sessions. On Wayland, PRIMARY support is patchy — verify before relying on it.
copyq count # how many items in current tab
copyq read 0 # most recent item
copyq read 0 1 2 # multiple
copyq separator $'\n---\n' read 0 1 2 # custom separator between items
Read from a specific tab:
copyq tab "Links" read 0
CopyQ doesn't expose a CLI grep, but eval makes it trivial:
# Find rows matching a regex; print row + content
copyq eval -- '
var n = count();
for (var i = 0; i < n; i++) {
var t = str(read(i));
if (t.match(/TODO/i)) print(i + ": " + t + "\n");
}
'
copyq eval -- '
var n = count();
var out = [];
for (var i = 0; i < n; i++) out.push(str(read(i)));
print(out.join("\n---\n"));
' > ~/clipboard-history.txt
Or dump every tab:
copyq eval -- '
var ts = tabs();
for (var ti = 0; ti < ts.length; ti++) {
tab(ts[ti]);
print("=== " + ts[ti] + " ===\n");
for (var i = 0; i < count(); i++) print(str(read(i)) + "\n---\n");
}
'
copyq eval -- '
var item = getItem(0);
for (var k in item) print(k + " (" + item[k].size + " bytes)\n");
'
There is no copyq tail; emulate with a one-shot Automatic command that prints to stderr, or poll:
# Poll approach (cheap, fine for ad-hoc)
prev=""
while sleep 0.5; do
cur=$(copyq clipboard 2>/dev/null)
if [ "$cur" != "$prev" ]; then
printf '[%s]\n%s\n---\n' "$(date +%T)" "$cur"
prev=$cur
fi
done
For production-quality monitoring, write an Automatic Custom Command that calls notify-send or appends to a logfile — see write-custom-command.
copyq read without a row number defaults to row 0 — easy to confuse with clipboard().clipboard() and read(0) can differ momentarily — the clipboard updates before CopyQ stores the new item.image/png, etc.) print raw bytes; redirect to a file rather than letting them hit the terminal.What SKILL.md sets; muted values are Claude Code's defaults
copyq-scripting@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin copyq-scripting7 skills in this plugin
/bind-global-shortcutBind a system-wide keyboard shortcut to a CopyQ Custom Command — show menu, paste-as-plain-text, run a transformation on the current clipboard, etc. Covers both the in-CopyQ `GlobalShortcut` field and the alternative of binding the shortcut at the desktop-environment level (KDE / GNOME) to a `copyq` CLI invocation./copyq-cli-referenceAuthoritative reference for the CopyQ command-line interface and scripting language on Ubuntu Linux. Load this before authoring any other CopyQ skill output so generated commands and scripts are syntactically valid. Covers `copyq` subcommands (read, write, add, remove, tab, select, eval, edit), the embedded ECMAScript-flavoured scripting language, MIME-type handling, and item formats./