Guides / AI coding agents

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.

Measured on macOS 27 in November 2026. Everything Locator is our app, so weigh its part accordingly.

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 searchClaude CodeCodex
Text inside files (grep, rg)about 181,000about 450
File names with find or mdfindabout 3,200about 90
  of which beyond the project (home folder, whole disk, Downloads, Library)about 530 
Folder sizes with duabout 1,100about 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:

CommandTimeEverything Locator
find ~ -iname '*invoice*2026*'131 secondsel search invoice 2026: milliseconds
find ~ -maxdepth 6 -name '*.xcodeproj'36 secondsel search '*.xcodeproj': milliseconds
du -sh ~/Library59 secondsel 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

Set it up

  1. In Everything Locator, turn on Settings › AI Agents (part of Everything Locator Pro).
  2. 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.
  3. 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.

Mac App Store