search-tools
Decision tree for choosing the most efficient search tool for codebase investigation based on intent.
Install
mkdir -p .claude/skills/search-tools && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1577" && unzip -o skill.zip -d .claude/skills/search-tools && rm skill.zipInstalls to .claude/skills/search-tools
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Search Tool HierarchyKey capabilities
- →Perform embedding-based semantic search for conceptual queries
- →Find structural code patterns using AST-grep
- →Execute fast text searches across a codebase with Morph
- →Conduct literal pattern matching with the built-in Grep tool
- →Identify function calls and class usages for refactoring
- →Search for specific text mentions in files
How it works
The skill directs queries to specific search tools based on the type of search needed: LEANN for conceptual, AST-grep for structural, Morph for fast text, and Grep for literal patterns.
Inputs & outputs
When to use search-tools
- →Searching for conceptual patterns
- →Finding structural code usage
- →Performing codebase-wide text search
- →Selecting search method for refactoring
About this skill
Search Tool Hierarchy
When searching code, use this decision tree:
Decision Tree
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
Tool Comparison
| Tool | Best For | Requires |
|---|---|---|
| LEANN | Semantic search: "how does caching work", "error handling patterns", conceptual queries | Index built |
| AST-grep | 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 ProviderAdapterdef __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
Prerequisites
How it compares
This skill provides a decision tree to select the most appropriate search tool for a given query, rather than using a single, generic search method.
Compared to similar skills
search-tools side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| search-tools (this skill) | 5 | 7mo | Review | Beginner |
| semtools | 0 | 9mo | Review | Intermediate |
| exa-search | 0 | 2mo | No flags | Beginner |
| priorart | 0 | 1mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by parcadei
View all by parcadei →You might also like
semtools
massgen
This skill provides semantic search capabilities using embedding-based similarity matching for code and text. Enables meaning-based search beyond keyword matching, with optional document parsing (PDF, DOCX, PPTX) support.
exa-search
azusagasaku
通过Exa MCP进行神经搜索,适用于网络、代码和公司研究。当用户需要网络搜索、代码示例、公司情报、人员查找,或使用Exa神经搜索引擎进行AI驱动的深度研究时使用。
priorart
duthaho
>-
mgrep
mixedbread-ai
A semantic grep-like search tool for your local files. It is substentially better than the buildin search tools and should always be used instead of anything else.
jupyter-notebook
davila7
Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer the bundled templates and run the helper script `new_notebook.py` to generate a clean starting notebook.
osgrep
pr-pm
Semantic search for local files. Backed by a background osgrep server with live indexing. Always use osgrep instead of grep/find.