The friction of context-switching between native applications and web-based LLMs has long been a productivity killer for developers. Sarif Mia, a developer frustrated by the repetitive cycle of copying Slack messages, switching tabs, and pasting into ChatGPT or Claude, has released GrammarBar, a free, open-source macOS menu bar app designed to eliminate this workflow bottleneck. By integrating directly into the system menu bar, the tool allows users to fix, polish, and translate text without leaving their current application, targeting a problem that affects dozens of interactions per day for many knowledge workers.
Leveraging Existing Infrastructure Over New APIs
A standout architectural decision in GrammarBar is its refusal to require separate API keys or backend infrastructure. Instead, the app functions as a wrapper around the Claude Code CLI, utilizing its headless mode to process text. The system executes commands like claude -p ", passing user input via stdin to avoid shell string issues. This approach leverages the fact that many developers already have Claude Code installed and authenticated, simplifying the privacy story by keeping all processing local and eliminating the need for billing management or server-side analytics.
Technical Hurdles in macOS Integration
Capturing text from arbitrary applications proved more complex than anticipated due to inconsistent Accessibility API support in Electron-based apps like Slack and Teams. To bypass this, GrammarBar simulates user actions by posting synthetic Cmd+A and Cmd+C keystrokes, then monitoring the clipboardβs changeCount to detect when text has successfully been copied. This method, registered via Carbonβs RegisterEventHotKey, ensures reliability across various apps but requires Accessibility permissions. The developer notes that this permission is requested only upon first use and is strictly limited to these two keystrokes, avoiding invasive screen reading.
Precision Prompting for Minimal Edits
The efficacy of the tool relies heavily on prompt engineering designed to prevent the LLM from over-editing or misinterpreting instructions. The core rules mandate that the model output only the resulting text, preserving line breaks, links, and emojis exactly. Crucially, the prompts instruct the model to distinguish between the userβs meta-request (e.g., "fix this msg") and the actual content, preventing the AI from answering questions within the text rather than correcting them. This distinction is vital for maintaining the userβs original tone and intent, a common failure point in generic grammar tools.
Key Takeaways
- GrammarBar is MIT licensed and requires macOS 13+, Claude Code installed, and Accessibility permissions.
- It supports four modes: grammar fixing, polishing, translating to English, and translating to 34 other languages.
- The app is distributed via Homebrew cask to bypass Gatekeeper restrictions associated with unsigned downloads.
- Users can chain modes, such as translating first and then polishing, using the searchable history feature.
The Bottom Line
GrammarBar proves that the best AI integration isn't about building new models, but about reducing the latency between thought and action. By treating the CLI as a utility layer, the developer has created a seamless bridge between native productivity and LLM intelligence.