Skip to content

abhi-raheja/axo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Axo - macOS Menu Bar Self-Talk Companion

A privacy-first macOS menu bar app that monitors typing, detects self-critical language patterns locally, and gently prompts reframing with Claude API assistance.

Features

  • Privacy-First Design: All text monitoring and pattern detection happens 100% locally on your device
  • Gentle Intervention: Non-intrusive floating indicator appears near cursor when self-critical language is detected
  • Smart Detection: Uses hand-crafted regex patterns + Apple NLP sentiment analysis for accurate detection
  • Built-in Reframes: Local library of compassionate reframe suggestions - works offline, no API needed
  • Optional AI Enhancement: Claude API integration available for personalized AI-powered suggestions
  • Menu Bar Only: Runs quietly in your menu bar without a dock icon

Requirements

  • macOS 13.0 or later
  • Xcode 15.0 or later (for building)
  • Anthropic API key (optional, for AI-powered suggestions)

Installation

  1. Clone or download the project
  2. Open Axo.xcodeproj in Xcode
  3. Build and run (Cmd+R)
  4. Grant Accessibility permission when prompted

Usage

First Launch

  1. When Axo launches, you'll see a heart icon in your menu bar
  2. Click the icon to access the menu
  3. Grant Accessibility permission to enable keyboard monitoring

Pattern Detection

Axo detects self-critical language patterns including:

  • Absolute negatives: "I always mess up", "I never get it right"
  • Self-labeling: "I'm so stupid", "I'm such a failure"
  • Self-blame: "It's all my fault", "I should have known better"
  • Catastrophizing: "Nothing I do is good enough"
  • Worthlessness: "I hate myself", "What's wrong with me"

When Detection Occurs

  1. A small heart bubble appears near your cursor
  2. After 3 seconds, it expands showing the detected phrase
  3. Click "Yes, help me" to get reframe suggestions
  4. Click "Dismiss" to close the bubble
  5. If ignored, the bubble fades after 8 seconds

Reframe Suggestions

By default, Axo uses its built-in library of compassionate reframe suggestions. No API key is required for basic functionality.

Optional: AI-Powered Suggestions

For personalized AI-generated reframes:

  1. Open Settings from the menu bar
  2. Go to the API tab
  3. Enter your Anthropic API key
  4. AI suggestions will be available alongside local reframes

Privacy

  • Local Processing: All keyboard monitoring and pattern detection happens on your device
  • No Persistent Storage: Text is stored in a rolling 500-character buffer that is never saved to disk
  • Opt-in API: The Claude API is only called when you explicitly click "Help me"
  • Secure Storage: API keys are stored in macOS Keychain

Project Structure

Axo/
├── App/
│   ├── AxoApp.swift            # Main entry with MenuBarExtra
│   ├── AppDelegate.swift       # Panel management
│   └── AppState.swift          # Observable state manager
│
├── Core/
│   ├── Debug.swift             # Conditional debug logging
│   ├── KeyboardMonitor/
│   │   ├── GlobalKeyboardMonitor.swift
│   │   ├── TextBuffer.swift
│   │   ├── PermissionManager.swift
│   │   └── CaretPositionHelper.swift
│   │
│   ├── PatternDetection/
│   │   ├── SelfCriticalPatternDetector.swift
│   │   ├── PatternLibrary.swift
│   │   └── DetectionResult.swift
│   │
│   ├── Reframes/
│   │   └── ReframeLibrary.swift
│   │
│   └── Services/
│       ├── ClaudeAPIService.swift
│       └── KeychainService.swift
│
├── UI/
│   ├── MenuBar/MenuBarView.swift
│   ├── Indicator/
│   │   ├── IndicatorPanel.swift
│   │   ├── IndicatorContentView.swift
│   │   └── IndicatorController.swift
│   ├── ReframeSheet/
│   │   ├── ReframeView.swift
│   │   └── SuggestionCard.swift
│   └── Settings/SettingsView.swift
│
├── Models/
│   ├── DetectedPhrase.swift
│   └── ReframeSuggestion.swift
│
└── Resources/
    └── Assets.xcassets

AxoTests/
├── Core/
│   ├── TextBufferTests.swift
│   ├── PatternLibraryTests.swift
│   ├── ReframeLibraryTests.swift
│   └── PatternDetectorTests.swift
└── Integration/
    └── DetectionPipelineTests.swift

Technical Details

  • Keyboard Monitoring: Uses CGEventTap with .listenOnly option (non-intercepting)
  • Floating Panel: NSPanel with .nonactivatingPanel style (doesn't steal focus)
  • Pattern Detection: Hand-crafted regex patterns + Apple NLP sentiment analysis
  • Local Reframes: Built-in library of compassionate reframe suggestions
  • API Integration: Optional Anthropic Claude API for AI-powered suggestions (stored securely in Keychain)

Testing

Run tests via command line:

./run_tests.sh

Or via Xcode: Cmd+U to run all tests.

Test coverage includes:

  • TextBuffer operations and edge cases
  • Pattern matching accuracy (19 categories)
  • Reframe library lookups
  • Detection pipeline integration

License

MIT License

About

A macOS menubar app that monitors typing, detects self-critical language patterns locally, and gently prompts reframing with Claude API assistance.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors