LIVE cartercole.net --:--:-- UTC

// 02 FIELD TOOLS

cleanshare

SWIFT MACOS IOS REPO

Strips the tracking out of links as you copy them. Press share on a post on X and the clipboard holds x.com/NASA/status/1383221042504638464?s=46&t=AbCdEfGh; a tenth of a second later CleanShare has replaced it with x.com/NASA/status/1383221042504638464, so whatever you paste carries only what the link needs to open. On a Mac it is a menu-bar app that sees every copy in every app. On an iPhone, where no app may watch the clipboard, it is a share-sheet button and a Shortcut.

What share buttons add

Share and copy-link buttons append parameters that are about the share, not the content: X's s, t and a, Instagram's igsh, Spotify's si and pi, TikTok's _t and _r, Reddit's share_id, LinkedIn's rcm, YouTube's si and pp. Some are campaign tags. Several are, by most accounts, tied to whoever pressed share, and YouTube's pp encodes the search that led to the video. None of them is needed to open the post, and all of them go wherever the link is pasted.

What it keeps

Each site has a rule: either a list of the only parameters worth keeping, or a list of trackers to drop on top of the global ones (utm_*, fbclid, gclid, msclkid, mc_eid, and about seventy more). A tweet keeps its handle and status id and loses everything else, /photo/1 included. An Amazon product becomes /dp/<ASIN>, but keeps psc and smid, because those pick the size and the seller. YouTube keeps v, t and list; Google keeps q; eBay keeps var; Instagram keeps img_index, the carousel slide. Gift and friend links survive: the New York Times' unlocked_article_code, the Wall Street Journal's st, Medium's sk.

Names that mean tracking on one site and something real on another (ref, s, t, si, st, r) are only ever dropped where they are known trackers. Redirect wrappers such as l.facebook.com/l.php?u= and google.com/url?q= are unwrapped to the link inside, offline. Sign-in and OAuth addresses are never touched.

The rules are distilled from ClearURLs, AdGuard's URL Tracking filter and Brave's and Firefox's query-stripping lists, then checked against share URLs people have posted to those projects' issue trackers. Fifty-eight before-and-after fixtures run on every build, and each one is cleaned twice to prove a clean link stays clean.

On a Mac

macOS has no event for a copy, so CleanShare reads the pasteboard's change counter every 150 ms: an integer, not the contents. When it moves, macOS's own pattern detector says whether a web link is probably there, which reads nothing and raises no paste prompt, and only then is the clipboard read. Plain text is cleaned; so are hrefs and the visible link text in HTML, and the hyperlink fields in RTF, so a rich paste into Mail or Notes is clean as well. Any other flavour that still contains the old link is dropped rather than left to leak. Copies marked concealed or transient, the convention password managers use, are left alone.

From copy to clean clipboard measured 17 to 117 ms over five runs. It asks once for Paste from Other Apps; set to Allow, it never asks again.

Homebrew installs the Mac app with brew install --cask cartercole/tap/cleanshare. Apple has not notarized this build, so the first launch needs Open Anyway in System Settings under Privacy & Security.

On an iPhone

iOS lets no app watch the clipboard in the background, so the hook is one tap:

Short share links

Off by default. vm.tiktok.com, reddit.com/r/…/s/…, a.co/d/…, pin.it, fb.watch and t.co hide the real address behind a redirect, and the short code is often made fresh for each share. With expansion on, CleanShare sends the shortener one request, with no cookies and no cache. It follows redirects only while they stay on shortener hosts and stops at the first hop that leaves, so the destination page is never fetched. Then it cleans what it found. A landing on a homepage or a login wall is thrown away, and the short link is kept.

Stated honestly