Index local source folders into index.json. Search by filename or snippet, then open the hit.
Menu extra for macOS 14+. Lives on the right of the menu bar. No Dock icon.
| Product | SpotlightCode |
| Bundle ID | engineer.badry.spotlightcode |
| Cask | spotlight-code |
| Status item | SF Symbol magnifyingglass |
| Panel | opaque ~360×420 pt |
| Piece | Behavior |
|---|---|
| Roots | Folders in roots.json. Add folder / Remove. |
| Index | Index now writes index.json. Cap 5000 files: Index capped at 5000 files. |
| Skip | node_modules, .git, .build, DerivedData, dist, .next, Pods. |
| Exclude | UserDefaults engineer.badry.spotlightcode.excludeGlobs. Defaults *.generated.swift, *.min.js. |
| Search | Field prompt filename or symbol. Hits cap 80. Empty: No results / Clear search. |
| Spotlight | After indexing, filenames are donated to Core Spotlight. Caption: After indexing, filenames also appear in Spotlight. |
| Intent | App Intent SearchCodeIntent (Search Code). |
| Empty | No folders / Add folder. Roots but never indexed: Not indexed yet / Index now. |
| Login | Open at Login from Settings (SMAppService). |
| File | Use |
|---|---|
SpotlightCode.app.zip |
Homebrew cask / unzip, drag SpotlightCode onto Applications |
brew tap BadryansahBangsawan/mac-menu-apps
brew trust BadryansahBangsawan/mac-menu-apps
brew install --cask spotlight-codebrew trust is required on Homebrew 6 or brew install --cask refuses the tap.
First open (ad-hoc signed):
xattr -cr /Applications/SpotlightCode.app
open /Applications/SpotlightCode.appStill blocked: System Settings → Privacy & Security → Open Anyway.
Do not run dist/SpotlightCode.app while /Applications/SpotlightCode.app is running (same bundle ID).
This is an LSUIElement extra. Proof it is running is the magnifyingglass status item on the right of the menu bar, not a window from Finder or Launchpad.
- Click that extra. The panel is opaque ~360×420 pt, not a 10px strip.
- If the bar is full, look behind the Control Center overflow chevron «.
- Double-clicking in Finder/Launchpad only changes the left-side app name. That is expected. There is no Dock icon.
- Empty roots: No folders → Add folder.
- Roots but never indexed: Not indexed yet → Index now. While running: Indexing….
- Search is a labeled field (prompt
filename or symbol). Query with no hits: No results → Clear search. - Click a hit to open that file (up to 80 rows). Status line: file count and last index time, or
never indexed. - Settings at the bottom: Index folders, Exclude globs, Open at Login, Quit.
If Core Spotlight donation fails, the panel shows that error and still keeps index.json.
No TCC prompts. Folder access is the standard open panel. Core Spotlight donation stays on this Mac.
| What | Where |
|---|---|
| Roots | ~/Library/Application Support/Spotlight Code/roots.json |
| Index | ~/Library/Application Support/Spotlight Code/index.json |
| Exclude globs | UserDefaults engineer.badry.spotlightcode.excludeGlobs |
| Open at Login | SMAppService.mainApp (Settings toggle) |
Decode failure → empty dump plus a red banner. The extra does not crash.
No network. Source text is indexed only on this Mac (index.json plus optional Core Spotlight).
brew uninstall --cask spotlight-codeOr delete /Applications/SpotlightCode.app. Then:
rm -rf "$HOME/Library/Application Support/Spotlight Code"Turn off Spotlight Code in System Settings → General → Login Items if it remains.
| What you see | What to do |
|---|---|
| Finder “opens” nothing / no Dock icon | Click the magnifyingglass extra on the right of the menu bar. |
| Extra missing | Overflow «, or pgrep -x SpotlightCode then open /Applications/SpotlightCode.app. |
| “Damaged” / cannot verify | xattr -cr /Applications/SpotlightCode.app. spctl --assess is rejected even when it runs. |
brew install --cask refuses the tap |
brew trust BadryansahBangsawan/mac-menu-apps |
| No folders | Add folder in the panel or Settings. |
| Index now disabled | Add a folder first. |
| Index capped at 5000 files | Cap hit. Success, not a crash. node_modules / .git / .build / DerivedData / dist / .next / Pods are skipped as directory names. |
| Hits stale after an external disk mounts | Re-add the folder, or quit and reopen after the volume is mounted. |
| No results | Query does not match path or snippet. Clear search. |
| ~10px empty strip under the bar | Reinstall from this repo. |
git clone https://github.com/BadryansahBangsawan/spotlight-code.git
cd spotlight-code
swift build -c release --product SpotlightCode
bash package-app.sh
open dist/SpotlightCode.appTag v* runs CI: SpotlightCode.app.zip. Never commit dist/.
Layout: Sources/ (SwiftPM executable), Info.plist, Assets/AppIcon.icns, package-app.sh. FunTheme.swift is copied verbatim (no shared package).
Why is there no Dock icon?
It is a menu extra. Click the magnifyingglass item on the right of the menu bar.
Does search leave this Mac?
No. Hits come from index.json. Core Spotlight donation is local.
Where is the index?
~/Library/Application Support/Spotlight Code/index.json.
How do I stop it opening at login?
Settings in the panel, or System Settings → General → Login Items → Spotlight Code.