Why AI coding agents are slow to find files on a Mac
Claude Code, Codex and other coding agents search files all day. Inside a project that is fast. The moment a search leaves the project, for a config file in ~/Library, a download, a log or another repository, the agent falls back to find or du over the whole home folder, and that can take minutes. We measured how often that happens and what it costs.
What we counted
We went through 60 days of logs on the Mac we build Everything Locator on: about 840 Claude Code sessions (including the subagents they start) and 124 Codex sessions, and counted every command that looked for files.
| Kind of search | Claude Code | Codex |
|---|---|---|
Text inside files (grep, rg) | about 181,000 | about 450 |
File names with find or mdfind | about 3,200 | about 90 |
| of which beyond the project (home folder, whole disk, Downloads, Library) | about 530 | |
Folder sizes with du | about 1,100 | about 20 |
Two things stand out. Almost all searches are for text inside files, a job for grep and rg. And file-name searches beyond the project are a small share, about 9 a day here, but they are the slow ones.
Where the time goes
A name search inside one repository finishes in well under a second. A search of the whole home folder has to read every folder in it. On the same Mac, with about 3.8 million files, typical agent commands took:
| Command | Time | Everything Locator |
|---|---|---|
find ~ -iname '*invoice*2026*' | 131 seconds | el search invoice 2026: milliseconds |
find ~ -maxdepth 6 -name '*.xcodeproj' | 36 seconds | el search '*.xcodeproj': milliseconds |
du -sh ~/Library | 59 seconds | el size ~/Library: milliseconds |
Coding agents usually stop a shell command after two minutes, so the first of these gives a partial answer, and the agent searches again or guesses. mdfind is quicker, but it only knows what Spotlight has indexed, and finds nothing when Spotlight indexing is off or broken (why Spotlight stops finding files).
Everything Locator keeps its own index of every file name, up to date as files change, so the same question is answered from memory instead of from the disk.
Does it save tokens?
Not much. The answers to these searches were short either way: a median of about 520 characters, roughly 150 tokens, because agents trim long output with | head and hide errors with 2>/dev/null. What a quick search saves is time, and the extra turns an agent spends when a search times out or comes back empty.
Connecting it costs little too. Claude Code loads the full definitions of MCP tools only when they are needed, and an Agent Skill adds only its one-line description to each turn until it is used.
When to keep find and rg
- Inside the project:
rg,fdandfindare quick on one repository and see everything in it, including hidden folders andnode_modules. - Text inside files: in a repository,
grepandrgread the files and match exact strings, patterns and code. Everything Locator never reads them; across the Mac, itscontent:search asks Spotlight which documents contain a word, as inel search content:invoice ext:pdf. - Everywhere else (the home folder, Downloads,
~/Library, other repositories, external drives, folder sizes): search the index first, then read or grep what it found.
Set it up
- In Everything Locator, turn on Settings › AI Agents (part of Everything Locator Pro).
- Connect your agent: Claude Code, Claude Desktop, Codex, Gemini CLI, Antigravity and other MCP apps are covered on AI agents; for the shell, install el.
- Install the Agent Skill, or add one line to
~/.claude/CLAUDE.md(Claude Code),~/.codex/AGENTS.md(Codex) or~/.gemini/GEMINI.md(Gemini CLI):
To find files outside the current project, or folder sizes, use el (Everything Locator) instead of find, mdfind or du: el search, el size. Inside the project, keep using rg and find.
Give your agent an index of the whole Mac
Everything Locator answers name, size and date searches across the Mac in milliseconds, for you and for your AI agents.