name: clipboard-memory description: Recall what the user copied on this Mac via the local clipmem archive: exact text, commands, SQL, URLs, file paths, HTML, images, and PDFs. Trigger on requests like "what was that command I copied?", "paste back that SQL", "the URL I copied from Safari", "show me what I copied from Xcode today", "find the snippet/path/link from before I restarted", and indirect paraphrases about clipboard history or recovering copied content. Prefer this over web, repo, or filesystem search only when the target was likely copied. version: "1.3.7" license: MIT platforms: [macos] metadata: hermes: category: productivity tags: [clipboard, memory, macos, local-first, cli, retrieval]
Use this skill to recover clipboard history from the local clipmem archive in
Hermes Agent. This package is installed by
clipmem agents hermes install-skill. The canonical cross-agent source lives
under skills/clipboard-memory/.
Clipboard Memory
Use this skill when the target is likely something the user copied on this Mac, even if they never say "clipboard". Prefer it over web, repo, or filesystem search only when the item likely lived on the clipboard.
Use this skill when
The user asks things like:
- "what was that command I copied?"
- "show me the URL I copied from Safari earlier"
- "find that snippet, path, note, or link I copied yesterday"
- "give me the exact text I copied, not a summary"
- "what did I copy before I restarted?"
- "paste me back that SQL I was looking at"
- "get the PDF I copied last week"
- "show me everything I copied from Xcode today"
Also trigger when the user asks indirectly to recover or paste back something from earlier and the clipboard is the most plausible source, even if they never say "clipboard", "copy", or "paste".
Do not use this skill for
- web search or current-events lookups
- searching the repository, local files, or browser history when the user never copied the target
- content the user typed but never copied to the clipboard
- anything on a non-macOS machine (
clipmemonly capturesNSPasteboard)
Fast decision workflow
- Confirm the target likely came from the clipboard.
- If empty results would be surprising, run
scripts/check-setup.shfirst. Preferscripts/check-setup.sh --jsonwhen you want structured diagnostics. The prose fallback is references/setup-check.md. - Pick the narrowest starting command:
- vague recollection ->
recall - chronological history / "today" / "yesterday" / "in order" ->
timeline - recent unique things ->
recent - exact phrase, punctuation-heavy string, URL fragment, or file suffix ->
search --mode literal - snapshot id already known ->
get - binary / image / PDF recovery ->
getthenexport
- vague recollection ->
- Add only the filters the user actually implied:
--hours,--app,--kind,--has-url,--has-file-url,--prefer-recent. - If the first pass is weak, empty, or low-confidence, broaden once before
giving up: widen
--hours, drop source filters, inspectalternatives, then switch betweenrecall,search,recent, andtimeline. - Return the recovered content plus provenance such as
observed_at,app_name, andsnapshot_idwhen useful.
Capability map
The repo-side agent-native action parity contract lives in
docs/action-parity.md. Use it when you need the maintained map from
user-visible outcomes to agent-accessible commands, entity CRUD expectations,
and derived-cache boundaries.
Critical behavior rules
- Before answering from a stale, empty, or ambiguous archive, run
clipmem agents context --format jsonand usegenerated_at, health, settings, app state, recent activity, revision, stats, privacy, and capability fields to decide whether to broaden search or diagnose setup. - Always use
--format jsonwhen you will parse the response.--format toonis for token-efficient enumeration only.--format jsonlis for streaming many rows into a pipeline. Never parsemdortext. - Treat
recallas a convenience ranking helper, not an authority. For uncertain cases, compose primitive commands in this order:search,recent,timeline,get, then OS follow-through such aspbcopy,open, oropen -R. - Never claim "nothing found" until you have broadened the search once and
checked
truncated/next_cursor. - When
best_match_confidenceis"low"or there are several plausible hits, present the top candidates instead of pretending certainty. - For exact-text requests, quote
best_textverbatim. Do not paraphrase commands, SQL, code, URLs, or file paths unless the user asked for a summary. - For binary-only snapshots where
best_textis empty, say so plainly and recover the raw bytes withexport; do not invent text. - Keep the query and filters stable while paginating with
--cursor. - Prefer
recentovertimelinewhen the user wants unique things rather than every copy event.
Health check and setup
Before querying, confirm the setup is healthy. Empty results can mean the watcher is stale, not that the archive has no match.
- Background capture must be running.
clipmem setupis the canonical fix; Homebrew users can also usebrew services start clipmem. - The binary
clipmemmust be on PATH with access to~/Library/Application Support/clipmem/clipmem.sqlite3. - Run
scripts/check-setup.shwhen results look wrong. It exits0on a healthy host,1if the watcher is stale,2if the binary is missing, and3ifclipmem doctororclipmem service statusfails.scripts/check-setup.sh --jsonemits structured status for Hermes. - If Hermes cannot see this skill, run
clipmem agents hermes doctorand follow its remediation lines.
Command ladder
Always pick the narrowest command that answers the question.
clipmem recall- best-first ranked answer with alternatives. Start here for most "what was that thing I copied" requests.clipmem timeline- chronological capture events, including repeated copies of the same content. Use for "today", "yesterday", "before I restarted", "in order", or "every time".clipmem recent- recent unique snapshots, deduplicated by snapshot.clipmem search- direct lexical / FTS matching. Use--mode literalfor exact substrings or punctuation-heavy content.clipmem get SNAPSHOT_ID- nested item / representation detail for a single snapshot already in hand.clipmem export SNAPSHOT_ID --item N --uti UTI --out PATH- raw bytes for binary, image, or PDF payloads.clipmem ocr candidates,clipmem ocr get,clipmem ocr clear, andclipmem storage image-candidates- inspect queued OCR or image optimization work before running batch workflows, or clear one stale OCR result.clipmem settings reset --format json- reset capture policy and ignored apps when the user explicitly asks to restore defaults.clipmem service providers --format json- inspect service provider state without starting or stopping capture.clipmem service revision --format json- inspect archive revision counters without probing service providers.clipmem app settings,clipmem app launch-at-login,clipmem app update-check run, orclipmem app quitwith--format json- inspect or change menu bar app preferences and app-owned state when the user asks about app defaults, update checks, or quitting the app.clipmem agents context --format json- compact health, settings, app state, recent activity, revision, stats, privacy, and capability context before multi-step work.
Primitive command taxonomy
Primitive commands expose one bounded read or mutation that can be composed
directly. Convenience workflows such as recall, setup, purge, ocr run, and
storage optimize-images remain useful, but verify uncertain results with
search, recent, timeline, or get, and preview broad mutations with
candidate or dry-run commands when available.
The full flag reference, JSON envelope, and kind values live in references/commands.md, references/json-schema.md, and references/examples.md.
Common recovery playbooks
- Command, SQL, or code snippet - start with
clipmem recall "..." --format json --limit 5; if punctuation matters, follow withclipmem search "..." --mode literal --format json. - URL, path, or filename fragment - add
--has-urlor--has-file-url; scope by--app safarior another app only if the user implied it. - "Everything I copied today / from Xcode" - use
clipmem timeline --hours 24 --app xcode --format json(or--hours 48for "yesterday",--hours 168for "last week"). - Recent unique clipboard items - use
clipmem recent --hours N --format jsonor--format toonwhen you only need a compact list. - Image or PDF recovery - locate the snapshot with
recallorsearch, inspect it withget, then recover bytes withexport. - Before a restart or long ago - start broader than you think
(
--hours 72,168, or more) and prefertimelineif ordering matters.
Output format rule
--format json— structured output. Retrieval envelopes are stable withinschema_version: 2; management and inspection commands use command-specific JSON shapes, so parse documented keys directly.--format toon- flat, token-efficient list. Prefer for high-cardinality enumeration (timeline,search,recent,recall) when you only need the top fields. Note:getdoes not supporttoon.--format jsonl- newline-delimited records. Use when streaming many rows into a pipeline.--format md/--format text- human-readable previews only; never parse these.
--json is an alias for --format json on search, recent, timeline,
get, service revision, capture-once, and doctor.
Reading the response
Read these JSON fields first; walk nested items[].representations[] only
after a get call:
best_candidate.best_text- the flattened primary text.best_candidate.urls- URL array (empty when none).best_candidate.file_paths- file-URL array.best_match_confidence,why_selected, andalternatives- confidence and fallback options.observed_at,app_name, andkind- provenance and content shape.next_cursor,truncated- pagination state.schema_version- pin to2for stability.
Full schema in references/json-schema.md.
Quick examples
# best-first answer
clipmem recall "that command I copied" --format json --limit 5
# Safari today, chronological
clipmem timeline --app safari --hours 24 --format json --limit 25
# recent unique items, token-efficient
clipmem recent --hours 72 --format toon --limit 20
# exact URL or punctuation-heavy string
clipmem search "https://example.com/path?q=1" --mode literal --format json
# recover an image
clipmem get 42 --format json
clipmem export 42 --item 0 --uti public.png --out ./clipboard.png
Troubleshooting
If recall looks empty or weak, widen --hours, drop source filters, or
switch to timeline / search. For setup issues, Hermes skill discovery, or
binary-only snapshots, see
references/troubleshooting.md.
Exit codes
0 success, 1 uncategorized runtime, 2 invalid args, 3 not found, 4
unsupported format, 5 database error, 6 platform error.