akhatua2/snoopy

2

stars

34

commits

Python

primary language

Mar 1, 2026

updated

README

snoopy

Snoopy is a local-first macOS daemon that continuously records your digital activity into a single SQLite database. Every app switch, browser visit, terminal command, message, and clipboard copy — logged with timestamps, durations, and context. The data never leaves your machine.

What It Tracks

SourceTableInterval
Focus & Input
Active windowCGWindowList + NSWorkspacewindow_events2s
Keyboard / mouse idleCGEventSource(in window_events)
App launch / quitps process diffingapp_events10s
Screen lockIORegistrysystem_events5s
Browsing
Page visitsChrome / Arc / Safari / Firefoxbrowser_events30s
Active tabAppleScript (Chromium)(in window_events)
Page contentAccessibility (Chrome AX tree)page_content_events2s
Communication
iMessages~/Library/Messages/chat.dbmessage_events15s
WhatsApp chatsAccessibility (Catalyst AX tree)whatsapp_events2s
Slack messagesAccessibility (Electron AX tree)slack_events2s
Email metadataMail.app Envelope Indexmail_events60s
NotificationsmacOS notification centernotification_events30s
Zoom meetingsQuartz + Accessibilityzoom_events5m
Development
Shell commands~/.zsh_history (extended)shell_events10s
Claude sessions~/.claude/projects/*.jsonlclaude_events15s
File changesFSEvents (push-based)file_eventslive
ClipboardNSPasteboardclipboard_events2s
Environment
WiFi / Battery / Audio / Network / Media / Locationvarious macOS APIsrespective tables3s–5m
Apple NotesAppleScriptnote_events5m
RemindersAppleScriptreminder_events30m
Calendar / Oura ringEventKit / Oura APIcalendar_events / oura_daily30m / 24h

Installation

git clone https://github.com/akhatua2/snoopy.git && cd snoopy
uv sync
snoopy install

Permissions

Grant in System Settings > Privacy & Security:

PermissionWhy
AccessibilityWindow titles, keyboard idle
Full Disk AccessBrowser history, iMessage, notifications, Mail
Location ServicesGPS coordinates

Add to ~/.zshrc: setopt EXTENDED_HISTORY and setopt INC_APPEND_HISTORY. Optional: brew install nowplaying-cli · Set OURA_PAT=your_token in .env.


Usage

snoopy status                   # check daemon status
snoopy logs                     # view recent logs
snoopy stop                     # stop the daemon
snoopy start                    # start the daemon
snoopy restart                  # restart
snoopy menubar                  # launch menu bar app
snoopy uninstall                # remove everything

Querying

# What were you doing at 3 PM?
sqlite3 data/snoopy.db "
  SELECT datetime(timestamp, 'unixepoch', 'localtime') as t,
         app_name, window_title
  FROM window_events
  WHERE t BETWEEN '2026-02-25 15:00:00' AND '2026-02-25 15:30:00'
  ORDER BY timestamp;
"

# Top apps today
sqlite3 data/snoopy.db "
  SELECT app_name, ROUND(SUM(duration_s)/3600, 1) as hours
  FROM window_events
  WHERE date(timestamp, 'unixepoch', 'localtime') = date('now')
  GROUP BY app_name ORDER BY hours DESC;
"

Privacy

All data stays local. No network calls except Oura API (opt-in) and Location Services (opt-in). The DB is a plain SQLite file — delete it and it's gone. Clipboard from password managers is auto-excluded. No telemetry.

MIT License

Contributors

akhatua2

34 commits

akhatua2/snoopy

2

stars

34

commits

Python

primary language

Mar 1, 2026

updated

README

snoopy

Snoopy is a local-first macOS daemon that continuously records your digital activity into a single SQLite database. Every app switch, browser visit, terminal command, message, and clipboard copy — logged with timestamps, durations, and context. The data never leaves your machine.

What It Tracks

SourceTableInterval
Focus & Input
Active windowCGWindowList + NSWorkspacewindow_events2s
Keyboard / mouse idleCGEventSource(in window_events)
App launch / quitps process diffingapp_events10s
Screen lockIORegistrysystem_events5s
Browsing
Page visitsChrome / Arc / Safari / Firefoxbrowser_events30s
Active tabAppleScript (Chromium)(in window_events)
Page contentAccessibility (Chrome AX tree)page_content_events2s
Communication
iMessages~/Library/Messages/chat.dbmessage_events15s
WhatsApp chatsAccessibility (Catalyst AX tree)whatsapp_events2s
Slack messagesAccessibility (Electron AX tree)slack_events2s
Email metadataMail.app Envelope Indexmail_events60s
NotificationsmacOS notification centernotification_events30s
Zoom meetingsQuartz + Accessibilityzoom_events5m
Development
Shell commands~/.zsh_history (extended)shell_events10s
Claude sessions~/.claude/projects/*.jsonlclaude_events15s
File changesFSEvents (push-based)file_eventslive
ClipboardNSPasteboardclipboard_events2s
Environment
WiFi / Battery / Audio / Network / Media / Locationvarious macOS APIsrespective tables3s–5m
Apple NotesAppleScriptnote_events5m
RemindersAppleScriptreminder_events30m
Calendar / Oura ringEventKit / Oura APIcalendar_events / oura_daily30m / 24h

Installation

git clone https://github.com/akhatua2/snoopy.git && cd snoopy
uv sync
snoopy install

Permissions

Grant in System Settings > Privacy & Security:

PermissionWhy
AccessibilityWindow titles, keyboard idle
Full Disk AccessBrowser history, iMessage, notifications, Mail
Location ServicesGPS coordinates

Add to ~/.zshrc: setopt EXTENDED_HISTORY and setopt INC_APPEND_HISTORY. Optional: brew install nowplaying-cli · Set OURA_PAT=your_token in .env.


Usage

snoopy status                   # check daemon status
snoopy logs                     # view recent logs
snoopy stop                     # stop the daemon
snoopy start                    # start the daemon
snoopy restart                  # restart
snoopy menubar                  # launch menu bar app
snoopy uninstall                # remove everything

Querying

# What were you doing at 3 PM?
sqlite3 data/snoopy.db "
  SELECT datetime(timestamp, 'unixepoch', 'localtime') as t,
         app_name, window_title
  FROM window_events
  WHERE t BETWEEN '2026-02-25 15:00:00' AND '2026-02-25 15:30:00'
  ORDER BY timestamp;
"

# Top apps today
sqlite3 data/snoopy.db "
  SELECT app_name, ROUND(SUM(duration_s)/3600, 1) as hours
  FROM window_events
  WHERE date(timestamp, 'unixepoch', 'localtime') = date('now')
  GROUP BY app_name ORDER BY hours DESC;
"

Privacy

All data stays local. No network calls except Oura API (opt-in) and Location Services (opt-in). The DB is a plain SQLite file — delete it and it's gone. Clipboard from password managers is auto-excluded. No telemetry.

MIT License

Contributors

akhatua2

34 commits

Languages

Python

87.4%

Swift

7.9%

Rust

2.9%

Shell

1.8%