Home / Blog / Explainers
Semantic code search vs grep for AI coding agents
Use grep when you know the exact identifier or literal and need every occurrence. Use semantic search when you know what the code does but not what it's called. Agents need both — and a call graph to connect the hit to its callers.
What grep is good at
Exact, exhaustive, instant. If the agent knows the identifier rrf_fuse, grep finds every occurrence and misses none. No index, no model, no ambiguity. Finder's guidance tells agents to keep using native exact search for exactly this case.
Where grep fails
Grep can't find "where do we retry failed uploads?" if the code calls it backoff_requeue. It ranks a comment mentioning "token" the same as the function that refreshes tokens. So agents grep, open the top matches, and read until they get lucky.
Semantic search embeds every chunk of code and the question into the same vector space, then ranks by meaning. Synonyms, renames and paraphrases stop mattering.
Why embeddings alone aren't enough
A semantic hit is a starting point. To change it safely the agent needs the callers, the callees and the tests — relationships embeddings don't capture. Finder builds a tree-sitter call graph for 21 languages and expands each hit breadth-first through it, including framework edges for React, Express, Django, Spring and Gin.
Side by side
| Need | Best tool |
|---|---|
| Every use of a known name | grep / ripgrep |
| "Where is X handled?" | Semantic search (finder) |
| Callers and tests of a symbol | Call graph (context) |
| What breaks if I change it | Call graph (impact) |
| Lines inside a known file | file-finder |
Frequently asked questions
Is semantic code search slower than grep?
Does semantic search work on any language?
Can I filter semantic results?
Put the right code in your agent's context
One command installs Finder and wires it into your harness. Start with 40 free credits.