Klippy is a high-performance macOS clipboard manager built with SwiftUI, designed to handle extremely large clipboard histories (up to 3+ million items) without performance degradation.
- Handles 3+ million clipboard items without performance issues
- Virtual scrolling for efficient rendering of large datasets
- Intelligent caching with automatic memory management
- Background processing to keep UI responsive
- Optimized Core Data with SQLite WAL mode and custom indexing
- Rule-based categorization using regex patterns (no AI required)
- 14 content types: URLs, emails, phone numbers, addresses, code, images, files, numbers, dates, colors, JSON, XML, Markdown, and more
- Automatic duplicate detection using content hashing
- Source application tracking
- Instant search with sub-millisecond response times
- Advanced search operators:
type:url,"exact phrases",-exclude,+required - Category filtering and date range searches
- Search result caching for improved performance
- Fuzzy matching and relevance scoring
- Native macOS menu bar app with SwiftUI
- Virtual scrolling for smooth performance with large datasets
- Visual content previews with syntax highlighting
- Hover effects and contextual actions
- Keyboard shortcuts and quick access
- Dark/light mode support
- Real-time memory usage tracking
- Search performance metrics
- Automatic cleanup of old unused items
- Memory pressure handling
- Performance reporting
- ClipboardManager: Monitors system clipboard and manages data persistence
- ContentClassifier: Rule-based content categorization engine
- SearchEngine: High-performance search with caching and indexing
- VirtualScrollView: Efficient rendering for large datasets
- PerformanceManager: Memory management and optimization
- Core Data with WAL mode for optimal database performance
- Background context processing to avoid blocking UI
- Intelligent caching with automatic expiration
- Virtual scrolling to render only visible items
- Memory pressure monitoring with automatic cleanup
- Batch operations for bulk data processing
ClipboardItem {
id: UUID
content: String
contentType: ContentCategory
contentHash: String
searchableContent: String
createdAt: Date
lastAccessedAt: Date
usageCount: Int32
sourceApplication: String?
tags: String?
}- macOS 13.0+
- Swift 5.9+
- Xcode 15.0+ (optional, for development)
-
Clone the repository:
git clone https://github.com/ceorkm/klippy.git cd klippy -
Build and run with Swift Package Manager:
# Build the project swift build # Run the application swift run # Or use the build script ./build.sh
-
Run tests:
swift test -
Build for release:
swift build -c release # The executable will be at: # .build/release/Klippy
-
Open Package.swift in Xcode:
open Package.swift
-
Build and run:
- Select the Klippy scheme
- Press Cmd+R to build and run
The app runs as a menu bar application and requires no additional configuration. All data is stored locally using Core Data.
- 3+ million items: No performance degradation
- Search response time: < 100ms for any query
- Memory usage: < 500MB for 1M items
- UI responsiveness: 60fps scrolling with virtual rendering
- Startup time: < 2 seconds with 1M items
- Virtual scrolling: Renders only visible items (typically 10-20)
- Search caching: 30-second cache with 90%+ hit rate
- Background processing: All heavy operations off main thread
- Memory management: Automatic cleanup of old unused items
- Database optimization: SQLite WAL mode with custom indexes
Klippy automatically categorizes clipboard content using rule-based patterns:
- URLs: HTTP/HTTPS links and domain patterns
- Emails: RFC-compliant email address patterns
- Phone Numbers: Various international formats
- Addresses: Street addresses with zip codes
- Code: Programming languages, HTML, function calls
- Numbers: Integers, decimals, currency
- Dates: Multiple date formats
- Colors: Hex codes, RGB values
- Files: File paths and names
- JSON/XML: Structured data formats
- Markdown: Markdown syntax patterns
Klippy supports advanced search syntax:
type:url # Filter by content type
"exact phrase" # Exact phrase matching
-exclude # Exclude terms
+required # Required terms
type:code "function" # Combined operators
- Automatic cleanup of items older than 90 days with zero usage
- Memory pressure handling with aggressive cleanup when needed
- Cache expiration to prevent memory leaks
- Background optimization of Core Data store
- Configurable limits for maximum items and memory usage
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License. See LICENSE for details.
- Check memory usage in Activity Monitor
- Use the built-in performance report: View β Performance Report
- Clear caches: Settings β Clear All Caches
- Verify search index integrity
- Restart the application
- Check for Core Data errors in Console.app
- Enable automatic cleanup in settings
- Manually clear old items: Settings β Clear Old Items
- Reduce maximum item limit
- Optimized indexes on searchableContent, createdAt, contentType
- WAL mode for better concurrent access
- Batch operations for bulk inserts/deletes
- Foreign key constraints for data integrity
- Full-text search on searchableContent field
- Compound predicates for complex queries
- Result caching with automatic expiration
- Relevance scoring based on usage and recency
- Virtual scrolling with 10-item buffer
- Lazy loading of content previews
- Debounced search to prevent excessive queries
- Background image loading for visual content