Need CONCEPTUAL/SEMANTIC search?
(how does X work, find patterns, understand architecture)
→ Use LEANN (/leann-search) - embedding-based semantic search
→ PreToolUse hook auto-redirects semantic Grep queries
Need to understand code STRUCTURE?
(find function calls, class usages, refactor patterns)
→ Use AST-grep (/ast-grep-find)
Need to find TEXT in code?
→ Use Morph (/morph-search) - 20x faster
→ If no Morph API key: fall back to Grep tool
Simple one-off search?
→ Use built-in Grep tool directly
Structural patterns: "find all calls to foo()", refactoring, find usages by type
MCP server
Morph
Fast text search: "find files mentioning error", grep across codebase
API key
Grep
Literal patterns, class/function names, regex
Nothing (built-in)
Examples
LEANN (semantic/conceptual):
"how does authentication work"
"find error handling patterns"
"where is rate limiting implemented"
AST-grep (structural):
"Find all functions that return a Promise"
"Find all React components using useState"
"Refactor all imports of X to Y"
Morph (text search):
"Find all files mentioning 'authentication'"
"Search for TODO comments"
Grep (literal):
class ProviderAdapter
def __init__
Regex patterns
LEANN Commands
# Search with semantic query
leann search opc-dev "how does blackboard communication work" --top-k 5
# List available indexes
leann list
# Rebuild index (when code changes)
leann build opc-dev --docs dir1 dir2 --no-recompute --no-compact --force
1---2name: search-tools3description: Search Tool Hierarchy4---56# Search Tool Hierarchy78When searching code, use this decision tree:910## Decision Tree1112```13Need CONCEPTUAL/SEMANTIC search?14 (how does X work, find patterns, understand architecture)15 → Use LEANN (/leann-search) - embedding-based semantic search16 → PreToolUse hook auto-redirects semantic Grep queries1718Need to understand code STRUCTURE?19 (find function calls, class usages, refactor patterns)20 → Use AST-grep (/ast-grep-find)2122Need to find TEXT in code?23 → Use Morph (/morph-search) - 20x faster24 → If no Morph API key: fall back to Grep tool2526Simple one-off search?27 → Use built-in Grep tool directly28```2930## Tool Comparison3132| Tool | Best For | Requires |33|------|----------|----------|34| **LEANN** | Semantic search: "how does caching work", "error handling patterns", conceptual queries | Index built |35| **AST-grep** | Structural patterns: "find all calls to `foo()`", refactoring, find usages by type | MCP server |36| **Morph** | Fast text search: "find files mentioning error", grep across codebase | API key |37| **Grep** | Literal patterns, class/function names, regex | Nothing (built-in) |3839## Examples4041**LEANN** (semantic/conceptual):42- "how does authentication work"43- "find error handling patterns"44- "where is rate limiting implemented"4546**AST-grep** (structural):47- "Find all functions that return a Promise"48- "Find all React components using useState"49- "Refactor all imports of X to Y"5051**Morph** (text search):52- "Find all files mentioning 'authentication'"53- "Search for TODO comments"5455**Grep** (literal):56- `class ProviderAdapter`57- `def __init__`58- Regex patterns5960## LEANN Commands6162```bash63# Search with semantic query64leann search opc-dev "how does blackboard communication work" --top-k 56566# List available indexes67leann list6869# Rebuild index (when code changes)70leann build opc-dev --docs dir1 dir2 --no-recompute --no-compact --force71```
Run npx skillmds@latest add vibeeval/search-tools in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Search Tool Hierarchy It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
vibeeval (@vibeeval) published this skill. Their other Agent Skills are listed on their SkillMD profile.