Skip to content

Auto-detect noisy app directories at startup#29

Merged
CalebisGross merged 1 commit intomainfrom
feat/auto-detect-exclusions
Mar 1, 2026
Merged

Auto-detect noisy app directories at startup#29
CalebisGross merged 1 commit intomainfrom
feat/auto-detect-exclusions

Conversation

@CalebisGross
Copy link
Copy Markdown
Collaborator

Summary

  • Scans ~/.config/ and ~/.local/share/ (Linux) or ~/Library/ (macOS) for known noisy apps
  • Adds detected apps as watcher exclusions before the filesystem watcher starts
  • Deduplicates against existing config exclusions so patterns don't stack
  • Registry of ~30 known noisy apps: browsers, editors/IDEs, communication apps, desktop environments, audio systems, package managers, cloud sync

Example output on this Linux machine

auto-detected noisy app path=~/.config/google-chrome pattern=.config/google-chrome/ description="Chrome browser storage"
auto-detected noisy app path=~/.config/Code pattern=.config/Code/ description="VS Code internal state"
auto-detected noisy app path=~/.config/Signal pattern=.config/Signal/ description="Signal messenger state"
auto-detect complete exclusions_found=10

How it works

DetectNoisyApps() runs at startup in main.go before NewFilesystemWatcher() is called. It does a fast os.Stat() check for each known app directory — no filesystem walking, no I/O beyond stat calls. Detected patterns are merged with config exclusions, then passed to the watcher constructor.

Files

  • internal/watcher/filesystem/autodetect.go — registry + detection logic
  • internal/watcher/filesystem/autodetect_test.go — 3 tests (pattern format, real detection, dedup)
  • cmd/mnemonic/main.go — hook detection into watcher startup

Test plan

  • make build passes
  • make check (fmt + vet) passes
  • make test — all tests pass, including 3 new autodetect tests
  • Test detected 10 noisy apps on this Linux machine (Chrome, Chromium, VS Code, Signal, VLC, dconf, PulseAudio, Docker Desktop, gnome-shell)
  • Verify on macOS (scans ~/Library/Application Support/ and ~/Library/Caches/)

Related

🤖 Generated with Claude Code

Scans ~/.config/ and ~/.local/share/ (Linux) or ~/Library/ (macOS) for
known noisy applications (browsers, editors, desktop environments,
communication apps, etc.) and adds them as watcher exclusions before
the filesystem watcher starts.

Detected patterns are deduped against existing config exclusions so
they don't stack. Runs every startup (fast — just os.Stat checks
against a registry of ~30 known apps).

Closes #27

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CalebisGross CalebisGross merged commit 5953fad into main Mar 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-detect noisy app directories at first startup

1 participant