SmartTrim.
Fix AI clipboard chaos.
Lightweight macOS menu bar utility that automatically fixes formatting issues in clipboard text. Runs silently in the background and cleans up text when you copy-paste between applications.
- Platform
- macOS
- Stack
- Swift 6
- Version
- v1.0.0

01 / Problem
AI text comes out mangled.
When text from AI coding assistants gets pasted into Slack, Notion, or email, it often comes out broken. Terminal formatting leaks into prose.
- 01
Ghost indentation
Invisible leading spaces that throw off alignment.
- 02
Hard line breaks
Sentences broken mid-word due to terminal wrapping.
- 03
Formatting artifacts
Weird spacing from fixed-width terminal display.
- 04
Broken lists
Bullet points and numbered lists with mangled continuations.
Terminal-based AI tools format text for fixed-width display, not prose.
02 / How it works
Monitor, detect, clean.
Heuristics that detect malformed text without touching code blocks.
SmartTrim monitors the system clipboard. When it detects text that looks malformed (using heuristics like indentation patterns and mid-sentence line breaks), it cleans it up:
- Strips invisible leading whitespace.
- Rejoins lines that were broken mid-sentence.
- Preserves intentional structure (paragraphs, bullets, numbered lists).
You can also trigger a manual clean with a customizable global hotkey (default: ⌘⇧.) or from the menu bar.
03 / Features
What's in the box.
- 01
Auto-Trim
Set it and forget it. Monitors the clipboard and cleans malformed text automatically.
- 02
Manual Trim
Clean on demand via global hotkey (⌘⇧.) or from the menu bar when you need control.
- 03
Smart Detection
Only processes text that appears broken. Leaves normal text alone; it won't mangle code.
- 04
Structure Aware
Preserves intentional structure: paragraphs, bullet points, numbered lists, code blocks.
04 / Spec
Technical details.
- 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)
Who it's for
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.
- macOS
- Swift
- Open Source