Sugarfree is a tiny macOS app that strips formatting "sugar" from whatever you copy and lives in your menubar.
AI chat tools (Claude, ChatGPT, Gemini) love to copy text with formatting baked
in — HTML <strong>/<em>/<u>/<s>, RTF font traits, markdown **/*/~~.
That styling leaks into every app you paste into. Sugarfree sits in your menu
bar, watches the clipboard, and quietly removes the sugars you choose so the
text you paste is the text you wanted.
- Menu bar only — no Dock icon, no window clutter (
LSUIElementagent app). - Automatic cleanup — polls
NSPasteboardand rewrites copied text in place. - Pick your sugars — strip any of bold, italic, underline,
strikethrough, each independently toggleable (bold + italic on by default). - Works across representations — RTF font traits and underline/strikethrough attributes, HTML tags + inline styles, and markdown markers.
- Structural transforms — optionally reshape content after stripping. Currently Tables → list: convert Markdown/HTML tables into YAML-style or TOML-style list items. Transforms are lossy, so they're off by default and live in their own section.
- Non-destructive — only changed representations are rewritten; unrelated pasteboard types and items are preserved.
- Configurable polling interval — 0.25s / 0.5s / 1.0s / 1.5s.
- Manual mode — "Clean Now" cleans the current clipboard on demand.
- Keyboard shortcuts —
⌘⇧Ptoggle automatic cleanup,⌘⇧Kclean now. - Activity tracking — total cleanups and last action shown in the dashboard.
- macOS 13 (Ventura) or later
- Xcode 15+ and the command-line tools (to build)
- XcodeGen —
brew install xcodegen
Download the latest Sugarfree.app from the
Releases page, unzip it,
and drag it into /Applications.
The app is distributed unsigned. On first launch macOS Gatekeeper may block it. Right-click the app → Open, then confirm. (Or run
xattr -dr com.apple.quarantine /Applications/Sugarfree.app.)
git clone https://github.com/donny-son/sugarfree.git
cd sugarfree
./build.sh # generates the Xcode project and builds Debug
./build.sh --run # build and launchThe build script runs XcodeGen against project.yml, then xcodebuild. The
built app lands at build/DerivedData/Build/Products/Debug/Sugarfree.app.
To work in Xcode:
xcodegen generate # regenerate Sugarfree.xcodeproj from project.yml
open Sugarfree.xcodeproj- Launch Sugarfree. The lollipop icon appears in the menu bar with a status dot (pink = active, amber = no sugar enabled, grey = paused).
- Click the icon to open the dashboard: toggle automatic cleanup, run "Clean Now", choose which sugars to strip, enable structural transforms, set the polling interval, and see an activity summary — all in one place.
- Copy formatted text from anywhere — paste it, and the sugar is gone.
The same stripping and table-transform logic ships as a cross-platform CLI,
sugarfree, for use in shell pipelines, AI-harness hooks, and build steps. It
reuses the shared SugarCore package, so its behavior never
drifts from the app.
swift build -c release --product sugarfree # build it
printf '**bold** and *italic*' | sugarfree # → "bold and italic"
sugarfree --all notes.md # strip every sugar from a file
sugarfree --none --tables in.md # just flatten tables to YAMLHow to get it per platform:
- macOS — the
.dmgapp bundles the CLI. On first launch Sugarfree symlinkssugarfreeinto/usr/local/binfor you (prompting for admin only if needed), so it just works in your terminal after you install the app. A standalone macOS CLI tarball is also attached to each release if you want only the CLI. - Linux / Windows — download the CLI binary for your platform from the releases (there's no desktop app on these platforms — it's CLI-only).
See cli/README.md for the full flag reference and
hooks/README.md for harness/CI recipes.
Sugarfree polls NSPasteboard.general.changeCount on the chosen interval. When
the clipboard changes, it inspects the RTF, HTML, and plain-text
representations, strips the sugars you enabled from each, and writes the cleaned
versions back. A selfWriteCount guard ignores the app's own writes so it
never loops on itself. Representations it doesn't touch are left intact.
For signed builds or notarized archives, copy the signing config template and fill in your team identity:
cp Configs/LocalSigning.xcconfig.example Configs/LocalSigning.xcconfig
# set DEVELOPMENT_TEAM and CODE_SIGN_IDENTITYConfigs/Release.xcconfig includes LocalSigning.xcconfig if present.
MIT © 2026 Dongook Son
