Skip to content

valentingarnier/subsniper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SubSniper

Native macOS menu bar app that auto-detects recurring subscriptions from your email, classifies them with AI, and helps you spot forgotten charges before they hit.

macOS 14+ Swift License

What it does

SubSniper sits in your menu bar, connects to your email (Gmail / Microsoft), and uses Claude AI to find recurring subscriptions you're paying for. It shows you:

  • What you're paying — all detected subscriptions with amounts, billing cycles, and categories
  • What's coming up — alerts for payments due in the next 7 days
  • What you forgot about — subscriptions with stale evidence are flagged as expired
  • Spending breakdown — category charts and monthly/annual totals

How it works

  1. Connect your email account (Microsoft works now, Gmail coming soon)
  2. SubSniper fetches payment-related emails (receipts, invoices, billing notifications)
  3. Claude AI classifies each email — extracting service name, amount, currency, billing cycle
  4. Subscriptions appear in real-time as they're discovered
  5. Stale subscriptions (no recent receipts) are auto-flagged as expired

Classification is intentionally strict

  • Only automated transactional emails count (receipts, invoices from noreply@, billing@)
  • One-time purchases, newsletters, business conversations, and pay-as-you-go services are rejected
  • Emails from your own domains are filtered out before hitting the AI
  • Low-confidence classifications (< 75%) are discarded
  • False positives are worse than false negatives

Build & Run

Requires macOS 14+ and Swift Command Line Tools (no Xcode needed).

./run.sh

This builds the Swift package, wraps it in a .app bundle with proper Info.plist, ad-hoc signs it, and launches.

For quick iteration during development:

swift build && swift run SubSniper

Setup

  1. Claude API Key — Go to Settings > AI and enter your Anthropic API key (sk-ant-...). Used for email classification with Claude Haiku.
  2. Connect Email — Go to Settings > Email and click "Connect Microsoft" (or Gmail when available). OAuth2 with PKCE, no passwords stored.
  3. First Sync — Automatically starts after connecting, scans 1 year of emails.

Tech Stack

  • Swift Package — executable target, no .xcodeproj
  • SwiftUIMenuBarExtra with .window style
  • JSON persistence~/Library/Application Support/SubSniper/data.json
  • Claude Haiku — AI classification via Anthropic API
  • OAuth2 + PKCE — via ASWebAuthenticationSession, no client secrets
  • Security framework — Keychain storage with in-memory caching
  • Zero dependencies — no SPM packages, no CocoaPods

Project Structure

Sources/
  Models/          — Subscription, EmailAccount, BillingCycle, etc.
  State/           — AppState (UI), DataStore (persistence)
  Services/
    OAuth/         — OAuth2 PKCE flow for Gmail & Microsoft
    EmailScanner/  — Gmail API & Microsoft Graph email fetching
    AI/            — Claude classifier with strict rules
    ScanCoordinator — Orchestrates scan pipeline
  Views/           — SwiftUI views (tabs, settings, alerts, insights)
  Utilities/       — Keychain, formatting, constants
  Resources/       — KnownServices.json (icons, cancel URLs)

Features

  • Menu bar app (no dock icon)
  • Microsoft OAuth2 (with federated auth support)
  • Gmail OAuth2 (needs client ID)
  • AI-powered email classification
  • Streaming results (subs appear as they're found)
  • Parallel account scanning
  • Cancellable scans
  • Staleness detection (auto-expire inactive subs)
  • Spending insights with charts
  • Manual subscription CRUD
  • Push notifications for upcoming payments
  • Cancel flow (open URL, draft email)
  • Background scan scheduling
  • Launch at login
  • App Store distribution

License

MIT

About

Spot all your subscription online locally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors