search-hierarchy

Classify query types and recommend token-efficient search tools.

3.9k|296|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/parcadei/Continuous-Claude-v3 --skill search-hierarchy-parcadei
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: search-hierarchy
Source: https://github.com/parcadei/Continuous-Claude-v3/tree/main/.claude/skills/search-hierarchy
Command: npx skills add https://github.com/parcadei/Continuous-Claude-v3 --skill search-hierarchy-parcadei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you select the most token-efficient search tool (AST-grep, LEANN, Grep, or Read) based on the type of query, preventing wasted tokens and improving search accuracy.

Core Features & Use Cases

  • Query Type Classification: Automatically determines if a query is structural, semantic, literal, or requires full context.
  • Tool Recommendation: Suggests the optimal search tool for each query type.
  • Hook Integration: Integrates with a hook (grep-to-leann.sh) to enforce tool selection and guide user behavior.
  • Use Case: When asking "how does the authentication logic work in the codebase?", the system will correctly identify it as a semantic query and recommend LEANN, rather than using a less effective tool like Grep.

Quick Start

Use the search-hierarchy skill to find all async functions in the python codebase.

Frequently Asked Questions about search-hierarchy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to choose a code search tool for token efficiency?

The best way to choose a code search tool for token efficiency is to classify your query as structural, semantic, literal, or full context. This decision tree then routes you to AST-grep, LEANN, Grep, or Read to prevent wasted tokens.

How do I find structural code patterns using AST-grep instead of standard Grep?

To find structural code patterns using AST-grep, you identify your query as structural rather than literal. The search hierarchy recommends AST-grep for matching code patterns, reserving standard Grep only for exact identifiers.

When should I use semantic search over Grep for conceptual code questions?

You should use semantic search over Grep for conceptual code questions when your query requires understanding meaning rather than exact matches. The search hierarchy classifies these as semantic and recommends LEANN to find conceptual logic.

Does the search hierarchy require any dependencies to enforce tool selection?

The search hierarchy requires no external dependencies to enforce tool selection. It integrates internally with a hook, specifically the grep-to-leann.sh script, to guide user behavior and ensure optimal tool usage without extra installations.

Why does using Read as a search method waste tokens?

Using Read as a search method wastes tokens because it loads full context unnecessarily. The search hierarchy designates Read as a last resort, prioritizing AST-grep, LEANN, or Grep to improve search accuracy and minimize token consumption.