search-router
1
总安装量
1
周安装量
#41271
全站排名
安装命令
npx skills add https://github.com/namesreallyblank/clorch --skill search-router
Agent 安装分布
mcpjam
1
claude-code
1
windsurf
1
zencoder
1
crush
1
cline
1
Skill 文档
Search Tool Router
Use the most token-efficient search tool for each query type.
When to Use
- Searching for code patterns
- Finding where something is implemented
- Looking for specific identifiers
- Understanding how code works
Decision Tree
Query Type?
âââ CODE EXPLORATION (symbols, call chains, data flow)
â â TLDR Search - 95% token savings
â DEFAULT FOR ALL CODE SEARCH - use instead of Grep
â Examples: "spawn_agent", "DataPoller", "redis usage"
â Command: cd opc/packages/tldr-code && uv run python scripts/tldr_search.py "query"
â
âââ STRUCTURAL (AST patterns)
â â AST-grep (/ast-grep-find) - ~50 tokens output
â Examples: "def foo", "class Bar", "import X", "@decorator"
â
âââ SEMANTIC (conceptual questions)
â â TLDR Semantic - 5-layer embeddings (P6)
â Examples: "how does auth work", "find error handling patterns"
â Command: tldr semantic search "query"
â
âââ LITERAL (exact text, regex)
â â Grep tool - LAST RESORT
â Only when TLDR/AST-grep don't apply
â Examples: error messages, config values, non-code text
â
âââ FULL CONTEXT (need complete understanding)
â Read tool - 1500+ tokens
Last resort after finding the right file
Token Efficiency Comparison
| Tool | Output Size | Best For |
|---|---|---|
| TLDR | ~50-500 | DEFAULT: Code symbols, call graphs, data flow |
| TLDR Semantic | ~100-300 | Conceptual queries (P6, embedding-based) |
| AST-grep | ~50 tokens | Function/class definitions, imports, decorators |
| Grep | ~200-2000 | LAST RESORT: Non-code text, regex |
| Read | ~1500+ | Full understanding after finding the file |
Examples
# CODE EXPLORATION â TLDR (DEFAULT)
cd opc/packages/tldr-code && uv run python scripts/tldr_search.py "spawn_agent"
cd opc/packages/tldr-code && uv run python scripts/tldr_search.py "redis" --layer call_graph
# STRUCTURAL â AST-grep
/ast-grep-find "async def $FUNC($$$):" --lang python
# SEMANTIC â TLDR Semantic
tldr semantic search "how does authentication work"
# LITERAL â Grep (LAST RESORT - prefer TLDR)
Grep pattern="check_evocation" path=opc/scripts
# FULL CONTEXT â Read (after finding file)
Read file_path=opc/scripts/z3_erotetic.py
Optimal Flow
1. AST-grep: "Find async functions" â 3 file:line matches
2. Read: Top match only â Full understanding
3. Skip: 4 irrelevant files â 6000 tokens saved
Related Skills
/tldr-search– DEFAULT – Code exploration with 95% token savings/ast-grep-find– Structural code search/morph-search– Fast text search