search-hierarchy
SolidSearch Tool Hierarchy
AI & Automation 3,951 stars
303 forks Updated 2 days ago MIT
Install
Quality Score: 92/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Search Tool Hierarchy
Use the most token-efficient search tool for each query type.
## Decision Tree
```
Query Type?
├── STRUCTURAL (code patterns)
│ → AST-grep (~50 tokens output)
│ Examples: "def foo", "class Bar", "import X", "@decorator"
│
├── SEMANTIC (conceptual questions)
│ → LEANN (~100 tokens if path-only)
│ Examples: "how does auth work", "find error handling patterns"
│
├── LITERAL (exact identifiers)
│ → Grep (variable output)
│ Examples: "TemporalMemory", "check_evocation", regex patterns
│
└── FULL CONTEXT (need complete understanding)
→ Read (1500+ tokens)
Last resort after finding the right file
```
## Token Efficiency Comparison
| Tool | Output Size | Best For |
|------|-------------|----------|
| AST-grep | ~50 tokens | Function/class definitions, imports, decorators |
| LEANN | ~100 tokens | Conceptual questions, architecture, patterns |
| Grep | ~200-2000 | Exact identifiers, regex, file paths |
| Read | ~1500+ | Full understanding after finding the file |
## Hook Enforcement
The `grep-to-leann.sh` hook automatically:
1. Detects query type (structural/semantic/literal)
2. Blocks and suggests AST-grep for structural queries
3. Blocks and suggests LEANN for semantic queries
4. Allows literal patterns through to Grep
## DO
- Start with AST-grep for code structure questions
- Use LEANN for "how does X work" questions
- Use Grep only for exact identifier matches
- Read files only after finding them via search
## DON'T
- Use Grep...
Details
- Author
- parcadei
- Repository
- parcadei/Continuous-Claude-v3
- Created
- 11 months ago
- Last Updated
- 2 days ago
- Language
- Python
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
search-tools
Search Tool Hierarchy
3,951 Updated 2 days ago
parcadei AI & Automation Listed
search-tools
Search Tool Hierarchy
552 Updated 6 days ago
vibeeval API & Backend Featured
search-router
Choose the right search tool for each query type
3,951 Updated 2 days ago
parcadei