Spotlight search

From spamsch/son-of-simon · View interactive version

Spotlight search is an AI agent skill from the GitHub repository spamsch/son-of-simon. Fast indexed search for files and documents on disk using macOS Spotlight (mdfind).

How to use this skill

Skill file

Behavior Notes

What This Tool Does

spotlight_search uses macOS Spotlight (mdfind) to search the system's pre-built file index. Searches are extremely fast (milliseconds) because they query an existing index rather than scanning files.

Recently Used Files

Use recently_used=True to find files the user actually opened/worked on. This uses macOS's kMDItemLastUsedDate tracking, which records when files were opened by any application.

Always use exclude_apps=True with recently_used unless the user specifically asks about applications. Without it, results are cluttered with system apps.

Important: Does NOT Search Mail.app

Mail.app uses Core Spotlight, a separate private index that is NOT accessible via mdfind. To search emails in Mail.app, always use search_emails (AppleScript-based). This tool can find .eml files stored on disk (e.g., in OneDrive, Downloads), but not messages in Mail.app mailboxes.

File and Document Search

Search by:

Content Types

| Type | What it matches |

|----------------|-------------------------------------------|

| pdf | PDF documents |

| image | All image formats (PNG, JPG, HEIC, etc.) |

| document | Text documents, Word, Pages, etc. |

| presentation | Keynote, PowerPoint |

| spreadsheet | Numbers, Excel |

| email | .eml files on disk (NOT Mail.app inbox) |

Common Patterns

Output Format

For files: Shows Name, Path, Type, Size, Modified date, and Last opened date (when available).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.