# How to Vibe Code Your Own Alfred (and Stop Paying for It)

> Productivity app for macOS with hotkeys, keywords, text expansion and more

- Site: https://alfredapp.com
- Category: Desktop Productivity Utility
- Platforms: macOS app
- Verdict: **Serious undertaking** (35/100 vibecodeable)
- Estimated effort: 4-8 weeks of part-time systems programming

## Verdict

Build a simple web or Electron search clone, but keep paying for Alfred for its flawless native macOS performance and deep system hooks.

Replicating Alfred natively in Swift/AppKit to achieve sub-millisecond hotkey response, non-activating floating panels, and reliable global snippet expansion involves mastering complex macOS sandbox rules and low-level event taps. While AI coding tools can easily generate a web-tech utility or basic Tauri script launcher, matching Alfred's rock-solid stability and zero-latency feedback loop as a solo developer requires weeks of frustrating systems-level debugging. Since Alfred costs around $46 to $79 for a perpetual license, building it yourself is strictly an exercise in systems programming masochism.

### What you can't replicate

- Years of edge-case hardening against macOS updates and security permission changes
- The massive ecosystem of community-built workflows and extensions
- The exact native Cocoa performance profile and negligible memory footprint

## What it does

An award-winning keyboard-driven command center for macOS that replaces Spotlight, providing instant app launching, web search, custom workflows, clipboard history, and snippet expansion.

### Core features

- Global hotkey activation (Cmd+Space)
- Borderless floating search window with instant query filtering
- App and file indexing/searching via CoreSpotlight
- Web search keyword parsing and custom URL templates
- Clipboard history capture and searchable viewer
- Snippet auto-expansion via low-level keystroke monitoring
- Basic math calculator and dictionary lookups
- macOS system commands execution

## The business

### Pricing

- Alfred Core: Free
- Powerpack Single License: £34 (~$46 USD)
- Mega Supporter License: £59 (~$79 USD)

Founded 2010.
Team size: Micro-team (1-25).

## The hard parts

- Low-level macOS system integration (Quartz Event Tap, Accessibility APIs, non-activating floating panels)
- Global text expansion engine (intercepting keystrokes mid-stream, deleting triggers, pasting text without breaking cursor states)
- Instant fuzzy file search matching without lagging the main UI thread
- Visual workflow node graph runtime execution

## How to vibe code Alfred

### Prerequisites

- Mac + Xcode (Free): Required for compiling native Swift/AppKit macOS applications.
- Apple Developer Account ($99/yr): Required for code signing and notarizing native macOS binaries with Accessibility and Input Monitoring entitlements.

### Recommended AI tools

- Claude Code: Best-in-class terminal agent for scaffolding native Swift files, organizing Xcode projects, and debugging complex AppKit event loops.
- Cursor: Ideal for side-by-side iterative UI refinement of the floating search window views and workflow node graph editor.

### Stack

- Frontend: Swift / SwiftUI / AppKit
- Backend: Local Swift Process (No Server)
- Database: Local SQLite (via GRDB.swift)
- Auth: None (Local Utility)
- Payments: None
- Other: CoreSpotlight, Accessibility APIs

### Hosting

- GitHub (Source code repository and version control): $0/mo

### Build guide

1. **Scaffold Native macOS Floating Panel and Global Hotkey** — Initialize a Swift command-line or SwiftUI macOS menu bar application with a global hotkey handler (Cmd+Space) that toggles a borderless, non-activating floating panel centered on the active screen.

```
Create a new native Swift macOS application project using SwiftUI or AppKit. Implement a global hotkey listener using Carbon or CoreGraphics event taps that triggers on Command+Space. When triggered, present a borderless, floating, non-activating NSPanel that appears without stealing focus from the currently active full-screen application. Ensure the panel has a translucent dark-mode background, rounded corners, and a clean text input field that immediately accepts keyboard focus. Handle window dismissal on Escape or loss of key status cleanly.
```

2. **Implement Local Application and File Indexing Engine** — Build an indexing module using Apple's CoreSpotlight framework or a fast recursive directory traversal combined with SQLite for caching app names, bundle IDs, and common file paths with fuzzy prefix matching.

```
Write a Swift indexing service that queries local macOS directories (e.g., /Applications, ~/Applications, /System/Library/CoreServices) for installed .app bundles. Extract application names, bundle identifiers, and icons. Index these into a local SQLite database using GRDB.swift. Implement a fast fuzzy search algorithm that matches acronyms (e.g. 'gc' for Google Chrome) or prefix substrings against the indexed application titles with sub-10ms response times as the user types in the search field.
```

3. **Add Web Search Shortcuts and Calculator Features** — Parse user search input to detect keywords (e.g., 'maps', 'google') or math expressions, opening default or custom URL templates in the default browser or copying calculation results.

```
Add query parsing logic to the search input handler. If the query starts with a registered keyword (e.g., 'google <query>', 'maps <query>', or custom user-defined search URLs), format the target URL replacing {query} and open it in the default web browser using NSWorkspace.shared.open. Additionally, integrate a mathematical expression parser that evaluates basic arithmetic or advanced functions when input starts with '=' or numbers, displaying the formatted output instantly in the result list with an option to press Return to copy to the clipboard.
```

4. **Build Clipboard History Monitor and Viewer** — Implement a background NSPasteboard polling or change-count monitoring service to capture copied text and image clips, storing them in a local SQLite database with expiration rules.

```
Implement a background clipboard monitoring service in Swift using NSPasteboard changeCount polling. Whenever new text or image data is copied to the system pasteboard, store it securely in the local SQLite clipboard history table, ignoring designated private apps like Keychain Access or 1Password. Build a dedicated secondary SwiftUI viewer window accessible via a separate hotkey that lists recent clips, supports filtering via text input, and auto-pastes the selected clip into the active application when Return is pressed.
```

5. **Implement Snippet Auto-Expansion Engine** — Use global event monitors to track keystrokes mid-stream, matching snippet triggers and programmatically erasing characters while injecting expanded text.

```
Develop a low-level snippet expansion engine in Swift using a global CGEventTap to monitor keyboard events across the system. Maintain an in-memory sliding buffer of typed characters to match user-defined snippet keywords (e.g., '!email'). When a keyword match occurs, programmatically simulate backspace key events to delete the trigger string from the current text field and inject the replacement snippet string (supporting dynamic placeholders like {date}, {time}, and cursor placement {cursor}) using CGEvent keyboard posting or Accessibility APIs. Ensure snippet expansion is disabled when the active window is a secure password field.
```

### Cost vs paying

**Starting costs (one-time):**

- Apple Developer Program (Required for code signing & Accessibility entitlements): $99/yr
- AI Coding Assistant Subscription: $20
- Total: ~$119 one-time/annual

**Ongoing costs (monthly):**

- Total: $0/mo

- Paying for the SaaS instead: $0/mo (Perpetual license £34-£59 approx $46-$79 one-time)
- Build time: 40-60 hours
- AI tool credits: $20 (1 month of Claude Pro / Cursor)
- Break-even: Never (Alfred is cheaper to buy)

## Sources

- [Alfred Official Website](https://alfredapp.com)
- [Alfred Support - Powerpack License Types](https://www.alfredapp.com/help/license/faq/)
- [Wikipedia - Alfred (software)](https://en.wikipedia.org/wiki/Alfred_(software))
- [Alfred Help - Snippets and Text Expansion](https://www.alfredapp.com/help/features/snippets/)