clipmem - Showcase Project
Listed April 21, 2026
About clipmem
macOS clipboard memory in Rust, searchable from OpenClaw
clipmem — searchable, local-only clipboard history for macOS You copy dozens of things a day. Shell commands, URLs, code snippets, API keys, error messages. Most of it vanishes the moment something new hits the clipboard. clipmem fixes that. It's a Rust CLI with a native macOS menu bar app. It watches your system clipboard, archives every state it sees into a local SQLite database, and lets you search, recall, and restore anything you've ever copied. The problem macOS has a not-great clipboard history. The third-party managers that fill the gap are usually closed-source Electron apps that sync to remote servers, want a subscription, and don't search well. None of them are built to be called by AI agents. clipmem does it differently. One static binary, no runtime dependencies, local SQLite, no network, no telemetry. The CLI is JSON-first so both humans and agents can use it. How it works A background LaunchAgent polls NSPasteboard.changeCount every 400ms. When the clipboard changes, clipmem captures the full snapshot: every pasteboard item, every UTI representation, raw bytes included. clipmem deduplicates identical snapshots by SHA-256 fingerprint, so copying the same thing ten times writes one snapshot row and ten capture event rows. The database stays compact without losing timing information. Five FTS5 indexes handle different search patterns. Standard full-text search runs over text projections. Trigram matching covers punctuation-heavy content like file paths and shell commands. Separate indexes back file URLs and OCR text. A 743-line schema handles storage, and a trigger system keeps the denormalized stats and search indexes current on every write, so search never needs a manual refresh. Features Recall. Ranks candidates by FTS relevance, recency, and capture frequency. Good for natural-language queries like "what was that ffmpeg command?" Search. Three modes (auto, FTS, literal). Filters for app, bundle ID, content kind, and time range. Timeline. Chronological capture history, one row per observation. When the ranker misses something, the timeline usually catches it. Output formats. Human-readable text by default. JSON for scripts. TOON (a token-optimized format for LLMs) when agents are doing the reading. Local OCR. Opt-in. When enabled, screenshots and image-only clips get processed on-device with Apple Vision, and the extracted text becomes searchable alongside everything else. OCR runs asynchronously after capture, so failures never block the clipboard watcher. A backfill command handles images you copied before turning OCR on. Capture policy. Pause capture persistently, set automatic retention, ignore apps by bundle ID, and opt into an API key filter that skips clipboard states matching secret patterns. The filter is tuned against false positives, not for completeness. Don't treat it as leak prevention. The menu bar app A native SwiftUI menu bar app ships as a Homebrew cask. Not Electron, not a webview. It gives you history browsing with search and filters, an Option-Shift-V hotkey for quick recall, live capture status, database diagnostics, settings, launch-at-login, and update checks against GitHub releases. The app shells out to the same clipmem binary and reads the same SQLite database. It's a frontend, not a parallel system. Agent integration clipmem is built to be called by AI agents. One command installs a packaged skill into an OpenClaw workspace. The skill gives agents structured command references, JSON schema docs, examples, setup checks, and a troubleshooting guide. Once installed, agents can handle prompts like "find that SQL migration I copied yesterday" or "what was the URL I copied from Safari about NSPasteboard?" The JSON envelope carries query metadata (echo, result count, timing) and flattened text projections, so agents read clipboard content without walking nested representation trees. Privacy Everything stays on your machine. The database lives at /Library/Application Support/clipmem/ with 0700 on the directory and 0600 on the files, enforced at runtime. No network calls, no cloud sync, no telemetry. When OCR is enabled, recognition runs locally through Apple Vision. The database itself isn't encrypted. Rely on FileVault for at-rest protection. Uninstall is clean: stop the service, delete the directory, remove the binary. Install brew install tristanmanchester/tap/clipmem clipmem setup Or install the menu bar app too: brew install --cask tristanmanchester/tap/clipmem-app GitHub: https://github.com/tristanmanchester/clipmem
Project details
Built with: Rust,Swift,Shell,Python