Skip to content
xTriZzzPublic

About

Auto-clean your macOS clipboard: strips mailto:/tel: prefixes and tracking params the moment you copy them. No app, no menu bar icon, no analytics — one LaunchAgent.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

clipclean

Auto-clean your macOS clipboard. The moment you copy a mailto: link, a tel: link, or a URL stuffed with tracking parameters, clipclean rewrites the clipboard in place — so what you paste is the thing you actually wanted.

Ever right-clicked an email address, hit Copy Email Address, pasted it into a search box, and found nothing — because you were actually searching for mailto:jane@example.com? That's the itch this scratches.

What it cleans

You copy You paste
mailto:jane%40example.com?subject=Hi jane@example.com
tel:+1-555-867-5309 +1-555-867-5309
https://youtu.be/dQw4w9WgXcQ?si=AbCdEf123 https://youtu.be/dQw4w9WgXcQ
https://example.com/post?id=42&utm_source=nl&fbclid=xyz https://example.com/post?id=42
https://www.amazon.com/Very-Long-Product-Name/dp/B0ABCDEFGH/ref=sr_1_3?crid=… https://www.amazon.com/dp/B0ABCDEFGH

What it never touches

  • Multi-line text, prose, code — anything that isn't exactly a single link on the clipboard
  • Functional URL parameters: search queries, page numbers, YouTube's v= and t= timestamp all survive
  • URLs with nothing to remove — the clipboard is left byte-identical

Design principle: worst case a tracker slips through; a link never breaks.

Install

Requires macOS with the built-in /usr/bin/python3 (any Mac since Catalina).

git clone https://github.com/xTriZzz/clipclean.git
cd clipclean
./install.sh

That installs a per-user LaunchAgent — starts at login, restarts if it crashes, ~0% CPU (it checks the pasteboard twice a second via pbpaste).

Uninstall

./uninstall.sh

Or just stop it temporarily:

launchctl bootout gui/$UID/com.clipclean

Privacy

Everything happens locally. Nothing is uploaded, no analytics, no network access at all. The log at ~/Library/Logs/clipclean.log records only which rule fired and when — never your clipboard contents.

Customizing

The tracking-parameter blocklist is a plain Python set at the top of clipclean.py (TRACKING_EXACT / TRACKING_PREFIXES). Edit it, re-run ./install.sh, done. If a site you use breaks because of a stripped parameter, delete that entry — and please open an issue so the default list gets fixed.

FAQ

Why not a PopClip extension? PopClip acts on selected text. The mailto: problem comes from context-menu copies ("Copy Email Address"), which PopClip never sees. Watching the pasteboard catches every copy from every app.

I use a clipboard manager (Paste, PasteNow, Raycast…). They coexist fine. Your manager may briefly record both the dirty and cleaned versions in its history — that's clipclean winning the race.

Does it handle rich text / images? It ignores them. clipclean only ever acts when the clipboard is a single line of matching text.

Tests

python3 test_clipclean.py

License

MIT © TriZzz

About

Auto-clean your macOS clipboard: strips mailto:/tel: prefixes and tracking params the moment you copy them. No app, no menu bar icon, no analytics — one LaunchAgent.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages