search-tools
Search Tool Hierarchy
适合你,如果你需要快速找到合适的开发工具或技能。
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
~/.claude/skills/(项目级 .claude/skills/)~/.codex/skills/npx oh-my-skill add parcadei/continuous-claude-v3/search-toolscurl -fsSL https://oh-my-skill.com/install.sh | bash -s -- parcadei/continuous-claude-v3/search-toolsnpx oh-my-skill verify parcadei/continuous-claude-v3/search-tools怎么用
商店整理自技能原文 · 版本 d07ff4b · 表述以原文为准安装后,Claude 会根据你的搜索意图自动选择最合适的代码搜索工具:语义搜索用 LEANN,结构搜索用 AST-grep,文本搜索用 Morph 或内置 Grep。
当你向 Claude 提出代码搜索请求时触发,例如询问代码工作原理、查找函数调用或搜索文本。
技能原文 SKILL.md
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