grepai Semantic Code Search
Prefer grepai over traditional search when the query is conceptual rather than literal.
When to Use grepai vs Other Tools
| Query Type | Tool | Example |
|---|---|---|
| Conceptual/semantic | grepai search | "user authentication flow" |
| Function tracing | grepai trace | "who calls CreateStudent" |
| Exact string match | Grep | "func Login(" |
| File pattern | Glob | "**/*_test.go" |
Commands
bash
# Semantic search - finds code by meaning grepai search "user authentication flow" grepai search "RFID check-in logic" grepai search "database connection handling" # Trace callers (who calls this function?) grepai trace callers "Login" grepai trace callers "CreateStudent" # Trace callees (what does this function call?) grepai trace callees "ProcessCheckin" # Check index status grepai status
Important Notes
- •Requires watcher running:
grepai watchmust be active for searches to work - •First run takes time: Initial indexing ~3-4 minutes for large codebases
- •Results include scores: Higher score (0.0-1.0) = more relevant
- •Output format: Shows file:lines with code snippets
Dynamic Documentation
For latest features and options:
Official Repository
code
WebFetch: https://raw.githubusercontent.com/yoanbernabeu/grepai/main/README.md
Search for updates
code
WebSearch: grepai semantic code search ollama 2025
Integration with Claude Code
When user asks to find code by concept:
- •Use
grepai search "query"via Bash tool - •Review results by relevance score
- •Use Read tool to examine top matches
- •Fall back to Grep only for exact string patterns
Troubleshooting
| Issue | Solution |
|---|---|
| "No results" | Check grepai watch is running |
| Slow/hanging | Verify ollama is running with ollama list |
| Missing model | Run ollama pull nomic-embed-text |