Search Hierarchy
Decision tree that routes code searches to AST-grep, LEANN, Grep, or Read by query type.
- CCM score
- 45 of 100
- skills.sh installs
- 480
- GitHub stars
- 4K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers four query categories: structural code patterns, semantic questions, literal identifiers, and full-context reads
- Includes a token-efficiency comparison table and a sequence of examples for each tool
- Enforces routing through the
grep-to-leann.shhook, which blocks structural and semantic queries sent to Grep - Designed for agents that need to avoid reading irrelevant files before locating the right code
Install
$ npx -y skills add parcadei/continuous-claude-v3 --skill search-hierarchy -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
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
Details
- Repository
- github.com/parcadei/continuous-claude-v3
- Categories
- Agent Workflow & Planning, Memory & Context
- First seen
- Jun 3, 2026
Questions
What does the search-hierarchy skill do for Claude Code?
The search-hierarchy skill tells the agent which search tool to use for each query type, picking the most token-efficient option. Structural code patterns go to AST-grep, conceptual questions go to LEANN, exact identifiers go to Grep, and full file reads come last.
How do I install the search-hierarchy skill?
Run npx -y skills add parcadei/continuous-claude-v3 --skill search-hierarchy -y in your project. The skill then routes each search to AST-grep, LEANN, Grep or Read based on what the query asks for.
Which skills lead the Agent Workflow & Planning category on Claude Marketplaces?
search-hierarchy sits in the Agent Workflow & Planning category alongside grill-me, grill-with-docs, setup-matt-pocock-skills, grilling and prototype. Its own focus is cutting token use during code search rather than planning the work itself.
Who should use the search-hierarchy skill?
Developers using Claude Code on larger codebases who want to avoid wasting tokens on broad file reads will find it useful. It also enforces the routing through a hook that blocks the wrong search tool and suggests the right one.
More from parcadei/continuous-claude-v3
All 108- Agentica Server478
- Mot478
- Tldr Stats478
- Agentica Sdk477
- Agentica Spawn475
- System Overview475
- Tdd475
- Index At Creation473
- Router First Architecture470
- Implement Plan408
- Implement Task398
- Implement Plan Micro397
- Discovery Interview4.2K
- Premortem918
- Math892
- Dead Code748
- Github Search746
- Refactor626
- Recall Reasoning606
- Graceful Degradation604
- Explore582
- Agentic Workflow570
- Modular Code569
- Math Help552
Similar to Search Hierarchy
More Agent Workflow & Planningsearch-toolsSkillparcadei/continuous-claude-v3493 installsDecision tree routing code searches to the right tool: semantic, structural, text, or literal.
search-routerSkillparcadei/continuous-claude-v3489 installsRoutes each search query to the most token-efficient tool: TLDR, AST-grep, semantic search, Grep, or Read.
ASTMCP serverast-grep501 starsStructural code search and rule testing over local codebases using ast-grep patterns and YAML rules.
Tree-sitterMCP serverwrale311 starsTree-sitter parse trees, symbols, and queries across many languages for project code analysis.
ast-grepSkillast-grep/agent-skill20.6K installsStructural code search rules for ast-grep that match AST patterns instead of plain text.
file-searchSkillnetresearch/file-search-skill561 installsUnified search toolkit that routes text, structural, filename, document, and code-metric queries to the right CLI tool.