| name | shared-clipboard |
| description | Cross-session key-value clipboard for sharing snippets, code, URLs, configs, and notes between agents, sessions, and devices. Use when storing, retrieving, or sharing text snippets, when piping data between commands, or when the user says "save this", "remember this snippet", "clipboard", "clip", or "scratchpad". |
| triggers | ["clipboard","clip set","clip get","save snippet","scratchpad","share between sessions","remember this code","store this value"] |
| category | productivity |
| maturity | stable |
| tags | ["clipboard","scratchpad","sqlite","snippets","cross-session"] |
Shared Clipboard
Cross-session key-value snippet store. Share text, code, URLs, configs, SQL queries, and notes between agents, sessions, devices, and humans.
Binary: ~/bin/clip (or node ${CLAUDE_SKILLS_DIR:-$HOME/.claude-agent/.claude/skills}/shared-clipboard/scripts/clip.cjs)
Database: ~/.clipboard/clips.db (SQLite)
Quick Reference
clip set mykey "some value"
clip get mykey
clip set db-conn "postgres://user:pass@host/db" --tag config,secrets
clip set deploy-cmd "docker compose up -d" --tag commands,prod
echo "complex value" | clip set mykey
clip get mykey | pbcopy
cat query.sql | clip set last-query --tag sql
clip list
clip list --tag config
clip list --search postgres
clip tags
clip push "quick thought"
clip peek
clip pop
All Commands
Core Operations
| Command | Description |
|---|
clip set <key> <value> | Store a value. Pipe stdin if no value arg. Auto-detects content type. |
clip get <key> | Retrieve value. Raw output (pipeable). Fuzzy-matches if key not found. |
clip del <key> | Delete a key (fails if pinned). |
clip append <key> <value> | Append text to existing clip (newline-separated). |
Organization
| Command | Description |
|---|
clip list [--tag T] [--search Q] [--all] | List clips with optional filters. |
clip tags | Show all tags with counts. |
clip pin <key> | Pin clip (protects from garbage collection). |
clip unpin <key> | Remove pin. |
Stack (Anonymous LIFO)
| Command | Description |
|---|
clip push <value> | Push onto anonymous stack. |
clip pop | Pop most recent stack item (removes it). |
clip peek | View top of stack without removing. |
Versioning
| Command | Description |
|---|
clip history <key> | Show all versions of a key. |
clip diff <key1> <key2> | Line-by-line diff between two clips. |
Sharing & Export
| Command | Description |
|---|
clip share <key> | Pretty-print with metadata (for pasting in chat). |
clip export [--format json|csv|md] [--tag T] | Export all clips. |
clip import <file.json> | Import from JSON export. |
clip copy <from> <to> | Duplicate a clip under new key. |
clip rename <old> <new> | Rename a key. |
Maintenance
| Command | Description |
|---|
clip stats | Usage statistics (counts, sizes, top accessed). |
clip gc [--older-than 30d] | Delete old unpinned clips. |
Features
Auto Content-Type Detection
When you set a value, the clipboard auto-detects its type:
| Type | Detection |
|---|
json | Valid JSON objects/arrays |
url | Starts with http:// or https:// |
code | Starts with import/const/def/class/etc. |
sql | Starts with SELECT/INSERT/UPDATE/etc. |
command | Starts with curl/docker/git/npm/etc. |
path | Filesystem path |
multiline | 5+ lines of text |
text | Default |
Version History
Every set to an existing key saves the previous value in history:
clip set config '{"port": 3000}'
clip set config '{"port": 8080}'
clip history config
Tagging System
Organize clips with comma-separated tags:
clip set prod-url "https://prod.example.com" --tag urls,production
clip set staging-url "https://staging.example.com" --tag urls,staging
clip list --tag urls
clip list --tag production
clip tags
Piping Support
get outputs raw value to stdout — perfect for piping:
clip get sql-query | sqlite3 mydb.db
clip get ssh-cmd | bash
clip get json-data | jq '.items[0]'
ls -la | clip set dir-listing
git diff | clip set last-diff --tag git
curl -s https://api.example.com/status | clip set api-status --tag monitoring
Garbage Collection
Pinned clips survive forever. Unpinned clips can be cleaned:
clip pin important-key
clip gc --older-than 7d
clip gc --older-than 24h
Agent Usage Patterns
Sharing data between sessions
clip set forex-summary "CPI inline 0.2%, NFP tomorrow 13:30 CET" --tag forex,daily
clip get forex-summary
Storing intermediate results during work
clip set step1-result "$(python3 analyze.py data.csv)"
clip set step2-result "$(node transform.cjs)"
clip get step1-result > /tmp/step1.txt
Quick notes from user
When user says "remember this" or "save this":
clip set <descriptive-key> "user's text" --tag notes
Config sharing
clip set db-host "localhost:5432" --tag config
clip set redis-url "redis://localhost:6379" --tag config
clip list --tag config
Code snippet library
clip set boilerplate-express "const app = express();\napp.get('/', (req, res) => res.json({ok:true}));" --tag code,node
clip set sql-top-errors "SELECT message, count(*) FROM events WHERE type='error' GROUP BY message ORDER BY count(*) DESC LIMIT 10" --tag sql