Skip to content

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
View on GitHub

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.sh hook, 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 -y

Installs 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

ToolOutput SizeBest For
AST-grep~50 tokensFunction/class definitions, imports, decorators
LEANN~100 tokensConceptual questions, architecture, patterns
Grep~200-2000Exact 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

Similar to Search Hierarchy

More Agent Workflow & Planning