SmartTrim
Fix AI clipboard chaos
Lightweight macOS menu bar utility that automatically fixes formatting issues in clipboard text. It runs silently in the background and cleans up text when you copy-paste between applications.
Born from the gmickel bench project—where I needed to copy explanations from AI assistants into docs without the formatting nightmares.
THE PROBLEM
When you copy text from AI coding assistants (Claude Code, Cursor, GitHub Copilot, ChatGPT) and paste it into Slack, Notion, email, or documents—the text often comes out broken.
Ghost indentation
Invisible leading spaces that throw off alignment
Hard line breaks
Sentences broken mid-word due to terminal wrapping
Formatting artifacts
Weird spacing from fixed-width terminal display
Broken lists
Bullet points and numbered lists with mangled continuations
This happens because terminal-based AI tools format text for fixed-width display, not for prose.
HOW IT WORKS
SmartTrim monitors your clipboard. When it detects text that looks malformed (using heuristics like indentation patterns and mid-sentence line breaks), it automatically cleans it up:
- ›Strips invisible leading whitespace
- ›Rejoins lines that were broken mid-sentence
- ›Preserves intentional structure (paragraphs, bullet points, numbered lists)
You can also trigger a manual clean with a customizable global hotkey (default: ⌘⇧.) or from the menu bar.
FEATURES
Set it and forget it. Monitors your clipboard and automatically cleans malformed text.
Clean on demand via global hotkey (⌘⇧.) or from the menu bar when you need control.
Only processes text that appears broken. Leaves normal text alone—it won't mangle your code.
Preserves intentional structure: paragraphs, bullet points, numbered lists, code blocks—they're safe.
SETTINGS
- Built with
- Swift 6 + SwiftUI
- Size
- ~500 lines of code
- Dependencies
- None
- Requirements
- macOS 14.0+ (Sonoma)
- Architecture
- Apple Silicon & Intel
- License
- MIT (Open Source)
Developers who use AI coding assistants daily and frequently copy text between their terminal and other applications.
If you've ever pasted a Claude or ChatGPT response into Slack and wondered why it looks like garbage—this is for you.